Skip to content

Commit

Permalink
Add heading permalinks
Browse files Browse the repository at this point in the history
  • Loading branch information
yawnoc committed Nov 19, 2023
1 parent aa083df commit d538f38
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 6 deletions.
4 changes: 2 additions & 2 deletions about/index.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
OrdinaryDictionaryReplacement: #.boilerplate-properties-override
- queue_position: BEFORE #boilerplate-properties
* %title --> About
* %date-modified --> 2023-07-09
* %date-modified --> 2023-11-19

%%%

Expand All @@ -16,7 +16,7 @@ from a group chat into an actual gathering.
--


## Established 2023-06-25
##{#established} Established 2023-06-25

--
Whereas certain people of Perth thought it good
Expand Down
4 changes: 2 additions & 2 deletions about/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h1>About the Perth Mahjong Society</h1>
Credit to Felicia for progressing things
from a group chat into an actual gathering.
</p>
<h2>Established 2023-06-25</h2>
<h2 id="established"><a href="#established" class="permalink" aria-label="Permalink"></a>Established 2023-06-25</h2>
<p>
Whereas certain people of Perth thought it good
to assemble players of all abilities in a fine venue
Expand All @@ -50,7 +50,7 @@ <h2>Established 2023-06-25</h2>
</p>
<footer>
Source: <a href="https://github.com/perthmahjongsoc/perthmahjongsoc.github.io/blob/master/about/index.cmd"><code>about/index.cmd</code></a>.
Last modified: <time datetime="2023-07-09">2023-07-09</time>.
Last modified: <time datetime="2023-11-19">2023-11-19</time>.
</footer>
</body>
</html>
12 changes: 12 additions & 0 deletions res/common.cmdr
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,15 @@ RegexDictionaryReplacement: #.common.footer
Last modified: <time datetime="%date-modified">%date-modified</time>.
</footer>
"

RegexDictionaryReplacement: #.heading-permalinks
- queue_position: BEFORE #headings
* (?P<opening_hashes_etc>
[#]{2,6}
\{
[#] (?P<id_> [\S]+ )
\}
[\s]+
)
-->
\g<opening_hashes_etc> []{.permalink aria-label=Permalink}(#\g<id_>)
8 changes: 8 additions & 0 deletions res/mahjong.css
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ th, td {
}


.permalink {
background-image: url(permalink.svg);
background-position: center left;
background-repeat: no-repeat;
background-size: 1em;
padding-left: 1.5em;
}

.wide {
overflow-x: auto;
}
Expand Down
7 changes: 7 additions & 0 deletions res/permalink.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions scores/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h1>Perth Mahjong Society Scores</h1>
Compiled from <a href="scores.txt"><code>scores.txt</code></a> using <a href="https://github.com/yawnoc/mahjong-scorer"><code>mahjongscore.py</code></a>.
Rows are sorted by Net Score Per Game.
</p>
<h2 id="latest">Latest meet (2023-11-19)</h2>
<h2 id="latest"><a href="#latest" class="permalink" aria-label="Permalink"></a>Latest meet (2023-11-19)</h2>
<div class="wide">
<table>
<thead>
Expand Down Expand Up @@ -135,7 +135,7 @@ <h2 id="latest">Latest meet (2023-11-19)</h2>
</tfoot>
</table>
</div>
<h2 id="all-time">All time</h2>
<h2 id="all-time"><a href="#all-time" class="permalink" aria-label="Permalink"></a>All time</h2>
<div class="wide">
<table>
<thead>
Expand Down

0 comments on commit d538f38

Please sign in to comment.