mirror of
https://github.com/caddyserver/website.git
synced 2025-04-22 21:16:15 -04:00
link directives to response matchers documentation
This commit is contained in:
parent
0a84fcf49a
commit
d90b27681f
5 changed files with 44 additions and 20 deletions
|
@ -55,6 +55,19 @@ $(function() {
|
|||
let text = item.innerText.replace(/</g,'<').replace(/>/g,'>');
|
||||
$(item).html('<a href="/docs/caddyfile/matchers#syntax" style="color: inherit;" title="Matcher token">' + text + '</a>');
|
||||
});
|
||||
// Add links to [<matcher>] or named matcher tokens in code blocks.
|
||||
// The matcher text includes <> characters which are parsed as HTML,
|
||||
// so we must use text() to change the link text.
|
||||
$('pre.chroma .s:contains("<response_matcher>")')
|
||||
.add('pre.chroma .s:contains("<inline_response_matcher>")')
|
||||
.map(function(k, /** @type { HTMLElement } */ item) {
|
||||
const anchor = document.createElement("a");
|
||||
anchor.href = "/docs/caddyfile/response-matchers#syntax";
|
||||
anchor.style.color = "inherit";
|
||||
anchor.title = "Response matcher token";
|
||||
item.replaceWith(anchor);
|
||||
anchor.appendChild(item);
|
||||
});
|
||||
|
||||
// Wrap all tables in a div so we can apply overflow-x: scroll
|
||||
$('table').wrap('<div class="table-wrapper"></div>');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue