Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
73dd76f
Get docs from new docs CI
panglesd May 19, 2025
0a23bab
Docs: Update to new odoc3 json format
panglesd May 19, 2025
44258e2
Docs: use new `status.json` from odoc 3
panglesd May 19, 2025
6f08841
Docs: use header field
panglesd May 20, 2025
0f63921
Docs: fix search script location change with odoc_driver
panglesd May 20, 2025
078ef4f
Docs: fix search results' url
panglesd May 20, 2025
5195e43
Docs: compute sidebar from toc json
panglesd May 20, 2025
b2f98f3
Docs: do not reload global toc on toc click
panglesd May 20, 2025
668b34c
Docs: uniformize toc look
panglesd May 20, 2025
2bae280
Docs: small refactor of breadcrumbs
panglesd May 21, 2025
d54fe77
Docs: allow breadcrumbs without href
panglesd May 21, 2025
1bfb475
Docs breadcrumbs: Adding `page` kind
panglesd May 21, 2025
ba702ec
rename `library_path` to `path`: pages also have/are in breadcrumbs
panglesd May 21, 2025
69b5f88
Docs breadcrumbs: use the one computed by odoc without processing
panglesd May 21, 2025
bd82131
Add dependency on ppx_deriving_yojson
panglesd May 21, 2025
e477b6a
Docs: hide toc until alpine has loaded
panglesd May 21, 2025
7d685f0
Add source pages to docs
panglesd Jun 2, 2025
4f61be6
Render html in breadcrumbs
panglesd Jun 3, 2025
7a857ce
Add style for rendered source code
panglesd Jun 3, 2025
6ec1785
Handle redirection
panglesd Jun 3, 2025
e9587c5
Sidebar: open sub-toc when clicking on a page from the sidebar
panglesd Jun 3, 2025
d731d82
Doc: handle asset loading
panglesd Jun 10, 2025
678f4ee
Fix package files' links
panglesd Jun 10, 2025
69024bb
Fix package files appearing in global toc
panglesd Jun 10, 2025
293b3af
Fix theme for source rendering
panglesd Jun 11, 2025
43a299b
Revert keeping the sidebar on new page loading
panglesd Jun 11, 2025
187ec81
Finally implement avoid reloading sidebar
panglesd Jun 11, 2025
22fbf20
Docs: Improve source code target highlighting
panglesd Jun 17, 2025
9a0ebe3
Improve css of source rendering line numbers
panglesd Jun 17, 2025
b8a5407
Improve links to source style
panglesd Jun 17, 2025
983f9cb
Docs: only show right sidebar when it exists
panglesd Jun 17, 2025
1a48322
Improve error handling for status.json
panglesd Jul 1, 2025
a2fd81b
Fix enter on search result
panglesd Jul 1, 2025
9ff58c1
Fix redirection on edge cases
panglesd Jul 1, 2025
587c891
Put documentation-related code in a documentation file
panglesd Jul 1, 2025
677730a
Consider non-html files as assets
panglesd Jul 1, 2025
69dec17
Turn sidebar into Navmap earlier
panglesd Jul 1, 2025
3c2f4ac
Increment cache version and update comments around it
panglesd Jul 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
306 changes: 302 additions & 4 deletions asset/css/doc.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[x-cloak] { display: none !important; }

div.odoc {
max-width: 56rem /* 896px */;
max-width: 67rem;
position: relative;
}

Expand Down Expand Up @@ -186,12 +188,12 @@ div.odoc span.at-tag {
font-weight: bold;
}

