-
Notifications
You must be signed in to change notification settings - Fork 72
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
✨ Add ndf
role, deprecate need_func
& [[...]]
in need content
#1269
Conversation
ndf
rolendf
role (to replace [[...]]
in content)
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1269 +/- ##
==========================================
+ Coverage 86.87% 87.00% +0.12%
==========================================
Files 56 60 +4
Lines 6532 6970 +438
==========================================
+ Hits 5675 6064 +389
- Misses 857 906 +49
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
ndf
role (to replace [[...]]
in content)ndf
role (to replace [[...]]
in need content)
9cb3a42
to
1103fc5
Compare
1103fc5
to
6b9822e
Compare
6b9822e
to
5bf1c3d
Compare
5bf1c3d
to
a3c642c
Compare
Hi @chrisjsewell, thanks for this proposal.
For the URL links I'm hesitant to add it without reported use case. |
Yeh cheers
Eurgh, I would be very surprised if someone else was specifically using |
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.
LGTM in general, docs and still deprecation missing, but can be done in an upcoming PR
@@ -37,4 +39,6 @@ DYNAMIC FUNCTIONS | |||
|
|||
nested id also :need_func:`[[copy("id")]]` |
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.
if need_func
is deprecated, please add a check for the warning in the test case
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.
I'm okay with the changes. Good work.
But as this is a not backward-compatible change, we should add the docs and a depreciation warning for need_fuc with this PR.
yep I was already about to add docs and deprecations 👍 , but just to note, this PR on its own is backwards compatible; it is just adding a new role |
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.
Looks great. Thanks for the doc updates.
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.
Nice work and good addition to SN.
ndf
role (to replace [[...]]
in need content)ndf
role, deprecate need_func
& [[...]]
in need content
There are currently two ways to use dynamic functions within need directive's content:
[[copy("id")]]
; is problematic, because it does not adhere to the rst/myst syntax specification, and has already show to cause issues and be surprising to users (🐛 FIX disallow dynamic functions[[..]]
in literal content #1263):need_func:`[[copy("id")]]`
; is better but overly verboseIn this PR, I introduce a new role, which I believe should supersede both:
:ndf:`copy("id")`
(open to other suggestions for the name)Here we take the entire content to be the function, as so do not require the
[[]]
, reducing verbosity and processingNote, one thing that the role approach cannot do, is to allow placeholders in URLs, e.g.
`link <http://www.[[copy('id')]]>`_
However, if this is truly required, then I believe we should introduce a new role specifically for that.
if this is accepted, I would then move to emit warnings if users already use
[[...]]
, explaining how to replace them,then eventually remove
[[...]]
after some deprecation periodthings to clarify:
[[...]]
in contentneed_func