-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Experimenting HTML build with mdbook #10
Comments
It looks pretty! How can you deal with code listing such |
A new chapter is added to demonstrate this: https://idoleat.github.io/concurrency-primer/seq_cst_on_weakly_rodered_hw.html Wrap content inside a <div class="hori_container">
```c
int getFoo()
{
return foo;
}
```
\\[
\text{ } \xrightarrow{\textit{becomes}} \text{ }
\\]
```armasm
getFoo:
ldr r3, <&foo>
dmb
ldr r0, [r3, #0]
dmb
bx lr
```
</div> Notice that the blank line after .hori_container {
display: flex;
overflow-x: auto;
white-space: nowrap;
}
.hori_container > * {
min-width: 200px;
margin: 10px;
} Flexbox is adaptive on different screen aspect ratio so it works well on mobile phone as well. If writing tags is considered too tedious, we could use custom syntax like
by writing an mdbook prepocessor to expand that syntax to a div tag. |
@idoleat seems that the URL(https://idoleat.github.io/concurrency-primer/seq_cst_on_weakly_rodered_hw.html) is invalid. |
@tigercosmos The site is now online. I reverted GitHub workflow back to the state without pdf ouput. Pdf release workflow has been separated. It can be downloaded at the release page |
A custom syntax has been added for horizontal container using a preprocessor. Now you can write :::horizontal
content block A
content block B
content block C
:::
|
A syntax is added to run code on Compiler Explorer. :::CE
{{#include ./examples/order_exmaple.c}}
// or write code here directly
::: The above code block will be converted to a link like this: ▶ Open in Compiler Explorer A new page[1] is added to demonstrate this. Since the link is generated by encoding the code and config as a base64 string and concatenating after API end point, it is limited by the max length of URL. The linked generated from example introduced in #7 exceeds the limit. So eventually the new syntax might not be so useful. If a link to Compiler Explorer is desired, one can just paste code in Compiler Explorer and get a short link back, which is aimed to be valid forever[2], in a few clicks.
|
The book is currently available for experimentation on https://idoleat.github.io/concurrency-primer/, with content up to section 6. The rest will be added once styling are converted. mdbook is similar to gitbook. Some changes on styling are:
\textit
,\introcude
and\emph
as italic text since there's no visual difference in current pdf publication``some words''
\\( \\)
(inline) and\\[ \\]
(block)\clang{}
and\Cplusplus
are expanded to normal C and C++\textsc
are expanded as<small>
tag and capital letters, as thesc
suggested{{#include images/xxx.svg}}
instead of![image](images/xxx.svg)
to make characters in SVGs select-able. SVGs now are poorly converted/made and should be remade later.Some advantages of mdbook are:
cargo install mdbook
(or just download the binary) is all you need to setup build environmentmdbook serve
Some conserncs are:
mdbook-pdf
andmdbook-pandoc
. The first one is hard to deploy in CI. Haven't tried the later yet. The print button on in the upper-right corner can print a pretty raw pdf though.Source code link and "new issue" button are enabled at the upper-right corner.
Another HTML build option is typst but the feature is still on the 2024 roadmap. In typst you can edit like markdown, styling and arranging like CSS (but richer) and scripting like python.
The text was updated successfully, but these errors were encountered: