Skip to content

Commit

Permalink
Added link tags
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmus-kirk committed Feb 26, 2024
1 parent f2e1292 commit da2e4fb
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 3 deletions.
14 changes: 14 additions & 0 deletions docs/pandoc/anchor-links.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-- Adds anchor links to headings with IDs.
function Header (h)
if h.identifier ~= '' then
-- an empty link to this header
local anchor_link = pandoc.Link(
{}, -- content
'#' .. h.identifier, -- href
'', -- title
{class = 'anchor', ['aria-hidden'] = 'true'} -- attributes
)
h.content:insert(1, anchor_link)
return h
end
end
5 changes: 5 additions & 0 deletions docs/pandoc/link.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions docs/pandoc/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -411,3 +411,27 @@ table td {
page-break-after: avoid;
}
}

/* show the anchor links in headings if one hovers over the heading. */
.anchor::before {
content: url("/docs/pandoc/link.svg");
display: inline-block;
font-size: 1em;
left: -1.5em;
line-height: 1.5;
opacity: 0.15;
position: relative;
width: 0em;
}
.anchor:hover {
text-decoration: none;
}
h1:hover > .anchor::before,
h2:hover > .anchor::before,
h3:hover > .anchor::before,
h4:hover > .anchor::before,
h5:hover > .anchor::before,
h6:hover > .anchor::before {
opacity: 1;
}
/* end: heading anchor links */
5 changes: 3 additions & 2 deletions mkDocs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ in pkgs.stdenv.mkDerivation {
--metadata title="Nixarr - Option Documentation" \
--template docs/pandoc/template.html \
--metadata date="$(date -u '+%Y-%m-%d - %H:%M:%S %Z')" \
--css style.css \
--css docs/pandoc/style.css \
--lua-filter docs/pandoc/anchor-links.lua \
-V lang=en \
-V --mathjax \
-f markdown+smart \
Expand All @@ -77,7 +78,7 @@ in pkgs.stdenv.mkDerivation {
--template docs/pandoc/template.html \
--metadata date="$(date -u '+%Y-%m-%d - %H:%M:%S %Z')" \
--metadata title="Nixarr" \
--css style.css \
--css docs/pandoc/style.css \
-V lang=en \
-V --mathjax \
-f markdown+smart \
Expand Down
2 changes: 1 addition & 1 deletion nixarr/transmission/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ in {
watch-dir-enabled = true;
watch-dir = "${nixarr.mediaDir}/torrents/.watch";

rpc-bind-address = "192.168.15.1";
rpc-bind-address = "127.0.0.1";
rpc-port = cfg.uiPort;
rpc-whitelist-enabled = false;
rpc-whitelist = "192.168.15.1,127.0.0.1";
Expand Down

0 comments on commit da2e4fb

Please sign in to comment.