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

Implement Markdown tables support (GFM extension) #735

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

rock3r
Copy link
Collaborator

@rock3r rock3r commented Dec 19, 2024

This PR adds support for the GFM tables extension in the Markdown renderer. At a high level:

  • It creates the SimpleTableLayout (see its kdoc)
  • It creates GitHubTableProcessorExtension and GitHubTableRendererExtension
    • The former uses commonmark-ext-gfm-tables to parse the table markup
    • The latter renders it
  • It simplifies and improves the Markdown extensions API by opening a couple properties of the MarkdownProcessor and adding an experimental + operator to it, for extensions
  • Updates the Markdown readme mentioning the table extension
  • Adds a readme for the table extension (see it for details)
  • ImageOptim's the images in art/docs

rock3r and others added 10 commits December 19, 2024 16:49
BasicTableLayout is a simple table layout that lives in foundation. It
does not have styling (that'll be implemented in the ui layer) but does
all we need for Markdown, and other similar basic scenarios. It is not
lazy and its performances can surely be improved, but it works.
By making the MarkdownProcessor's extensions and CommonMark Parser
properties public, they are now accessible to extensions directly from
the processor itself, eliminating the need to pass them explicitly.

This, in turn, makes it possible to implement more complex extensions as
stateless objects, instead of stateful classes, further simplifying the
implementation and usage of extensions.
Add an experimental operator fun plus(extension) to MarkdownProcessor
and MarkdownBlockRenderer that allows users to easily create a copy of
either with an additional extension, if they need to.
We now have tables :)

Also make the image in there local, and pass ImageOptim on the other
pics in art/docs for good measure (and faster loading).
It's completely unnecessary for our needs.
@rock3r rock3r added new component A new component to implement markdown This issue impacts the Markdown rendering subsystem labels Dec 19, 2024
@rock3r rock3r requested a review from hamen December 19, 2024 16:38
@rock3r rock3r self-assigned this Dec 19, 2024
@rock3r rock3r linked an issue Dec 20, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
markdown This issue impacts the Markdown rendering subsystem new component A new component to implement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement non-lazy table component
2 participants