-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render Markdown in option docs for flakes and longDescription #539
Conversation
a648164
to
343026c
Compare
flake-info/src/data/pandoc.rs
Outdated
let roles_filter = Path::new(FILTERS_PATH).join("myst-reader/roles.lua"); | ||
let man_filter = Path::new(FILTERS_PATH).join("link-unix-man-references.lua"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docbook-writer/rst-roles.lua
defines additional roles for MD option docs that may be useful here (though probably not vital).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we're writing HTML, not DocBook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but if you previously rendered eg envar
and literal
differently you'll probably have to handle those roles to not render them all the same way. (haven't checked, just guessing that this may happen)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, we didn't do anything like that.
a8ff1ed
to
4c8e53a
Compare
Ah, |
e7af813
to
74d1f12
Compare
74d1f12
to
2d69ea5
Compare
Extension list taken from nixpkgs/doc/Makefile.
2d69ea5
to
601ae37
Compare
I've added Markdown rendering for As a reminder/note to self, XSS sanitisation is done by Elm. |
@ysndr ping |
(or @garbas) |
Looks good, and brings in some welcome cleanup |
Closes #535, closes #525
To do:
flake_info.nix
) alongsideflake-info
: we could set aDATADIR
variable in the Nix build that is detected at compile time and, if unset, defaults toCARGO_MANIFEST_DIR
so thatcargo run
still finds the files.pandoc
crate does not let us define precisely the flavour of Markdown we want (Commonmark with a few extensions) because it does not expose all of Pandoc's formats and extensions (notablycommonmark_x
and+fenced_divs
). For now I've set the format tomarkdown
, which is hopefully a superset, but if finer control is needed we will have toinvoke pandoc directlyor fork the crate. At least manpage references seem to render fine. Ping @jtojnar @pennaenix-security
. EDIT: this is a bug exposed by makingFlakeEntry
tagged: we don't support multiple licenses in flake packages, so previously flake packages with a list of licenses were parsed as apps instead.