add ¶ markers on hover on titles to make it easier to grab the permalink

This commit is contained in:
pho4cexa 2022-12-25 15:40:45 -08:00
parent fbc6c6c8f4
commit 17ce8565f8
2 changed files with 10 additions and 1 deletions

View file

@ -15,6 +15,10 @@
hr { border: 0; border-bottom: 1px solid black; margin-top: 16px } hr { border: 0; border-bottom: 1px solid black; margin-top: 16px }
td { padding: 0em .5em; vertical-align: top } td { padding: 0em .5em; vertical-align: top }
footer { font-size: small; text-align: right } footer { font-size: small; text-align: right }
/* permalinks */
h1 a::after, h2 a::after, h3 a::after, h4 a::after, h5 a::after, h6 a::after { content: "¶"; opacity: 0; margin-left: .5em; }
h1:hover a::after, h2:hover a::after, h3:hover a::after, h4:hover a::after, h5:hover a::after, h6:hover a::after { opacity: 100; }
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { text-decoration: none; }
</style> </style>
</head> </head>
<body> <body>

View file

@ -94,7 +94,12 @@
(substring* 0 40))) (substring* 0 40)))
(define (enumerate-tag tag inner) (define (enumerate-tag tag inner)
`(,tag (@ (id ,(slugify tag inner))) ,inner)) (let ((slug (slugify tag inner)))
`(,tag
(@ (id ,slug))
,inner
(a (@ (title "Permalink to this section")
(href "#" ,slug))))))
(define (sxml-html-rules adjust-relative) (define (sxml-html-rules adjust-relative)
`(;; assign all headings an id so you can link to them `(;; assign all headings an id so you can link to them