Skip to content
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

Merged
merged 1 commit into from
Mar 12, 2021
Merged

Conversation

cameel
Copy link
Member

@cameel cameel commented Mar 12, 2021

A bare-bones markdown rendering for README.md. Not very pretty but still better than serving users a file for download.

@cameel cameel self-assigned this Mar 12, 2021
@cameel cameel force-pushed the markdown-readme-to-html branch from 2586fbd to 130e8d6 Compare March 12, 2021 16:38
@cameel cameel marked this pull request as ready for review March 12, 2021 16:39
@cameel cameel merged commit 25ae4ad into gh-pages Mar 12, 2021
@cameel cameel deleted the markdown-readme-to-html branch March 12, 2021 17:05
- name: Render README.md to HTML
run: |
pip install markdown
echo "<html><body>$(python -m markdown README.md)</body></html>" > README.html
Copy link
Member

@axic axic Mar 12, 2021

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?

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

@cameel cameel Mar 12, 2021

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.

Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants