mirror of
https://github.com/9001/copyparty.git
synced 2026-04-12 23:32:32 -06:00
Add script + pandoc template to turn README.md into docs site
This commit is contained in:
parent
fb5384f412
commit
8b2bee1c87
18
scripts/docs/assemble-docs.sh
Normal file
18
scripts/docs/assemble-docs.sh
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
rm ./out -r
|
||||
|
||||
pandoc ../../README.md \
|
||||
--output=out/ \
|
||||
--from=gfm \
|
||||
--to=chunkedhtml \
|
||||
--standalone \
|
||||
--table-of-contents \
|
||||
--toc-depth=3 \
|
||||
--css=./docs.css \
|
||||
--chunk-template="%i.html" \
|
||||
--template ./template.html \
|
||||
--metadata title="readme" \
|
||||
--title-prefix="copyparty"
|
||||
|
||||
cp ./docs.css out/
|
||||
135
scripts/docs/docs.css
Normal file
135
scripts/docs/docs.css
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
html {
|
||||
color: #ccc;
|
||||
background: #222;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
* {
|
||||
line-height: 1.3em;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
nav.sidebar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100vh;
|
||||
width: 20rem;
|
||||
overflow-y: auto;
|
||||
overflow-x: clip;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-sizing: border-box;
|
||||
background: #2b2b2b;
|
||||
}
|
||||
div.toc {
|
||||
ul {
|
||||
list-style: none;
|
||||
ul a {
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
li {
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
a {
|
||||
white-space: normal;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
div.toc > ul {
|
||||
padding-bottom: 1rem;
|
||||
padding-top: 1rem;
|
||||
margin-top: 0;
|
||||
}
|
||||
div.toc-header {
|
||||
align-self: center;
|
||||
padding-top: 1rem;
|
||||
img {
|
||||
width: 10rem;
|
||||
}
|
||||
}
|
||||
footer {
|
||||
background: #2b2b2b;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
nav.sitenav {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 1rem;
|
||||
span.next {
|
||||
text-align: end;
|
||||
}
|
||||
}
|
||||
main {
|
||||
display: flex;
|
||||
padding: 1rem;
|
||||
justify-content: center;
|
||||
img {
|
||||
/* Allow images to overflow past the sides of the text but center them */
|
||||
margin-left: 50%;
|
||||
transform: translateX(-50%);
|
||||
max-width: calc(100vw - 20rem - 1rem)
|
||||
}
|
||||
}
|
||||
article, nav.sitenav {
|
||||
max-width: 50rem;
|
||||
width: 100%;
|
||||
}
|
||||
.content {
|
||||
margin-left: 20rem;
|
||||
}
|
||||
h1 {
|
||||
font-size: 1.7em;
|
||||
line-height: 1em;
|
||||
padding: .6em 1em .15em 1em;
|
||||
margin: 1em -1em .4em -1em;
|
||||
color: #ddd;
|
||||
background: #2b2b2b;
|
||||
border: 1px solid #393939;
|
||||
box-shadow: 0 0 .3em #111;
|
||||
border-radius: .3em;
|
||||
font-variant: small-caps;
|
||||
font-weight: normal;
|
||||
}
|
||||
a {
|
||||
color: #fc5;
|
||||
font-weight: bold;
|
||||
text-decoration: underline;
|
||||
white-space: nowrap;
|
||||
}
|
||||
li {
|
||||
margin: 1em 0;
|
||||
}
|
||||
ul {
|
||||
padding: 0 0 0 1.3em;
|
||||
}
|
||||
a:hover,
|
||||
a:active,
|
||||
a:focus {
|
||||
color: #fea;
|
||||
}
|
||||
@media (prefers-color-scheme: light) {
|
||||
html {
|
||||
color: #333;
|
||||
background: #f7f7f7;
|
||||
}
|
||||
h1 {
|
||||
color: #444;
|
||||
background: #e4e4e4;
|
||||
border-color: #ccc;
|
||||
box-shadow: none;
|
||||
}
|
||||
nav.sidebar, footer {
|
||||
background: #e4e4e4
|
||||
}
|
||||
a {
|
||||
color: #079;
|
||||
}
|
||||
a:hover,
|
||||
a:active,
|
||||
a:focus {
|
||||
color: #00c;
|
||||
}
|
||||
}
|
||||
69
scripts/docs/template.html
Normal file
69
scripts/docs/template.html
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
$for(author-meta)$
|
||||
<meta name="author" content="$author-meta$" />
|
||||
$endfor$
|
||||
$if(date-meta)$
|
||||
<meta name="dcterms.date" content="$date-meta$" />
|
||||
$endif$
|
||||
$if(keywords)$
|
||||
<meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$" />
|
||||
$endif$
|
||||
$if(description-meta)$
|
||||
<meta name="description" content="$description-meta$" />
|
||||
$endif$
|
||||
$for(css)$
|
||||
<link rel="stylesheet" href="$css$">
|
||||
$endfor$
|
||||
$for(header-includes)$
|
||||
$header-includes$
|
||||
$endfor$
|
||||
</head>
|
||||
<body>
|
||||
$for(include-before)$
|
||||
$include-before$
|
||||
$endfor$
|
||||
<nav class="sidebar" id="$idprefix$sidebar" role="doc-toc" >
|
||||
<div class="toc-header">
|
||||
<img src="https://github.com/9001/copyparty/raw/hovudstraum/docs/logo.svg" alt="copyparty logo">
|
||||
</div>
|
||||
<div class="toc">
|
||||
$table-of-contents$
|
||||
</div>
|
||||
</nav>
|
||||
<div class="content">
|
||||
<main>
|
||||
<article>
|
||||
$if(top)$ $-- only true on the root page
|
||||
$else$
|
||||
$if(title)$
|
||||
<h1>$title$</h1>
|
||||
$endif$
|
||||
$endif$
|
||||
$body$
|
||||
</article>
|
||||
</main>
|
||||
<footer>
|
||||
<nav class="sitenav">
|
||||
$if(previous.url)$
|
||||
<span class="left">
|
||||
<a href="$previous.url$" class="href" rel="prev"><code><-</code> $previous.title$</a>
|
||||
</span>
|
||||
$endif$
|
||||
$if(next.url)$
|
||||
<span class="next">
|
||||
<a href="$next.url$" class="href" rel="next">$next.title$ <code>-></code></a>
|
||||
</span>
|
||||
$endif$
|
||||
</nav>
|
||||
</footer>
|
||||
</div>
|
||||
$for(include-after)$
|
||||
$include-after$
|
||||
$endfor$
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in a new issue