paritybit.ca

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 87ec48b8c8acd394d6490f13212f83391a35afdb
parent cd2fb6744ecd84e23426e6b6c19bb493939a5408
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Wed,  5 Feb 2020 16:59:09 -0500

Fix linking from table of contents

Linking from table of contents did not require extra landmark <a> tags,
the links in the table of contents will work if the ID of the headers is
the same as the destination of the links. The extra, non-visible <a>
elements caused accessibility issues and is a messy way of doing
internal links.

Additionally, remove the "back-to-top" arrows beside <h3> headers
because they were complicating the generation of the page and didn't
display well in browsers that didn't support that particular arrow
character.

Diffstat:
Mcompile | 11++++-------
Mstyle/main.css | 16----------------
2 files changed, 4 insertions(+), 23 deletions(-)

diff --git a/compile b/compile @@ -186,7 +186,7 @@ for page in $@; do sed -i "/<h5>$sectionName<\/h5>/i </section>\n<section>" \ $htmldir/$savepath/$pagename.html - sed -i "/<h5>$sectionName<\/h5>/i <a id=\"$sectionNameNS\"></a>" \ + sed -i "s/<h5>$sectionName<\/h5>/<h5 id=\"$sectionNameNS\">$sectionName<\/h5>/" \ $htmldir/$savepath/$pagename.html # Check if this is supposed to be a sub-section & add <ul> @@ -199,7 +199,7 @@ for page in $@; do sed -i "/<h4>$sectionName<\/h4>/i </section>\n<section>" \ $htmldir/$savepath/$pagename.html - sed -i "/<h4>$sectionName<\/h4>/i <a id=\"$sectionNameNS\"></a>" \ + sed -i "s/<h4>$sectionName<\/h4>/<h4 id=\"$sectionNameNS\">$sectionName<\/h4>/" \ $htmldir/$savepath/$pagename.html # Otherwise, this is a normal section, no <ul> added @@ -208,13 +208,10 @@ for page in $@; do sed -i "/toc-title/a <li><a href=\"#$sectionNameNS\">$sectionName</a></li>" \ $htmldir/$savepath/$pagename.html - sed -i "/<h3>$sectionName<\/h3>/i </section>\n<section>" \ + sed -i "/<h3>$sectionName<\/h3>/i </section\>\n<section>" \ $htmldir/$savepath/$pagename.html - sed -i "/<h3>$sectionName<\/h3>/i <a id=\"$sectionNameNS\"></a>" \ - $htmldir/$savepath/$pagename.html - - sed -i "s/<h3>$sectionName<\/h3>/<h3>$sectionName <a class=\"back-to-top\" title=\"Back to Top\" href=\"#\">\&\#10548\;<\/a><\/h3>/g" \ + sed -i "s/<h3>$sectionName<\/h3>/<h3 id=\"$sectionNameNS\">$sectionName<\/h3>/" \ $htmldir/$savepath/$pagename.html fi done diff --git a/style/main.css b/style/main.css @@ -141,16 +141,6 @@ button { font-size: 0.8em; } -.back-to-top, .back-to-top:hover, .back-to-top:visited { - color: var(--unvis-link); - font-size: 1.2em; - text-decoration: none; -} - -.back-to-top:hover { - text-shadow: 2px 2px var(--vis-link); -} - .spoiler { background-color: #000; color: #000; @@ -335,10 +325,4 @@ button { background-color: var(--bg-alt-light); border: 3px var(--border-light) solid; } - .back-to-top, .back-to-top:hover, .back-to-top:visited { - color: var(--unvis-link-light); - } - .back-to-top:hover { - text-shadow: 2px 2px var(--vis-link-light); - } }