Skip to content

Enable Kroki on reStructuredText and Textile documents

What does this MR do?

Enable the Kroki filter on non-Markdown/AsciiDoc formats like reStructuredText and Textile.

Resolves #324766 (closed)

Screenshots (strongly suggested)

Here's a Textile document with a PlantUML diagram rendered using Kroki:

image

And a reStructuredText document:

image

Does this MR meet the acceptance criteria?

Conformity

Open question

As mentioned in #324766 (comment 534236839), the Kroki filter expects the following structure:

%(pre[lang="#{diagram_type}"] > code)

As you can see the lang attribute is expected on the <pre> element instead of the <code> element. I don't recall exactly why I did that (nor the reasoning behind this choice) but it's interesting to note that it will actually work when the KrokiFilter is executed after the SyntaxHighlightFilter.
Having said that, I think it would be better to execute the Kroki filter first. To do so, we should update the CSS selector and make sure that the Kroki filter is always executed before the syntax highlighter filter. What do you think?

Apart from that, it's working as expected.

groupproject management devopsplan Technical Writing docsfeature backend

Edited by Guillaume Grossetie

Merge request reports

Loading