You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes non-standalone content is supposed to go inside a document that has some top-level headers already, so starting the rendered content headers with <h1> would not be desirable. In Docutils, this is fixed with the initial_header_level option. In rust-rst, rst_renderer::render_html() doesn't seem to support any options besides the standalone mode and it initializes the HTMLRenderer.level (used for rendering elements::Title) to 0.
It would be helpful to provide an option to set some other value than zero here. Additional options will likely be useful in the future as well, so adding an extra API to render content with an options struct or something might be a good idea?
The text was updated successfully, but these errors were encountered:
Sounds very useful. I also think that in the future, we might want more options like passing custom directives or so.
I think I’ll research a bit how to best do options these days (is the builder pattern still en vogue or what?) and then accept Into<Options> in place of the options, an implementation for bool (which would simply set Options.standalone)
I’m not super concerned about backwards compat as this is still 0.x, but why break stuff if we can avoid it?
Sometimes non-standalone content is supposed to go inside a document that has some top-level headers already, so starting the rendered content headers with
<h1>
would not be desirable. In Docutils, this is fixed with the initial_header_level option. In rust-rst,rst_renderer::render_html()
doesn't seem to support any options besides the standalone mode and it initializes theHTMLRenderer.level
(used for renderingelements::Title
) to 0.It would be helpful to provide an option to set some other value than zero here. Additional options will likely be useful in the future as well, so adding an extra API to render content with an options struct or something might be a good idea?
The text was updated successfully, but these errors were encountered: