Revise pdf links to mirror directories.

finite-set-exercises
Joshua Potter 2023-07-17 17:59:17 -06:00
parent 631d2f48f2
commit dc6bd76b60
3 changed files with 7 additions and 4 deletions

View File

@ -14,8 +14,13 @@ open Lean
open scoped DocGen4.Jsx
def moduleListFile (file : NameExt) : BaseHtmlM Html := do
let contents :=
if file.ext == .pdf then
<span>{s!"🗎 {file.getString!} (<a class=\"pdf\" href={← moduleNameExtToLink file}>pdf</a>)"}</span>
else
<a href={← moduleNameExtToLink file}>{file.getString!}</a>
return <div class={if (← getCurrentName) == file.name then "nav_link visible" else "nav_link"}>
<a class={if file.ext == .pdf then "pdf" else ""} href={← moduleNameExtToLink file}>{file.getString!}</a>
{contents}
</div>
/--

View File

@ -42,8 +42,7 @@ def cmp (n₁ n₂ : NameExt) : Ordering :=
| ord => ord
def getString! : NameExt → String
| ⟨str _ s, .html⟩ => s
| ⟨str _ s, .pdf⟩ => s ++ ".pdf"
| ⟨str _ s, _⟩ => s
| _ => unreachable!
end NameExt

View File

@ -751,7 +751,6 @@ a:link, a:visited, a:active {
a.pdf:link, a.pdf:visited, a.pdf:active {
color:var(--link-pdf-color);
text-decoration: none
}
/** Show it on hover though. **/