From 3d1fd05085924388f6577a24c9b62ad0b4949661 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sat, 27 Oct 2012 17:28:15 +0200 Subject: [PATCH 1/2] Insert epl version into template. --- Makefile | 2 ++ doc/template.html | 4 ++-- tools/doc/html.js | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 01f30701..b6419217 100644 --- a/Makefile +++ b/Makefile @@ -2,12 +2,14 @@ doc_dirs = doc $(wildcard doc/*/) outdoc_dirs = out $(addprefix out/,$(doc_dirs)) doc_sources = $(wildcard doc/*/*.md) $(wildcard doc/*.md) outdoc_files = $(addprefix out/,$(doc_sources:.md=.html)) +VERSION = $(shell node -e "console.log( require('./src/package.json').version )") docs: $(outdoc_files) out/doc/%.html: doc/%.md mkdir -p $(@D) node tools/doc/generate.js --format=html --template=doc/template.html $< > $@ + cat $@ | sed 's/__VERSION__/${VERSION}/' > $@ clean: rm -rf out/ diff --git a/doc/template.html b/doc/template.html index 2eb93987..edc0af66 100644 --- a/doc/template.html +++ b/doc/template.html @@ -2,12 +2,12 @@ - __SECTION__ Etherpad-Lite Manual & Documentation + __SECTION__ - Etherpad Lite v__VERSION__ Manual & Documentation
diff --git a/tools/doc/html.js b/tools/doc/html.js index c52fff70..700ab18c 100644 --- a/tools/doc/html.js +++ b/tools/doc/html.js @@ -48,7 +48,6 @@ function render(lexed, filename, template, cb) { template = template.replace(/__FILENAME__/g, filename); template = template.replace(/__SECTION__/g, section); - template = template.replace(/__VERSION__/g, process.version); template = template.replace(/__TOC__/g, toc); // content has to be the last thing we do with From 7a8401c36382913b4af0f0a0bf791bd4571eaaa3 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sat, 27 Oct 2012 18:47:09 +0200 Subject: [PATCH 2/2] Add recipe for doc assets and some basic styling for the generated docs. --- Makefile | 11 ++++++++--- doc/_assets/style.css | 44 +++++++++++++++++++++++++++++++++++++++++++ doc/template.html | 2 +- 3 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 doc/_assets/style.css diff --git a/Makefile b/Makefile index b6419217..ab720f28 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,15 @@ -doc_dirs = doc $(wildcard doc/*/) -outdoc_dirs = out $(addprefix out/,$(doc_dirs)) doc_sources = $(wildcard doc/*/*.md) $(wildcard doc/*.md) outdoc_files = $(addprefix out/,$(doc_sources:.md=.html)) + +docassets = $(addprefix out/,$(wildcard doc/_assets/*)) + VERSION = $(shell node -e "console.log( require('./src/package.json').version )") -docs: $(outdoc_files) +docs: $(outdoc_files) $(docassets) + +out/doc/_assets/%: doc/_assets/% + mkdir -p $(@D) + cp $< $@ out/doc/%.html: doc/%.md mkdir -p $(@D) diff --git a/doc/_assets/style.css b/doc/_assets/style.css new file mode 100644 index 00000000..fe1343af --- /dev/null +++ b/doc/_assets/style.css @@ -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; +} \ No newline at end of file diff --git a/doc/template.html b/doc/template.html index edc0af66..6416da94 100644 --- a/doc/template.html +++ b/doc/template.html @@ -3,7 +3,7 @@ __SECTION__ - Etherpad Lite v__VERSION__ Manual & Documentation - +