Replies: 2 comments 2 replies
-
What you are looking for is exactly the |
Beta Was this translation helpful? Give feedback.
-
Not all markdown links that point to a page use the same page's title as the link text, e.g.
Also, what about if we want to link to a section on the page, for example What if we automate this instead? |
Beta Was this translation helpful? Give feedback.
-
There're various macros for crossrefs to specced definitions (e.g.
{{DOMXref}}
for Web APIs), but none works for referring to a page such as Applying SVG effects to HTML content, and writers have to manually create a Markdown link in this case.Most such links have a text identical to the linked page's title, however page titles can change over time, and it's both impractical and unnecessary to require a writer that changes even a single page title to also change every occurrence of this title on other pages. (The situation is even more serious for l10n contents as there're much fewer people there.)
Therefore, I propose to add a new macro
{{Title}}
(name to be settled down later):where:
$1
: the link (without a locale) of which the page title is to be shown, e.g."/docs/Web/SVG/Applying_SVG_effects_to_HTML_content"
. (Is the/docs
part even necessary?)$2
(optional): a boolean value indicating if the title's case needs changing to lower case. Defaults tofalse
.This macro can reuse the code of existing macros like
{{CSSXref}}
as it simply fetches thetitle
key from the front matter.Note:
{{ShortTitle}}
can also be considered, but I doubt how useful it would be.$1
and$2
whose value is an anchor on the page and the macro returns the heading for that anchor, but dropped this part as such info isn't available from the front matter.Beta Was this translation helpful? Give feedback.
All reactions