-
I used the following linked referenced by the documentation: https://github.github.com/gfm/#tables-extension- to test the tables. I did not get the expected output. I tried an example
And the HTML generated by Laika seems to be correct:
However it does not have the expected appearance: https://help.github.com/assets/images/help/writing/table-basic-rendered.png or as generated by GitHub:
I am assuming this is due to a CSS issue? If so were can I get an example CSS snippet to generate the expected output? If not what is missing? BTW, I also experimented with web tool but it did not work. Any way we can activate the GitHub flavor to experiment with these extensions? As final note: great work on Laika. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
I have added a CSS file that seems to be working with Laika. Will now look for a Github flavor CSS example for tables. |
Beta Was this translation helpful? Give feedback.
-
I have added CSS formatting of the table and the output seems ok. I tried all of the examples in the spec but detected possible parsing errors in examples: Because the documentation states that it does not follow the exact syntax for HTML output as shown in the GitHub spec, I don't know if this is intended. However I leave this informatin here in case it is of any use. |
Beta Was this translation helpful? Give feedback.
-
In contrast to some libraries which solely focus on translating Markdown to HTML, Laika supports multiple input and output formats. To enable this kind of flexibility it uses an internal AST format between the parsing and the rendering step. When it renders HTML, that renderer has no knowledge of which text markup format those AST nodes originated from, and in fact you could mix Markdown files and ReStructuredText files in the same batch transformation. For that reason the HTML output is not necessarily 100% aligned with what a text markup spec shows as the expected HTML result. Ideally such a spec should not actually rely on a specific output format. What Laika instead tries to adhere to, is the structure of AST nodes reflected by the HTML output in the various specs, and it is pretty precise in that respect. So when it comes to appearance, it indeed needs to be tweaked via CSS, as Laika currently does not come with default themes out of the box. This is planned for a later release (0.14), but it'll take some time until I get there. If you want to tweak the actual HTML nodes of the output, you can customize the renderer for specific AST nodes as described here: Customizing Rendering. Regarding the two examples you mention in your last comment: 200 (escaping the pipe) renders exactly as in the spec (apart from whitespace differences). In 204 (ignoring extra cells) the difference is also merely whitespace, although it maybe should not keep the line breaks for the empty cell. I'll probably create a separate ticket for this. If this answers your question, you can close the ticket, I'll label it as question. |
Beta Was this translation helpful? Give feedback.
-
It answers my questions. Thank you. |
Beta Was this translation helpful? Give feedback.
In contrast to some libraries which solely focus on translating Markdown to HTML, Laika supports multiple input and output formats. To enable this kind of flexibility it uses an internal AST format between the parsing and the rendering step. When it renders HTML, that renderer has no knowledge of which text markup format those AST nodes originated from, and in fact you could mix Markdown files and ReStructuredText files in the same batch transformation.
For that reason the HTML output is not necessarily 100% aligned with what a text markup spec shows as the expected HTML result. Ideally such a spec should not actually rely on a specific output format. What Laika instead tries to adhere to…