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

👌 IMPROVE: Add parsed_directive and parsed_role parent tokens #34

Merged
merged 3 commits into from
Mar 29, 2022

Conversation

fwkoch
Copy link
Member

@fwkoch fwkoch commented Mar 28, 2022

Adds:

  • parsed_directive and parsed_role tokens to wrap parsed content
  • legend tokens for paragraphs after caption in figure

Other context here:
#31 (comment)

@welcome
Copy link

welcome bot commented Mar 28, 2022

Thanks for submitting your first pull request! You are awesome! 🤗

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! 🎉

token.content.trim() ? token.content.split(/\r?\n/) : [],
directive
)
const directiveOpen = new state.Token("parsed_directive_open", "", 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good!

Comment on lines +73 to 78
// Ensure `meta` exists and add the directive options to parsed child
newTokens[1].meta = {
directive: true,
...data.options,
...newTokens[0].meta
...newTokens[1].meta
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As just discussed, I don't think we need this any more, since you can retrieve this info from the (directive) parent node.

@chrisjsewell
Copy link
Member

Cheers guys, so yep as we have just discussed, this change ties into: #31 (comment):

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">
    ...

@chrisjsewell chrisjsewell changed the title Update to support myst spec 👌 IMPROVE: Add parsed_directive and parsed_role parent tokens Mar 29, 2022
@chrisjsewell chrisjsewell merged commit 4dd2959 into main Mar 29, 2022
@welcome
Copy link

welcome bot commented Mar 29, 2022

Congrats on your first merged pull request in this project! 🎉
congrats

Thank you for contributing, we are very proud of you! ❤️

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.

3 participants