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

✨ NEW: Fence directives #15

Merged
merged 1 commit into from
Nov 22, 2020
Merged

✨ NEW: Fence directives #15

merged 1 commit into from
Nov 22, 2020

Conversation

rowanc1
Copy link
Member

@rowanc1 rowanc1 commented Nov 22, 2020

Now supports not parsing the internals of a directive, which is helpful for things like math directives.
Supported by the skipParsing option on the directive.

Comment on lines +8 to +10
<div class="math numbered" id="eq-my_label" number="1">
w_{t+1} = (1 + r_{t+1}) s(w_t) + y_{t+1}
</div>
Copy link
Member Author

Choose a reason for hiding this comment

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

Right now the math doesn't add \[ around it. I am not sure we actually want this? The alternative is to use something else to notify mathjax.

Comment on lines +156 to +158
// Only number things if the directive supports numbering AND a name or label is provided
if (directive?.numbered && (name || label)) {
const target = newTarget(state, name || label, directive.numbered);
Copy link
Member Author

Choose a reason for hiding this comment

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

@choldgraf I am using name or label for things like equations a bit interchangably. The RST docs seem to say name is common, but EB suggests label for things like math? Let me know what the convention is!! This seems to work for now.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmmm - my personal understanding is that label is the "thing you reference" elsewhere (e.g. myeq1). E.g., the rst quickstart uses label quite a lot, very little "name". Where do you see name recommended in rst?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

The other place I have been looking is here:
https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#math

Which does say label -- missed that before.

Copy link
Member Author

Choose a reason for hiding this comment

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

image

Copy link
Member Author

Choose a reason for hiding this comment

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

Upon further conversation:

  • Use name. Label is directive specific (e.g. equation).

Copy link
Member Author

Choose a reason for hiding this comment

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

@rowanc1 rowanc1 merged commit 32be5d7 into master Nov 22, 2020
@rowanc1 rowanc1 deleted the feat/directiveFence branch November 22, 2020 19:50
rowanc1 added a commit that referenced this pull request Oct 28, 2022
rowanc1 added a commit that referenced this pull request Oct 28, 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.

2 participants