Skip to content

Commit

Permalink
[Docs] Fix dead links when subsection title have underscore (shader-s…
Browse files Browse the repository at this point in the history
…lang#5662)

* [Docs] Fix dead links when subsection title have underscore

a minor change on build toc script: add underscore to link instead of replacing with "-"
then I re-run the script
also I tested on local server

* Update toc.html

---------

Co-authored-by: Ellie Hermaszewska <[email protected]>
Co-authored-by: Yong He <[email protected]>
  • Loading branch information
3 people authored Dec 2, 2024
1 parent cced76c commit 0586e5a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions docs/scripts/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ public static string getAnchorId(string title)
{
StringBuilder sb = new StringBuilder();
title = title.Trim().ToLower();

foreach (var ch in title)
{
if (ch >= 'a' && ch <= 'z' || ch >= '0' && ch <= '9'
|| ch == '-')
|| ch == '-'|| ch =='_')
sb.Append(ch);
else if (ch==' ' || ch =='_')
else if (ch == ' ' )
sb.Append('-');
}
return sb.ToString();
Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide/toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<li data-link="convenience-features#subscript-operator"><span>Subscript Operator</span></li>
<li data-link="convenience-features#tuple-types"><span>Tuple Types</span></li>
<li data-link="convenience-features#optionalt-type"><span>`Optional&lt;T&gt;` type</span></li>
<li data-link="convenience-features#if-let-syntax"><span>`if_let` syntax</span></li>
<li data-link="convenience-features#if_let-syntax"><span>`if_let` syntax</span></li>
<li data-link="convenience-features#reinterprett-operation"><span>`reinterpret&lt;T&gt;` operation</span></li>
<li data-link="convenience-features#pointers-limited"><span>Pointers (limited)</span></li>
<li data-link="convenience-features#extensions"><span>Extensions</span></li>
Expand All @@ -66,7 +66,7 @@
<li data-link="capabilities#conflicting-capabilities"><span>Conflicting Capabilities</span></li>
<li data-link="capabilities#requirements-in-parent-scope"><span>Requirements in Parent Scope</span></li>
<li data-link="capabilities#inference-of-capability-requirements"><span>Inference of Capability Requirements</span></li>
<li data-link="capabilities#inference-on-target-switch"><span>Inference on target_switch</span></li>
<li data-link="capabilities#inference-on-target_switch"><span>Inference on target_switch</span></li>
<li data-link="capabilities#capability-aliases"><span>Capability Aliases</span></li>
<li data-link="capabilities#validation-of-capability-requirements"><span>Validation of Capability Requirements</span></li>
</ul>
Expand Down

0 comments on commit 0586e5a

Please sign in to comment.