div.odoc a {
div.odoc a:not(.source_container a):not(.source_link) {
font-weight: bold;
color: #cc4e0c;
}

.dark div.odoc a {
.dark div.odoc a:not(.source_container a):not(.source_link) {
text-decoration: underline;
color:white;
}
Expand Down Expand Up @@ -314,6 +316,24 @@ div.odoc .comment-delim {
border-color: rgb(32, 68, 165);
}

.navmap-tag.page-tag::after {
content: "P";
}
.page-tag{
color: rgb(32, 68, 165);
background-color: rgb(32, 68, 165);
border-color: rgb(32, 68, 165);
}

.navmap-tag.source-tag::after {
content: "S";
}
.source-tag{
color: rgb(97, 8, 138);
background-color: rgb(97, 8, 138);
border-color: rgb(97, 8, 138);
}

span.icon-expand > .navmap-tag,
span.no-expand > .navmap-tag {
color: white;
Expand Down Expand Up @@ -344,10 +364,12 @@ span.arrow-expand.open {
}

span.sign-expand::before {
content: " \002B";
content: "\002B";
display: flex;
justify-content: center;
align-items: center;
font-size: 1.25rem;
width: 1.25rem;
margin-top: -0.25rem;
}

Expand All @@ -359,3 +381,279 @@ span.sign-expand.open::before {
/* Lists of modules */

.modules { list-style-type: none; padding-left:0; }

/* Taken from odoc's css sheet */

.source_container {

/* light gruvbox theme colors */
--bg_h: #f9f5d7;
--bg: #f6f8fa; /*#fbf1c7;*/
--bg_s: #f2e5bc;
--bg1: #ebdbb2;
--bg2: #d5c4a1;
--bg3: #bdae93;
--bg4: #a89984;
--bg_highlighted: #fff3a0;

--fg: #282828;
--fg1: #3c3836;
--fg2: #504945;
--fg3: #665c54;
--fg4: #7c6f64;

--red: #9d0006;
--green: #79740e;
--yellow: #b57614;
--blue: #076678;
--purple: #8f3f71;
--aqua: #427b58;
--orange: #af3a03;
--gray: #928374;

--red-dim: #cc2412;
--green-dim: #98971a;
--yellow-dim: #d79921;
--blue-dim: #458598;
--purple-dim: #b16286;
--aqua-dim: #689d6a;
--orange-dim: #d65d0e;
--gray-dim: #7c6f64;

/* odoc colors */
--odoc-blue: #5c9cf5;
--odoc-bg: #FFFFFF;
--odoc-bg1: #f6f8fa;
--odoc-fg: #333333;
--odoc-fg1: #1F2D3D;

}

body.dark .source_container {
/* dark gruvbox theme colors */
--bg_h: #1d2021;
--bg: #282828;
--bg_s: #32302f;
--bg1: #3c3836;
--bg2: #504945;
--bg3: #665c54;
--bg4: #7c6f64;
--bg_highlighted: #3c3836;

--fg: #fbf1c7;
--fg1: #ebdbb2;
--fg2: #d5c4a1;
--fg3: #bdae93;
--fg4: #a89984;

--red: #fb4934;
--green: #b8bb26;
--yellow: #fabd2f;
--blue: #83a598;
--purple: #d3869b;
--aqua: #8ec07c;
--gray: #928374;
--orange: #fe8019;

--red-dim: #cc2412;
--green-dim: #98971a;
--yellow-dim: #d79921;
--blue-dim: #458588;
--purple-dim: #b16286;
--aqua-dim: #689d6a;
--gray-dim: #a89984;
--orange-dim: #d65d0e;

/* odoc colors */
--odoc-blue: #5c9cf5;
--odoc-bg: #202020;
--odoc-bg1: #252525;
--odoc-fg: #bebebe;
--odoc-fg1: #777;
}

.source_container .source_line_column a {
text-decoration: none;
color:var(--fg4);
}


.source_container {
--code-color: var(--fg);
--code-background: var(--bg);
--code-highligthed-background: var(--bg_highlighted);

--source-link-color: var(--fg4);
--source-line-column: var(--fg3);
--source-line-column-bg: var(--bg_h);

--source-code-comment: var(--gray);
--source-code-docstring: var(--green-dim);
--source-code-lident: var(--fg1);
--source-code-uident: var(--blue);
--source-code-literal: var(--yellow);
--source-code-keyword: var(--red);
--source-code-underscore: var(--fg3);
--source-code-operator: var(--purple);
--source-code-parens: var(--orange-dim);
--source-code-separator: var(--orange-dim);
}

.source_container .source_code a:not(:hover) {
text-decoration: inherit;
}

/* Source links float inside preformated text or headings. */
.odoc a.source_link {
float: right;
color: gray;
font-size: initial;
text-decoration: none;
}

.odoc a.source_link:hover {
color: unset;
}

.source_container {
display: flex;
padding: 0;
}

.source_line_column {
padding-right: 0.5em;
text-align: right;
color: var(--source-line-column);
background: var(--source-line-column-bg);
}

.source_line {
padding: 0 1em;
}

.source_code {
flex-grow: 1;
background: var(--code-background);
padding: 0 0.3em;
color: var(--code-color);
}


/* Linked highlight */
.source_code *:target {
box-decoration-break: clone;
-webkit-box-decoration-break: clone; /* for Safari/Chrome */
background-color: var(--code-highligthed-background);
padding: 3px 0 3px;
/* Extend the background without expanding the element's size. Without expansion
of background, lines background don't touch each other and make things look
weird on multilines targets */
}

/* Keywords */
.source_code :is(.AND, .ANDOP, .AS, .ASSERT,
.BAR, .BEGIN,
.CLASS, .CONSTRAINT,
.DO, .DONE, .DOWNTO,
.ELSE, .END, .EXCEPTION, .EXTERNAL,
.FOR, .FUN, .FUNCTION, .FUNCTOR,
.IF, .IN, .INCLUDE, .INHERIT, .INITIALIZER,
.LAZY, .LESSMINUS, .LET, .LETOP,
.MATCH, .METHOD, .MINUSGREATER, .MODULE, .MUTABLE,
.NEW, .NONREC,
.OBJECT, .OF, .OPEN,
.PERCENT, .PRIVATE,
.REC,
.SEMISEMI, .SIG, .STRUCT,
.THEN, .TO, .TRY, .TYPE,
.VAL, .VIRTUAL,
.WHEN, .WITH, .WHILE)
{
color: var(--source-code-keyword);;
}

/* Separators */
.source_code :is(.COMMA, .COLON, .COLONGREATER, .SEMI) {
color: var(--source-code-separator);
}

/* Parens
`begin` and `end ` are excluded because `end` is used in other, more
keyword-y contexts*/
.source_code :is(.BARRBRACKET,
.LBRACE,
.LBRACELESS,
.LBRACKET,
.LBRACKETAT,
.LBRACKETATAT,
.LBRACKETATATAT,
.LBRACKETBAR,
.LBRACKETGREATER,
.LBRACKETLESS,
.LBRACKETPERCENT,
.LBRACKETPERCENTPERCENT,
.LPAREN,
.RBRACE,
.RBRACKET,
.RPAREN)
{
color: var(--source-code-parens);
}

/* Prefix operators */
.source_code :is(.ASSERT, .BANG, .PREFIXOP,
/* Infix operators.
A choice had to be made for equal `=` which is both a keyword and an operator.
It looked better having it as an operator, because when it is a keyword,
there are already loads of keyword around.
It would look even nicer if there was a way to distinguish between these
two cases.*/
.INFIXOP0, .INFIXOP1, .INFIXOP2, .INFIXOP3, .INFIXOP4,
.BARBAR, .PLUS, .STAR, .AMPERAMPER, .AMPERAND, .COLONEQUAL, .GREATER, .LESS,
.MINUS, .MINUSDOT, .MINUSGREATER, .OR, .PLUSDOT, .PLUSEQ, .EQUAL)
{
color: var(--source-code-operator);
}

/* Upper case ident
`true` and `false` are considered uident here, because you can bind them in a
constructor defintion :
```ocaml
type my_bool =
| true of string
| false
| Other of int
```
*/
.source_code :is(.UIDENT, .COLONCOLON, .TRUE, .FALSE) {
color: var(--source-code-uident);

}

/* Lower case idents.
Quotes are here because of `type 'a t = 'a list`,
and question mark and tildes because of
```ocaml
let f ~a ?b () = Option.map a b
```
*/
.source_code :is(.LIDENT, .QUESTION, .QUOTE, .TILDE) {
color: var(--source-code-lident);
}

/* Litterals */
.source_code :is( .STRING, .CHAR, .INT, .FLOAT, .QUOTED_STRING_EXPR, .QUOTED_STRING_ITEM) {
color: var(--source-code-literal);
}

.source_code :is(.UNDERSCORE) {
color: var(--source-code-underscore);
}

.source_code :is(.DOCSTRING) {
color: var(--source-code-docstring);
}

.source_code :is(.COMMENT) {
color: var(--source-code-comment);
}
1 change: 1 addition & 0 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
ezjsonm
lambdasoup
ptime
ppx_deriving_yojson
(cmdliner
(>= 1.1.0))
xmlm
Expand Down
1 change: 1 addition & 0 deletions ocamlorg.opam
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ depends: [
"ezjsonm"
"lambdasoup"
"ptime"
"ppx_deriving_yojson"
"cmdliner" {>= "1.1.0"}
"xmlm"
"uri"
Expand Down
Loading
Loading