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

Feat: add post render hook #60

Merged
merged 13 commits into from
Jun 22, 2022
Merged

Feat: add post render hook #60

merged 13 commits into from
Jun 22, 2022

Conversation

agoose77
Copy link
Owner

@agoose77 agoose77 commented Jun 21, 2022

This PR adds some lifecycle hooks and makes the math parsing a responsibility of MarkdownIt. We still use the ILatexTypesetter interface for typesetting, but this is done explicitly as a post-Markdown rendering transformation.

New Features:

  • IPluginProvider.rank: order of plugin registration, ascending (default 100)
  • IPluginProvider.postRenderHook: provider of IPostRenderer object
  • IPluginProvider.preParseHook: provider of IPreParser object

IPostRenderer:

  • IPostRenderer.rank: order of callback, ascending (default 100)
  • IPostRenderer.postRender: callback after rendering to HTML is complete

IPreParser:

  • IPreParser.rank: order of callback, ascending (default 100)
  • IPreParser.preParser: callback before parsing is performed. Transforms the parsed text.

We still need to ship our own math renderer to render `math_` tokens, so let's avoid using two different renderers in the same implementation
@agoose77 agoose77 marked this pull request as ready for review June 22, 2022 17:48
@agoose77 agoose77 merged commit 29a2e1d into main Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant