-
Notifications
You must be signed in to change notification settings - Fork 219
✨ NEW: extended URL link customisation #695
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
Conversation
Codecov ReportBase: 89.99% // Head: 89.72% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #695 +/- ##
==========================================
- Coverage 89.99% 89.72% -0.27%
==========================================
Files 23 22 -1
Lines 2589 2658 +69
==========================================
+ Hits 2330 2385 +55
- Misses 259 273 +14
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
|
This is essentially a more extensible version of https://myst-tools.org/docs/mystjs/external-references#wikipedia-links etc |
The `myst_url_schemes` configuration has been extended,
in a back-compatible manner,
to also allow customisation of the link URL/text, via templates.
The `inline_attrs` extension also allows for specific links
to be marked as external, using `{.external}`.
a03820b to
254c35c
Compare
|
Only looked through the docs and not the code, this looks great. On the face of it very similar to the like transformers we have in mystjs, but allows these to be set as data. The config options look sensible. There is also very similar functionality in the extlink in sphinx: How do you think this compares to extlink, and/or the advantages of this to address similar/same functionality? I like that these are picked up as markdown links, but maybe the config can be closer, or the same as sphinx already has? |
These allow word functionality, by not simply using the Note I explicitly don't allow full jinja templating or actual python function manipulation of the string, in order to still allow for a "language-agnostic" configuration. I believe this is a good middle ground, of "full-extensibility" vs cross-language compatibility |
|
Yep makes sense, the tuple format isn't very customizable, and this allows for named parts but stays close to a familiar format (jinja) without the complexity (which isn't necessary for links). I feel like this is something that we could pick up really easily in mystjs from a config/functionality standpoint so don't see any divergence there! I like the idea of having some of these turned on by default in jupyterbook in the future, especially the wiki/doi links. |
The
myst_url_schemesconfiguration has been extended, in a back-compatible manner,to also allow writing as a dictionary, with customisations of the link URL/text, via templates, such as:
Allowing for
<gh-issue:639>and[URI](wiki:Uniform_Resource_Identifier#URI_references).The
inline_attrsextension also allows for specific links to be marked as external, using[](my-link){.external}.