-
Notifications
You must be signed in to change notification settings - Fork 81
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
Conversation
<div class="math numbered" id="eq-my_label" number="1"> | ||
w_{t+1} = (1 + r_{t+1}) s(w_t) + y_{t+1} | ||
</div> |
There was a problem hiding this comment.
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.
// 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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where I was going to:
https://docutils.sourceforge.io/docs/ref/rst/directives.html#math
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See also sphinx-doc/sphinx#8476
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.