-
Notifications
You must be signed in to change notification settings - Fork 414
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
README.md -> README.html on S3 sync #85
Conversation
2586fbd
to
130e8d6
Compare
- name: Render README.md to HTML | ||
run: | | ||
pip install markdown | ||
echo "<html><body>$(python -m markdown README.md)</body></html>" > README.html |
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.
Hmm, why doesn't that markdown package do the "html/body" wrapping, seems weird?
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.
Well, its primary use case is being a library not a command-line tool, so I guess you would normally just embed it in a page you already have. The library does have some command-line options but I could not see anything to add the document wrapper around it. I tried mistune
too but it produced very similar output, without the wrapper (at least by default).
I didn't want to dig too deep into that because I expect that we'll just replace it completely when we add the system that automatically lists available binaries. But if you think it's worthwhile I could try some other libs. For example markdown-html-action does not add these on its own (it only adds doctype
) so apparently the library it uses does it automatically.
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.
The documentation (https://python-markdown.github.io/cli/) just mentions echo "Some **Markdown** text." | python -m markdown > output.html
, without the need for extra html/body wrapping.
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.
Yeah. Would be nice if they mentioned it explicitly but anyway I found Python-Markdown/markdown#492 which says that it's by design and that a CLI option won't be added because it's out of scope. Unfortunately it's our responsibility to provide a template/wrapper when using it.
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.
Thanks! They could have just documented this on their usage guide, sigh.
A bare-bones markdown rendering for README.md. Not very pretty but still better than serving users a file for download.