Merge pull request #1095 from marcelklehr/docs/improve-doc-generation
Documentation improvements
This commit is contained in:
commit
5646759dc6
13
Makefile
13
Makefile
|
@ -1,13 +1,20 @@
|
||||||
doc_dirs = doc $(wildcard doc/*/)
|
|
||||||
outdoc_dirs = out $(addprefix out/,$(doc_dirs))
|
|
||||||
doc_sources = $(wildcard doc/*/*.md) $(wildcard doc/*.md)
|
doc_sources = $(wildcard doc/*/*.md) $(wildcard doc/*.md)
|
||||||
outdoc_files = $(addprefix out/,$(doc_sources:.md=.html))
|
outdoc_files = $(addprefix out/,$(doc_sources:.md=.html))
|
||||||
|
|
||||||
docs: $(outdoc_files)
|
docassets = $(addprefix out/,$(wildcard doc/_assets/*))
|
||||||
|
|
||||||
|
VERSION = $(shell node -e "console.log( require('./src/package.json').version )")
|
||||||
|
|
||||||
|
docs: $(outdoc_files) $(docassets)
|
||||||
|
|
||||||
|
out/doc/_assets/%: doc/_assets/%
|
||||||
|
mkdir -p $(@D)
|
||||||
|
cp $< $@
|
||||||
|
|
||||||
out/doc/%.html: doc/%.md
|
out/doc/%.html: doc/%.md
|
||||||
mkdir -p $(@D)
|
mkdir -p $(@D)
|
||||||
node tools/doc/generate.js --format=html --template=doc/template.html $< > $@
|
node tools/doc/generate.js --format=html --template=doc/template.html $< > $@
|
||||||
|
cat $@ | sed 's/__VERSION__/${VERSION}/' > $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf out/
|
rm -rf out/
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
body.apidoc {
|
||||||
|
width: 60%;
|
||||||
|
min-width: 10cm;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#header {
|
||||||
|
background-color: #5a5;
|
||||||
|
padding: 10px;
|
||||||
|
color: #111;
|
||||||
|
}
|
||||||
|
|
||||||
|
a,
|
||||||
|
a:active {
|
||||||
|
color: #272;
|
||||||
|
}
|
||||||
|
a:focus,
|
||||||
|
a:hover {
|
||||||
|
color: #050;
|
||||||
|
}
|
||||||
|
|
||||||
|
#apicontent a.mark,
|
||||||
|
#apicontent a.mark:active {
|
||||||
|
float: right;
|
||||||
|
color: #BBB;
|
||||||
|
font-size: 0.7cm;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
#apicontent a.mark:focus,
|
||||||
|
#apicontent a.mark:hover {
|
||||||
|
color: #AAA;
|
||||||
|
}
|
||||||
|
|
||||||
|
#apicontent code {
|
||||||
|
padding: 1px;
|
||||||
|
background-color: #EEE;
|
||||||
|
border-radius: 4px;
|
||||||
|
border: 1px solid #DDD;
|
||||||
|
}
|
||||||
|
#apicontent pre>code {
|
||||||
|
display: block;
|
||||||
|
overflow: auto;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
|
@ -2,12 +2,12 @@
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>__SECTION__ Etherpad-Lite Manual & Documentation</title>
|
<title>__SECTION__ - Etherpad Lite v__VERSION__ Manual & Documentation</title>
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="_assets/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body class="apidoc" id="api-section-__FILENAME__">
|
<body class="apidoc" id="api-section-__FILENAME__">
|
||||||
<header id="header">
|
<header id="header">
|
||||||
<h1>Etherpad-Lite Manual & Documentation</h1>
|
<h1>Etherpad-Lite v__VERSION__ Manual & Documentation</h1>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div id="toc">
|
<div id="toc">
|
||||||
|
|
|
@ -48,7 +48,6 @@ function render(lexed, filename, template, cb) {
|
||||||
|
|
||||||
template = template.replace(/__FILENAME__/g, filename);
|
template = template.replace(/__FILENAME__/g, filename);
|
||||||
template = template.replace(/__SECTION__/g, section);
|
template = template.replace(/__SECTION__/g, section);
|
||||||
template = template.replace(/__VERSION__/g, process.version);
|
|
||||||
template = template.replace(/__TOC__/g, toc);
|
template = template.replace(/__TOC__/g, toc);
|
||||||
|
|
||||||
// content has to be the last thing we do with
|
// content has to be the last thing we do with
|
||||||
|
|
Loading…
Reference in New Issue