forked from leanprover/reference-manual
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This will allow many TODOs to be resolved
- Loading branch information
1 parent
0adf000
commit a6e0b60
Showing
6 changed files
with
125 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import Verso | ||
import Verso.Doc.ArgParse | ||
import Verso.Doc.Elab.Monad | ||
import VersoManual | ||
import Verso.Code | ||
|
||
namespace Manual | ||
|
||
open Lean Elab | ||
open Verso ArgParse Doc Elab Genre.Manual Html Code Highlighted.WebAssets | ||
open SubVerso.Highlighting Highlighted | ||
|
||
def Inline.margin : Inline where | ||
name := `Manual.margin | ||
|
||
@[role_expander margin] | ||
def margin : RoleExpander | ||
| args, inlines => do | ||
ArgParse.done.run args | ||
let content ← inlines.mapM elabInline | ||
pure #[← `(Doc.Inline.other Inline.margin #[$content,*])] | ||
|
||
@[inline_extension margin] | ||
def margin.descr : InlineDescr where | ||
traverse _ _ _ := do | ||
pure none | ||
toTeX := none | ||
extraCss := [r#" | ||
.marginalia .note { | ||
position: relative; | ||
padding: 0.5rem; | ||
} | ||
/* Wide viewport */ | ||
@media (min-width: 1400px) { | ||
.marginalia .note { | ||
float: right; | ||
clear: right; | ||
margin-right: -19vw; | ||
width: 15vw; | ||
margin-top: 1rem; | ||
} | ||
} | ||
.marginalia:hover, .marginalia:hover .note, .marginalia:has(.note:hover) { | ||
background-color: var(--lean-accent-light-blue); | ||
} | ||
/* Narrow viewport */ | ||
@media (max-width: 1400px) { | ||
.marginalia .note { | ||
float: right; | ||
clear: right; | ||
width: 40%; | ||
margin: 1rem 0; | ||
margin-left: 5%; | ||
} | ||
} | ||
body { | ||
counter-reset: margin-note-counter; | ||
} | ||
.marginalia .note { | ||
counter-increment: margin-note-counter; | ||
} | ||
.marginalia .note::before { | ||
content: counter(margin-note-counter) "."; | ||
position: absolute; | ||
vertical-align: baseline; | ||
font-size: 0.9em; | ||
font-weight: bold; | ||
left: -3rem; | ||
width: 3rem; | ||
text-align: right; | ||
} | ||
.marginalia::after { | ||
content: counter(margin-note-counter); | ||
vertical-align: super; | ||
font-size: 0.7em; | ||
font-weight: bold; | ||
margin-right: 0.5em; | ||
} | ||
"#] | ||
toHtml := | ||
open Verso.Output.Html in | ||
some <| fun goI _ _ content => do | ||
pure {{<span class="marginalia"><span class="note">{{← content.mapM goI}}</span></span>}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* CSS variables for each Lean branding color */ | ||
:root { | ||
/* Main color palette */ | ||
--lean-black: #000000; | ||
--lean-white: #ffffff; | ||
--lean-blue: #0073a3; | ||
|
||
/* Accent color palette */ | ||
/* This light blue should only be used as a background, and any text | ||
on it should be black to ensure sufficient contrast. */ | ||
--lean-accent-light-blue: #b0c5cd; | ||
/* This orange should be used only as an accent in small amounts. No | ||
small type. Bold subhead or larger for typography.*/ | ||
--lean-accent-orange: #f15732; | ||
|
||
/* Non-branding colors */ | ||
/* These colors should never be used as actual brand colors, but they | ||
are complementary to our colors and can be used for elements in | ||
presentations or charts or other peripheral materials. They are | ||
only to be used as an accent or a complementary design element, | ||
never as Lean branding. */ | ||
--lean-compl-orangered: #F15732; | ||
--lean-compl-yellow: #FDC05F; | ||
--lean-compl-green: #699E88; | ||
--lean-compl-bluegray: #A9C7C9; | ||
--lean-compl-darkgray: #354140; | ||
--lean-compl-gray: #96A0A5; | ||
--lean-compl-pink: #F05665; | ||
--lean-compl-lightpink: #F7A8B0; | ||
--lean-compl-darkblue: #005E7D; | ||
--lean-compl-turquoise: #48C6E2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters