Skip to content

Commit c2a125a

Browse files
authored
web: Search/theming revamp (#300)
Just experimenting with some improvements to the search box
1 parent 47c2a96 commit c2a125a

40 files changed

+1525
-548
lines changed

src/index.lagda.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
module index where
33
```
44

5-
# 1lab {style="margin-top: 0;"}
5+
# 1lab
66

77
A formalised, cross-linked reference resource for cubical methods in
88
Homotopy Type Theory. Unlike the [@HoTT], the 1lab is not a "linear"

support/diagram.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
__PREAMBLE__
2929

3030
\ifdefined\labdark
31-
\definecolor{diagrambg}{HTML}{282C34}
31+
\definecolor{diagrambg}{HTML}{23272E}
3232
\definecolor{diagramfg}{HTML}{ABB2BF}
3333

3434
\definecolor{diagramshaded}{HTML}{2b6253}

support/nix/nixpkgs.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
args: import (builtins.fetchTarball {
22
name = "1lab-nixpkgs";
3-
url = "https://github.com/nixos/nixpkgs/archive/bf39054f8666a98196671269351e42db7e0db6bc.tar.gz";
4-
sha256 = "sha256:0f9k3c6qjsn2aw5jhyz8pqs5saajgi4wkrbj0yrsp1k0vpx4yqx6";
3+
url = "https://github.com/nixos/nixpkgs/archive/6cfbf89825dae72c64188bb218fd4ceca1b6a9e3.tar.gz";
4+
sha256 = "sha256:17m78fn3y2x44zgdm428k3l6xamyw6vnz2vd68nj5kxlkbfqnynr";
55
}) ({
66
overlays = [ (import ./haskell-packages.nix) ];
77
} // args)

support/shake/app/Main.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ rules = do
162162
, "_build/html/static/search.json"
163163
, "_build/html/css/default.css"
164164
, "_build/html/main.js"
165+
, "_build/html/start.js"
165166
, "_build/html/code-only.js"
166167
]
167168

support/shake/app/Shake/Markdown.hs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,8 @@ foldEquations _ (to@(TagOpen "a" attrs):tt@(TagText t):tc@(TagClose "a"):rest)
390390
go href (c:cs) = c:go href cs
391391
go _ [] = []
392392
foldEquations False (TagClose "html":cs) =
393-
[TagOpen "style" [], TagText ".equations { display: none !important; }", TagClose "style", TagClose "html"]
394-
++ foldEquations True cs
393+
[TagOpen "style" [], TagText ".equations { display: none !important; }", TagClose "style", TagClose "html"]
394+
++ foldEquations True cs
395395
foldEquations has_eqn (c:cs) = c:foldEquations has_eqn cs
396396
foldEquations _ [] = []
397397

@@ -405,7 +405,6 @@ getHeaders module' markdown@(Pandoc (Meta meta) _) =
405405
{ idIdent = module'
406406
, idAnchor = module' <> ".html"
407407
, idType = Nothing
408-
, idDesc = stringify <$> (Map.lookup "description" meta <|> Map.lookup "pagetitle" meta)
409408
, idDefines = Nothing
410409
}
411410

@@ -430,7 +429,6 @@ getHeaders module' markdown@(Pandoc (Meta meta) _) =
430429
{ idIdent = Text.intercalate " > " . reverse $ map snd path'
431430
, idAnchor = module' <> ".html#" <> hId
432431
, idType = Nothing
433-
, idDesc = getDesc xs
434432
, idDefines = Text.words <$> lookup "defines" keys
435433
} <$> go xs
436434
go (Div (hId, _, keys) blocks:xs) | hId /= "" = do
@@ -440,7 +438,6 @@ getHeaders module' markdown@(Pandoc (Meta meta) _) =
440438
{ idIdent = Text.intercalate " > " . reverse $ hId:map snd path
441439
, idAnchor = module' <> ".html#" <> hId
442440
, idType = Nothing
443-
, idDesc = getDesc blocks
444441
, idDefines = (:) hId . Text.words <$> lookup "alias" keys
445442
} <$> go xs
446443
go (_:xs) = go xs
@@ -452,14 +449,6 @@ getHeaders module' markdown@(Pandoc (Meta meta) _) =
452449
write = writePlain def{ writerExtensions = enableExtension Ext_raw_html (writerExtensions def) }
453450
renderPlain inlines = either (error . show) id . runPure . write $ Pandoc mempty [Plain inlines]
454451

455-
-- | Attempt to find the "description" of a heading. Effectively, if a header
456-
-- is followed by a paragraph, use its contents.
457-
getDesc (Para x:_) = Just (renderPlain x)
458-
getDesc (Plain x:_) = Just (renderPlain x)
459-
getDesc (Div (_, cls, _) _:xs) | "warning" `elem` cls = getDesc xs
460-
getDesc (BlockQuote blocks:_) = getDesc blocks
461-
getDesc _ = Nothing
462-
463452
htmlInl :: Text -> Inline
464453
htmlInl = RawInline "html"
465454

support/shake/app/Shake/SearchData.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ data SearchTerm = SearchTerm
1313
{ idIdent :: Text
1414
, idAnchor :: Text
1515
, idType :: Maybe Text
16-
, idDesc :: Maybe Text
1716
, idDefines :: Maybe [Text]
1817
}
1918
deriving (Eq, Show, Ord, Generic, ToJSON, FromJSON)

support/static/icons/all-pages.svg

Lines changed: 8 additions & 0 deletions
Loading

support/static/icons/github.svg

Lines changed: 3 additions & 0 deletions
Loading

support/static/icons/home.svg

Lines changed: 4 additions & 0 deletions
Loading

support/static/icons/justified.svg

Lines changed: 14 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)