website
website copied to clipboard
Fix some examples and add v0.3 docs as epub
This commit adds v0.3 documentation as epub file (https://github.com/riker-rs/riker/issues/28).
Hi @snnsnn thanks for fixing those examples. For creating an epub also. Before I merge, how do you generate the epub? I guess we should generate this each time the site is updated and published.
how do you generate the epub?
I generated it using a chrome addon:
https://chrome.google.com/webstore/detail/webtoepub/akiljllkbielkidmammnifcnibaigelm?hl=en
With these parser settings:
Settings | |
---|---|
Hostname: | riker.rs |
URL of first chapter: | https://riker.rs/riker03/ |
(required) CSS selector for element holding content to put into EPUB: | article |
CSS selector for element holding Title of Chapter: | article h1 |
CSS selector for element(s) to remove: | a[title="Edit this page"] |
Comma separated selector values can also be used.
Once you apply the parser setting, you will move to epub settings:
You need to filter out unrelated urls from the chapter urls. You can use this list as chapter urls:
<a href="https://riker.rs/messaging/">Message Types</a>
<a href="https://riker.rs/hierarchy/">Actor Hierarchy</a>
<a href="https://riker.rs/supervision/">Fault Tolerance</a>
<a href="https://riker.rs/selection/">Actor Selection</a>
<a href="https://riker.rs/channels/">Channels</a>
<a href="https://riker.rs/scheduling/">Message Scheduling</a>
<a href="https://riker.rs/config/">Configuration</a>
<a href="https://riker.rs/logging/">Logging</a>
<a href="https://riker.rs/futures/">Running Futures</a>
<a href="https://riker.rs/testing/">Testing</a>
<a href="https://riker.rs/patterns/">Patterns</a>
<a href="https://riker.rs/faq/">FAQ</a>
<a href="https://riker.rs/riker03/">Riker 0.3</a>
One last quirk. Default css does not have styles for pre or code elements. Monospace fonts usually have larger sizes than regular fonts, at least on Kindle, so its best to have 0.85%
or 0.85rem
as font size for pre
and code
elements. Default heading styles have large spaces before and after. To save some time you can use this code as default stylesheet content:
div.svg_outer {
display: block;
margin-bottom: 0;
margin-left: 0;
margin-right: 0;
margin-top: 0;
padding-bottom: 0;
padding-left: 0;
padding-right: 0;
padding-top: 0;
text-align: left;
}
div.svg_inner {
display: block;
text-align: center;
}
h1, h2 {
text-align: center;
margin-bottom: 1em;
margin-top: 10%;
}
h3, h4, h5, h6 {
text-align: center;
margin-bottom: 1em;
margin-top: 10%;
}
ol, ul {
padding-left: 8%;
}
body {
margin: 2%;
}
p {
overflow-wrap: break-word;
}
dd, dt, dl {
padding: 0;
margin: 0;
}
img {
display: block;
min-height: 1em;
max-height: 100%;
max-width: 100%;
padding-bottom: 0;
padding-left: 0;
padding-right: 0;
padding-top: 0;
margin-left: auto;
margin-right: auto;
margin-bottom: 2%;
margin-top: 2%;
}
img.inline {
display: inline;
min-height: 1em;
margin-bottom: 0;
margin-top: 0;
}
.thumbcaption {
display: block;
font-size: 0.9em;
padding-right: 5%;
padding-left: 5%;
}
hr {
color: black;
background-color: black;
height: 2px;
}
a:link {
text-decoration: none;
color: #0B0080;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: underline;
}table {
width: 90%;
border-collapse: collapse;
}
table, th, td {
border: 1px solid black;
}
code {
font-size: 0.85rem;
}
pre {
font-size: 0.85rem;;
background-color: #efefef;
padding: 0.75rem;
}
It is not much of a stream-lined process but until you figure out someway to automate it, we can use this method to generate epub files for major changes. At most it takes few minutes.
By the way, there is a promising mdbook to epub project (https://github.com/Michael-F-Bryan/mdbook-epub). Also markdown markdown to epub project (https://crates.io/crates/crowbook)