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.
feat: tactics chapter (leanprover#34)
- Loading branch information
1 parent
bab544a
commit 2d0e44e
Showing
16 changed files
with
2,786 additions
and
14 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
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,35 @@ | ||
import VersoManual | ||
import Lean.Data.Json | ||
|
||
open Verso Doc Elab Output Html Code | ||
open Verso.Genre Manual | ||
open Verso.ArgParse | ||
open Lean | ||
|
||
namespace Manual | ||
|
||
|
||
def Block.CSS : Block where | ||
name := `Manual.CSS | ||
|
||
@[code_block_expander CSS] | ||
def CSS : CodeBlockExpander | ||
| args, str => do | ||
let () ← ArgParse.done.run args | ||
pure #[← `(Doc.Block.other {Block.CSS with data := ToJson.toJson (α := String) $(quote str.getString)} #[])] | ||
|
||
@[block_extension Manual.CSS] | ||
def CSS.descr : BlockDescr where | ||
traverse _ _ _ := pure none | ||
toTeX := none | ||
toHtml := | ||
open Verso.Output.Html in | ||
some <| fun _ _ _ data _ => do | ||
match FromJson.fromJson? data with | ||
| .error err => | ||
HtmlT.logError <| "Couldn't deserialize CSS while rendering HTML: " ++ err | ||
pure .empty | ||
| .ok (css : String) => | ||
pure {{ | ||
<style>{{css}}</style> | ||
}} |
Oops, something went wrong.