martinthomson / i-d-template

A template for IETF internet draft git repositories
Other
211 stars 183 forks source link

Issue when leveraging mmark as processor with unknown flags #295

Closed dwaite closed 3 years ago

dwaite commented 3 years ago

Attempting to follow the walkthrough for creating a new working group repo. This error also happens after check-in via the Github Actions support.

I was not able to find reference to the -xml2 or -page argument at github.com/mmarkdown/mmark (even historically) so I'm rather confused.

I was able to build successfully after locally removing these flags from make.mk

cat draft-etc-etc.md  | mmark -xml2 -page | lib/add-note.py | xml2rfc -q -s 'Setting consensus="true" for IETF STD document' --rfc-base-url https://datatracker.ietf.org/doc/html/ --id-base-url https://datatracker.ietf.org/doc/html/ --cache=/github/home/.cache/xml2rfc --v2v3 /dev/stdin -o /dev/stdout >draft-etc-etc.xml
flag provided but not defined: -xml2

SYNOPSIS: mmark [OPTIONS] [FILE...]
  -ast
        print abstract syntax tree and exit
  -bibliography
        generate a bibliography section after the back matter (default true)
  -css string
        link to a CSS stylesheet (only used with -html)
  -fragment
        don't create a full document
  -head string
        link to HTML to be included in head (only used with -html)
  -html
        create HTML output
  -index
        generate an index at the end of the document (default true)
  -man
        generate manual pages (nroff)
  -markdown
        generate markdown (experimental)
  -unsafe
        allow unsafe includes
  -version
        show mmark version
  -w    write to source file when generating markdown
  -width int
        text width when generating markdown (default 100)
Error: Unable to parse the XML document: /dev/stdin
 /dev/stdin: Line 2: Document is empty
dwaite commented 3 years ago

I suspect this change was when mmark migrated from github.com/miekg/mmark, so sometime before August 2018.

Not feeling I'm on the beaten path using mmark with this toolset, but I'll probably proceed on a fork since it appears to work locally. The change is small enough against main.mk that I will not plan a PR unless desired.

martinthomson commented 3 years ago

@dwaite, I would be very happy to correct mmark usage here. I just haven't used mmark myself in a while, but it's an excellent tool and it's shame to see that it is rotten. If removing the flags is sufficient, then I'll do that. Of course, if you have changes to contribute that go further (or are more careful than I'd be) that would be greatly appreciated.

dwaite commented 3 years ago

I have just removed the flags - but then had to do quite a bit of search-and-replace to have automation create and use my own containers/actions.

I've previously used kramdown with your tools, but switched to mmark for this particular document due to another author's preference.

martinthomson commented 3 years ago

@dwaite, thanks. I've dropped the tags. If you are able to test this and confirm that it works, that would be good.

dwaite commented 3 years ago

I made the exact same change which worked fine. https://github.com/dwaite/i-d-template/commit/4836f4d4ec57e6b0ff6686bdfa917ba67b0574d1