Compare commits
2 commits
0ae5842740
...
7b5fc068ee
| Author | SHA1 | Date | |
|---|---|---|---|
| 7b5fc068ee | |||
| 4967deb080 |
4 changed files with 180 additions and 133 deletions
|
|
@ -177,6 +177,7 @@ bool next_hole(String_Buffer& buf, const char*& fstr)
|
||||||
|
|
||||||
A call to `next_hole` will find the literal part, visualised with `---`, and leave the `fstr` pointer past the hole `{}`, visualised with `^`.
|
A call to `next_hole` will find the literal part, visualised with `---`, and leave the `fstr` pointer past the hole `{}`, visualised with `^`.
|
||||||
|
|
||||||
|
{.monospaced}
|
||||||
```
|
```
|
||||||
Hello, {}!
|
Hello, {}!
|
||||||
------- ^
|
------- ^
|
||||||
|
|
@ -185,6 +186,7 @@ Hello, {}!
|
||||||
In this case, it will return `true` to signal that it stopped at a hole.\
|
In this case, it will return `true` to signal that it stopped at a hole.\
|
||||||
In case there is no hole however, and the end of the string is reached, it will return `false`.
|
In case there is no hole however, and the end of the string is reached, it will return `false`.
|
||||||
|
|
||||||
|
{.monospaced}
|
||||||
```
|
```
|
||||||
Hello, {}!
|
Hello, {}!
|
||||||
-^ end of string
|
-^ end of string
|
||||||
|
|
@ -195,6 +197,7 @@ Without the extra `if` clause, it would be printed into the output literally as
|
||||||
|
|
||||||
Therefore, when `{` is encountered directly after another `{`, we have to flush the current span, and start a new one directly after the first `{`. Underlined with `---` are the spans of characters that get written to the output.
|
Therefore, when `{` is encountered directly after another `{`, we have to flush the current span, and start a new one directly after the first `{`. Underlined with `---` are the spans of characters that get written to the output.
|
||||||
|
|
||||||
|
{.monospaced}
|
||||||
```
|
```
|
||||||
empty {{} hole
|
empty {{} hole
|
||||||
------- ------
|
------- ------
|
||||||
|
|
@ -230,7 +233,6 @@ For example, providing an implementation of:
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
void format_value(String_Buffer& buf, const char*& fstr, int value);
|
void format_value(String_Buffer& buf, const char*& fstr, int value);
|
||||||
// ^^^^^^^^^
|
|
||||||
```
|
```
|
||||||
|
|
||||||
will make it possible to write out integers in addition to strings.
|
will make it possible to write out integers in addition to strings.
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,7 @@ Compare this to grepping through an `.rs` file, which usually yields lots of unr
|
||||||
I pretty much never grep through Rust files to look at APIs, while I do it all the time in C++.
|
I pretty much never grep through Rust files to look at APIs, while I do it all the time in C++.
|
||||||
|
|
||||||
Perhaps it's a sign that the complexity of JavaScript-heavy online HTML documentation viewers with mediocre search functionality is entirely self-inflicted.\
|
Perhaps it's a sign that the complexity of JavaScript-heavy online HTML documentation viewers with mediocre search functionality is entirely self-inflicted.\
|
||||||
(I'll give them though that rich text is pretty cool, and Hackage's global type signature search is _wicked_ cool. Nothing that a sufficiently advanced LSP server shouldn't be capable of doing, though.)
|
(I'll give them though that rich text is pretty cool, and [Hoogle's](https://hoogle.haskell.org/) global type signature search is _wicked_ cool. Nothing that a sufficiently advanced LSP server shouldn't be capable of doing, though.)
|
||||||
|
|
||||||
(...and also, fuck Doxygen. I hate using Doxygen so much. But I'll leave that for another time.)
|
(...and also, fuck Doxygen. I hate using Doxygen so much. But I'll leave that for another time.)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,9 @@ main.doc {
|
||||||
}
|
}
|
||||||
|
|
||||||
& .doc-text {
|
& .doc-text {
|
||||||
padding: 1.6rem;
|
--doc-padding: 1.6rem;
|
||||||
|
|
||||||
|
padding: var(--doc-padding);
|
||||||
max-width: min(100%, var(--doc-text-width));
|
max-width: min(100%, var(--doc-text-width));
|
||||||
|
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
|
|
@ -62,6 +64,20 @@ main.doc {
|
||||||
& ul {
|
& ul {
|
||||||
list-style: "- ";
|
list-style: "- ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
& pre,
|
||||||
|
& th-literate-program {
|
||||||
|
& code {
|
||||||
|
--recursive-wght: 520;
|
||||||
|
--recursive-mono: 0.5; /* You didn't expect a proportional font being used for code, did you. */
|
||||||
|
font-size: 90%;
|
||||||
|
tab-size: 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.monospaced code {
|
||||||
|
--recursive-mono: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
& section.feed {
|
& section.feed {
|
||||||
|
|
@ -93,3 +109,27 @@ main.doc {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 700px) {
|
||||||
|
main.doc {
|
||||||
|
& .doc-text {
|
||||||
|
& > pre,
|
||||||
|
& > th-literate-program {
|
||||||
|
/* Stretch to whole page.
|
||||||
|
This way of doing it feels a bit brittle, though.
|
||||||
|
It might be good to refactor this to CSS grid at some point. */
|
||||||
|
padding-left: var(--doc-padding);
|
||||||
|
padding-right: var(--doc-padding);
|
||||||
|
margin-left: calc(var(--doc-padding) * -1);
|
||||||
|
margin-right: calc(var(--doc-padding) * -1);
|
||||||
|
border-radius: 0;
|
||||||
|
border-left: none;
|
||||||
|
border-right: none;
|
||||||
|
|
||||||
|
& code {
|
||||||
|
tab-size: 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -175,12 +175,17 @@ h4 {
|
||||||
font-size: 1.6rem;
|
font-size: 1.6rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
--recursive-mono: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
pre,
|
pre,
|
||||||
code,
|
pre code,
|
||||||
kbd,
|
kbd,
|
||||||
th-literate-program {
|
th-literate-program {
|
||||||
--recursive-mono: 1;
|
--recursive-mono: 1;
|
||||||
--recursive-wght: 450;
|
--recursive-wght: 450;
|
||||||
|
tab-size: 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
strong code {
|
strong code {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue