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
reST HTML5 compiler plugin #72
Conversation
rst2html5 interprets initial_header_level differently than the official docutils HTML4 writer.
record_dependencies is critical, it breaks recompiling the post when included files change and other similar things |
Actually, the post is recompiled if an included file (using the reST include directive) changes when using rest_html5. The dependency seems to be managed by the reST parser in docutils, not the HTML writer (and this seems more natural to me). Still, the HTML4 writer does update record_dependencies for images and stylesheets, seemingly repeating the code present in the reST parser, but I don't know what this repetition is good for. Do you have a concrete scenario where this causes a problem? |
I also discovered that rst2html5 doesn't handle HTML comments, and this breaks the TEASER_END mechanism. I'll see if I can get this fixed, so please keep this pull request on hold for now. |
Could you show me an example of which rst income and html5 outcome would you like from rst2html5? I mean, is there any special case for rst or html5 comments to Nikola? |
This reST code:
needs to produce this HTML:
With current docutil, it seems that any non-implemented reST directive produces an HTML comment. Nikola relies on this by looking for this HTML comment in a later step of the build process. |
Oh, and this:
also needs to produce
|
ok. I'll do it |
I've just pushed the implementation at BitBucket. Could you test the development version or do you need me to release a new version? I intend to release it after you test this feature. |
I've confirmed that your pushed change fixed the TEASER_END issue, thank you very much! ralsina: Do you still think that missing support for record_dependencies in rst2html5 is a problem? |
I am not sure, to be honest :-) We can always just try it. |
Please, keep me informed. I am willing to help. |
As far as I can tell, the plugin is ready. Dependencies on included files seem to work. MathJax works. I guess we should let @andredias make the new release before merging this, so that the normal |
I've also tested most of the old Nikola reST plugins (media, youtube, soundcloud, code-block, chart...) |
rst2html5 1.5 released! |
My site that uses this plugin is now live and happy, is there anything I need to do to get this accepted? |
I guess we could accept this into the repo — we are not forcing this down peoples’ throats yet. We might, one day. |
reST compiler plugin based on this HTML5 writer:
https://bitbucket.org/andre_felipe_dias/rst2html5
Code changes from the original reST plugin are rather trivial, as shown if you diff the two plugins.
Some settings recognised by the HTML4 writer are not recognised by rst2html5: record_dependencies, stylesheet_path and math_output. I haven't investigated the consequences of this (MathJax support might be broken?).