# HG changeset patch # User Oleksandr Gavenko # Date 1470313875 -10800 # Node ID a0f224c26f080e9703b5edfb2976e241ad556396 # Parent 093ee7c2985fb29de9d5ca411ca77f3ee19dda6a Move template files to separate directories. diff -r 093ee7c2985f -r a0f224c26f08 Makefile --- a/Makefile Thu Aug 04 15:20:07 2016 +0300 +++ b/Makefile Thu Aug 04 15:31:15 2016 +0300 @@ -101,8 +101,8 @@ .PHONY: html html: $(HTML_FILES) -$(HTML_DIR)/%.html: %.rst rst.css rst-multi.css $(HTML_DIR)/rst.tmpl $(MAKEFILE_LIST) | $(HTML_DIR) - $(RST2HTML) $(RST_FLAGS) --stylesheet=rst.css,rst-multi.css --template=$(HTML_DIR)/rst.tmpl $*.rst $@ +$(HTML_DIR)/%.html: %.rst www/rst.css www/rst-multi.css $(HTML_DIR)/rst.tmpl $(MAKEFILE_LIST) | $(HTML_DIR) + $(RST2HTML) $(RST_FLAGS) --stylesheet=www/rst.css,www/rst-multi.css --template=$(HTML_DIR)/rst.tmpl $*.rst $@ $(HTML_DIR)/iframe.html: $(RST_FILES) $(MAKEFILE_LIST) | $(HTML_DIR) { \ @@ -121,7 +121,7 @@ echo ''; \ } >$@ -$(HTML_DIR)/rst.tmpl: rst.tmpl $(MAKEFILE_LIST) +$(HTML_DIR)/rst.tmpl: www/rst.tmpl $(MAKEFILE_LIST) sed -e "s|{date}|$$(date +%F)|" -e "s|{rev}|$$(hg id -i)|" <$< >$@ $(HTML_DIR)/index.html: $(HTML_DIR)/README.html $(MAKEFILE_LIST) | $(HTML_DIR) @@ -131,20 +131,20 @@ chm: html $(CHM_FILES) $(HTML_DIR)/iframe.html cd $(HTML_DIR); for file in *.html; do sed -i '/<\?xml.*\?>/d' $$file; done -$(HTML_DIR)/%.stp: %.stp $(MAKEFILE_LIST) | $(HTML_DIR) +$(HTML_DIR)/%.stp: misc/%.stp $(MAKEFILE_LIST) | $(HTML_DIR) cp $< $@ -$(HTML_DIR)/chm.hhp: chm-hhp.sh $(MAKEFILE_LIST) | $(HTML_DIR) - ./chm-hhp.sh >$@ +$(HTML_DIR)/chm.hhp: misc/chm-hhp.sh $(MAKEFILE_LIST) | $(HTML_DIR) + ./$< >$@ -$(HTML_DIR)/chm.hhc: chm-hhc.sh $(MAKEFILE_LIST) | $(HTML_DIR) - ./chm-hhc.sh >$@ +$(HTML_DIR)/chm.hhc: misc/chm-hhc.sh $(MAKEFILE_LIST) | $(HTML_DIR) + ./$< >$@ .PHONY: single-html single-html: $(HTML_DIR)/single.html -$(HTML_DIR)/single.html: $(HTML_DIR)/single.rest rst.css rst-single.css $(RST_FILES) - $(RST2HTML) $(RST_FLAGS) --stylesheet=rst.css,rst-single.css $(HTML_DIR)/single.rest $@ +$(HTML_DIR)/single.html: $(HTML_DIR)/single.rest www/rst.css www/rst-single.css $(RST_FILES) + $(RST2HTML) $(RST_FLAGS) --stylesheet=www/rst.css,www/rst-single.css $(HTML_DIR)/single.rest $@ $(HTML_DIR)/single.rest: $(RST_FILES) $(MAKEFILE_LIST) { \ diff -r 093ee7c2985f -r a0f224c26f08 www/rst-multi.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www/rst-multi.css Thu Aug 04 15:31:15 2016 +0300 @@ -0,0 +1,29 @@ +iframe { + overflow: hidden; +} +.document { + max-width: 800px; + margin: .5em auto; + padding-left: 190px; + padding-right: 10px; + overflow: hidden; +} +#sidebar { position: fixed; } +iframe { border: none; } +#sidebar, iframe { + top: 0; + left: 0; + width: 180px; + height: 100%; +} +@media (max-width: 780px) { + .document { + margin: 5px 10px 1em 10px; + padding: 0; + } + #sidebar { position: inherit; } + #sidebar, iframe { + width: 100%; + height: 7em; + } +} diff -r 093ee7c2985f -r a0f224c26f08 www/rst-single.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www/rst-single.css Thu Aug 04 15:31:15 2016 +0300 @@ -0,0 +1,10 @@ +.document { + max-width: 800px; + margin: .5em auto; +} +@media (max-width: 780px) { + .document { + margin: 5px 10px 1em 10px; + padding: 0; + } +} diff -r 093ee7c2985f -r a0f224c26f08 www/rst.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www/rst.css Thu Aug 04 15:31:15 2016 +0300 @@ -0,0 +1,107 @@ +html, body, iframe { + margin: 0px; + padding: 0px; +} + +.header { + font-size: 1.2em; + text-align: center; +} +.header.small { + font-size: 0.8em; +} + +div.contents ul { + max-width: 600px; + margin: 0 auto; +} +div.contents ul ul { + margin-left: 1em; +} + +a { + text-decoration:none; + color: hsl(240, 100%, 50%); +} +a:hover { opacity: .5; } +h1 a { + color: hsla(0, 0%, 0%, .8); +} +h2 a, h3 a, h4 a, .contents a { + color: hsl(0, 100%, 25%); +} +h1 { text-align: center; } +div > p:first-child:first-letter, +h2 + p:first-letter, +h3 + p:first-letter, +h4 + p:first-letter, +h5 + p:first-letter { + font-weight: bold; +} + +blockquote { + margin: 1em 0; +} +ul, ol { + margin-left: 1em; + padding-left: 1em; +} +dl { + margin-left: 1em; +} +.literal-block { + margin: 0 0 0 1em; + padding: 5px; + border: 1px; + border-style: solid; + border-color: hsl(0, 100%, 25%); + background-color: hsl(0, 10%, 95%); + overflow: auto; +} +tt.literal { + outline: 1px dotted orange; + padding: 1px; +} +table { border-collapse:collapse; margin-left:auto; margin-right:auto; } +table, tr, td { padding: 3px; border: 1px dotted maroon; background-color: cornsilk; } + +pre.code.keyword, pre.code.tag { + color: blue; +} +pre.code.string, pre.code.preproc { + color: green; +} +pre.code.name.decorator, pre.code.literal { + color: brown; +} +pre.code.comment { + color: magenta; +} +pre.code span.generic.prompt { + color: magenta; +} +pre.code span.generic.output { + color: gray; +} + +.attention, .caution, .danger, .error, .warning, .important, .hint, .note, .tip { + padding: 0px; + margin: 5px 0px; + text-indent: 2em; +} +.hint, .note, .tip { border: green 1px solid; } +.warning, .important { border: gold 1px solid; } +.attention, .caution, .danger, .error { border: red 1px solid; } +.attention p.first, .caution p.first, .danger p.first, .error p.first, .warning p.first, .important p.first, .hint p.first, .note p.first, .tip p.first { + margin: 0px; + padding: 5px 0px; +} +.hint p.first, .note p.first, .tip p.first { background: rgb(176, 255, 176); } +.warning p.first, .important p.first { background: rgb(255, 233, 176); } +.attention p.first, .caution p.first, .danger p.first, .error p.first { background: rgb(255, 196, 180); } +.attention p, .caution p, .danger p, .error p, .warning p, .important p, .hint p, .note p, .tip p { + margin: 5px; +} +.attention pre, .caution pre, .danger pre, .error pre, .warning pre, .important pre, .hint pre, .note pre, .tip pre { + margin: 0 5px 5px 4em; +} diff -r 093ee7c2985f -r a0f224c26f08 www/rst.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www/rst.tmpl Thu Aug 04 15:31:15 2016 +0300 @@ -0,0 +1,23 @@ + + + + + +%(head)s +%(stylesheet)s +%(body_prefix)s + +
+ [ About + | Licence + | Contacts ] +
+
+ Written by Oleksandr Gavenko (AKA gavenkoa), + compiled on {date} + from rev {rev}. +
+%(body_pre_docinfo)s +%(docinfo)s +%(body)s +%(body_suffix)s