executablebooks / markdown-it-docutils

A markdown-it plugin for implementing docutils style roles/directives.
https://executablebooks.github.io/markdown-it-docutils/
MIT License
12 stars 8 forks source link

👌 IMPROVE: Add `parsed_directive` and `parsed_role` parent tokens #34

Closed fwkoch closed 2 years ago

fwkoch commented 2 years ago

Adds:

Other context here: https://github.com/executablebooks/markdown-it-docutils/pull/31#discussion_r814889819

welcome[bot] commented 2 years ago

Thanks for submitting your first pull request! You are awesome! :hugs:
If you haven't done so already, check out EBP's Code of Conduct and our Contributing Guide, as this will greatly help the review process.
Welcome to the EBP community! :tada:

chrisjsewell commented 2 years ago

Cheers guys, so yep as we have just discussed, this change ties into: https://github.com/executablebooks/markdown-it-docutils/pull/31#discussion_r814889819:

In order to not lose the information, of what nodes were generated from directives/roles, we now include a parent node, e.g.

<admonition class="note" directive="true">
  ...

will now be output as:

<parsed_directive name="note">
  <admonition class="note">
    ...
welcome[bot] commented 2 years ago

Congrats on your first merged pull request in this project! :tada: congrats
Thank you for contributing, we are very proud of you! :heart: