cabo / kramdown-rfc

An XML2RFC (RFC799x) backend for Thomas Leitner's kramdown markdown parser
MIT License
195 stars 83 forks source link

No `version="3"` attribute when using `--v3` #213

Open wiktor-k opened 1 year ago

wiktor-k commented 1 year ago

Hi,

I'd like to generate v3 rfc xml and I found that there's --v3 option but when I then process the resulting file with idnits it complains about the missing version attribute:

Inspecting file spec.xml                                                                                                

Errors:                                                                                                                 

   For xml checks, version 3 is required:

spec.xml(15): Expected <rfc ... version="3" ...>, found None

   Found 6 lines with control characters:

spec.xml(446): Found control character 0x09 in column 0
spec.xml(447): Found control character 0x09 in column 0
spec.xml(478): Found control character 0x09 in column 0
spec.xml(489): Found control character 0x09 in column 0
spec.xml(505): Found control character 0x09 in column 0
spec.xml(506): Found control character 0x09 in column 0

Is this something that can be easily adjusted?

Thanks for this great piece of software! :wave:

cabo commented 1 year ago

Hi Wiktor,

on 2023-10-10, at 10:21, Wiktor Kwapisiewicz @.***> wrote:

Hi,

I'd like to generate v3 rfc xml and I found that there's --v3 option but when I then process the resulting file with idnits it complains about the missing version attribute:

You need to run the output of kramdown-rfc through xml2rfc --v2v3 to obtain a v3 RFCXML file. kramdown-rfc deliberately relies on xml2rfc to generate whatever today’s definition of v3 RFCXML is embodied in that code.

Inspecting file spec.xml

Errors:

For xml checks, version 3 is required:

spec.xml(15): Expected <rfc ... version="3" ...>, found None

Found 6 lines with control characters:

spec.xml(446): Found control character 0x09 in column 0 spec.xml(447): Found control character 0x09 in column 0 spec.xml(478): Found control character 0x09 in column 0 spec.xml(489): Found control character 0x09 in column 0 spec.xml(505): Found control character 0x09 in column 0 spec.xml(506): Found control character 0x09 in column 0

Is this something that can be easily adjusted?

The messages about 0x09 are about HT (“TAB”) characters. Do not, ever, use these in a source file...

Grüße, Carsten

wiktor-k commented 1 year ago

You need to run the output of kramdown-rfc through xml2rfc --v2v3 to obtain a v3 RFCXML file. kramdown-rfc deliberately relies on xml2rfc to generate whatever today’s definition of v3 RFCXML is embodied in that code.

Ah, okay, I think I thought passing --v3 will just emit v3 xml:

$ kramdown-rfc --help
Usage: kramdown-rfc2629 [options] [file.md] > file.xml
Version: 1.7.1
    -V, --version                    Show version and exit
    -H, --help                       Show option summary and exit
    -v, --[no-]verbose               Run verbosely
    -3, --[no-]v3                    Use RFCXML v3 processing rules
    -2, --[no-]v2                    Use RFCXML v2 processing rules

Is that intended to be used in conjunction with xml2rfc --v2v3 or just an experimental option? (I'm not sure what does it exactly do)