Revise pdf links to mirror directories.
parent
631d2f48f2
commit
dc6bd76b60
|
@ -14,8 +14,13 @@ open Lean
|
||||||
open scoped DocGen4.Jsx
|
open scoped DocGen4.Jsx
|
||||||
|
|
||||||
def moduleListFile (file : NameExt) : BaseHtmlM Html := do
|
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"}>
|
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>
|
</div>
|
||||||
|
|
||||||
/--
|
/--
|
||||||
|
|
|
@ -42,8 +42,7 @@ def cmp (n₁ n₂ : NameExt) : Ordering :=
|
||||||
| ord => ord
|
| ord => ord
|
||||||
|
|
||||||
def getString! : NameExt → String
|
def getString! : NameExt → String
|
||||||
| ⟨str _ s, .html⟩ => s
|
| ⟨str _ s, _⟩ => s
|
||||||
| ⟨str _ s, .pdf⟩ => s ++ ".pdf"
|
|
||||||
| _ => unreachable!
|
| _ => unreachable!
|
||||||
|
|
||||||
end NameExt
|
end NameExt
|
||||||
|
|
|
@ -751,7 +751,6 @@ a:link, a:visited, a:active {
|
||||||
|
|
||||||
a.pdf:link, a.pdf:visited, a.pdf:active {
|
a.pdf:link, a.pdf:visited, a.pdf:active {
|
||||||
color:var(--link-pdf-color);
|
color:var(--link-pdf-color);
|
||||||
text-decoration: none
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Show it on hover though. **/
|
/** Show it on hover though. **/
|
||||||
|
|
Loading…
Reference in New Issue