Add a wiki-links extra for [[Page Name]] links - #720
Open
ChrisJr404 wants to merge 1 commit into
Open
Conversation
Adds an opt-in wiki-links extra that turns [[Page Name]] into a link to another page, modelled on the wikilinks extension from Python-Markdown. The generated URL and CSS class are configurable through the base_url, end_url and html_class options, plus an optional build_url callable for full control over the href. The extra is off by default and the anchor is hashed so later stages leave labels and URLs containing underscores alone. Addresses trentm#221.
ChrisJr404
force-pushed
the
wiki-links-extra
branch
from
August 19, 2026 03:06
5ec1a71 to
884d90b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds an opt-in
wiki-linksextra so that[[Page Name]]turns into a link to another page, which is the feature asked for in #221. It is modelled on the wikilinks extension from Python-Markdown, so the target URL and CSS class are configurable:base_url,end_urlandhtml_classcover the common cases, and there is an optionalbuild_urlcallable if you want full control over the href. For example:Like the other extras it is off by default, so existing output is unchanged. The generated anchor is hashed the same way
link-patternsdoes it, which keeps the later stages from mangling labels or URLs that contain underscores. Inline code and fenced blocks are left alone because they are already hashed by the time the extra runs.I added two tm-cases (a default one and one exercising the options) and a CHANGES entry.
make testoneandmake testredosboth pass locally.