From 4e1129f36187897e2154edbe4c68f5e0e0c21a5e Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 3 Jan 2017 19:05:27 -0500 Subject: Add "class" metadata attribute; use it instead of separate CSS files. --- Makefile | 2 +- README.org | 1 + bin/page.html.erb | 2 +- bin/util.rb | 1 + src/dnd/DND.scss | 54 ---------------------------------------------- src/dnd/PsionicSchools.org | 2 +- src/dnd/Psionist.md | 2 +- src/dnd/SpellGauntlet.org | 2 +- src/dnd/Tastavi.md | 2 +- src/main.scss | 54 ++++++++++++++++++++++++++++++++++++++++++++++ 10 files changed, 62 insertions(+), 60 deletions(-) delete mode 100644 src/dnd/DND.scss diff --git a/Makefile b/Makefile index c65f809..87fd94f 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ html.out += $(foreach d,$(sort $(dir $(patsubst src/%,out/%,$(html.src)))),$dind mydir = $(patsubst %/,%,$(patsubst out/%,%,$(dir $@))) -all: $(html.out) out/main.css out/dnd/DND.css +all: $(html.out) out/main.css .PHONY: all bin/page = bin/page bin/util.rb bin/pandoc.rb diff --git a/README.org b/README.org index d373438..1c6e10d 100644 --- a/README.org +++ b/README.org @@ -59,6 +59,7 @@ generator: | pandoc_flags | "" | no | string ("--foo --bar") | | pandoc_format | either "markdown" or "org" | no | string ("markdown+extnsn1+extnsns2") | | html_head_extra | "" | Org-mode | string | +| class | "" | no | string (CSS class to apply to ~~) | | tags | "" | LaTeX, kinda[fn:1] | string ("ES HB") or list (["ES", "HB"]) | | published[fn:2] | most recent git commit for file | no | string (Ruby ~Date.parse()~) or date[fn:3] | | updated[fn:2] | first git commit for file | no | string (Ruby ~Date.parse()~) or date[fn:3] | diff --git a/bin/page.html.erb b/bin/page.html.erb index 64afdf0..354b123 100644 --- a/bin/page.html.erb +++ b/bin/page.html.erb @@ -7,7 +7,7 @@ <%= @page.head %> - + class="<%= @page.class %>"<% end %>>

AndrewDM

diff --git a/bin/util.rb b/bin/util.rb index 3376699..1318f28 100644 --- a/bin/util.rb +++ b/bin/util.rb @@ -118,6 +118,7 @@ class Page def slug ; @slug ||= infile.sub(/\..*$/,'').sub(/^.*\//,'') ; end def content ; @content ||= pandoc.to('html5 '+(pandoc['pandoc_flags']||'')) ; end def head ; @head ||= pandoc['html_head_extra'] ; end + def class ; @class ||= pandoc['class'] ; end def tags if @tags.nil? diff --git a/src/dnd/DND.scss b/src/dnd/DND.scss deleted file mode 100644 index fcb258c..0000000 --- a/src/dnd/DND.scss +++ /dev/null @@ -1,54 +0,0 @@ -/* This bit is taken from the defaults of org-mode export */ - -body > article { font-family: Times, serif; font-size: 12pt; -.title { text-align: center; } -.todo { color: red; } -.done { color: green; } -.tag { background-color: #add8e6; font-weight:normal } -.target { } -.timestamp { color: #bebebe; } -.timestamp-kwd { color: #5f9ea0; } -.right {margin-left:auto; margin-right:0px; text-align:right;} -.left {margin-left:0px; margin-right:auto; text-align:left;} -.center {margin-left:auto; margin-right:auto; text-align:center;} -p.verse { margin-left: 3% } -pre { - border: 1pt solid #AEBDCC; - background-color: #F3F5F7; - padding: 5pt; - font-family: courier, monospace; - font-size: 90%; - overflow:auto; -} -table { border-collapse: collapse; } -td, th { vertical-align: top; } -th.right { text-align:center; } -th.left { text-align:center; } -th.center { text-align:center; } -td.right { text-align:right; } -td.left { text-align:left; } -td.center { text-align:center; } -dt { font-weight: bold; } -div.figure { padding: 0.5em; } -div.figure p { text-align: center; } -div.inlinetask { - padding:10px; - border:2px solid gray; - margin:10px; - background: #ffffcc; -} -textarea { overflow-x: auto; } -.linenr { font-size:smaller } -.code-highlighted {background-color:#ffff00;} -.org-info-js_info-navigation { border-style:none; } -#org-info-js_console-label { font-size:10px; font-weight:bold; - white-space:nowrap; } -.org-info-js_search-highlight {background-color:#ffff00; color:#000000; - font-weight:bold; } -} -/* Andrew wrote the following */ - -body { - background: url(Background.png) repeat-y; - background-size: 100%; -} diff --git a/src/dnd/PsionicSchools.org b/src/dnd/PsionicSchools.org index 91f84a1..bd3ab60 100644 --- a/src/dnd/PsionicSchools.org +++ b/src/dnd/PsionicSchools.org @@ -1,5 +1,5 @@ #+TITLE: Schools of Psionics -#+HTML_HEAD_EXTRA: +#+CLASS: dnd #+TAGS: ES HB From what I've seen, the most recent few 5e Unearthed Arcana dealing diff --git a/src/dnd/Psionist.md b/src/dnd/Psionist.md index 1c7b9e5..58ac623 100644 --- a/src/dnd/Psionist.md +++ b/src/dnd/Psionist.md @@ -1,7 +1,7 @@ --- title: "Psionist" updated: "2016-07-16T21:01-0400" -html_head_extra: "" +class: "dnd" tags: ES HB --- diff --git a/src/dnd/SpellGauntlet.org b/src/dnd/SpellGauntlet.org index cb97497..8cf1c0d 100644 --- a/src/dnd/SpellGauntlet.org +++ b/src/dnd/SpellGauntlet.org @@ -1,5 +1,5 @@ #+TITLE: Spell Gauntlet: Practical Spellcasting -#+HTML_HEAD_EXTRA: +#+CLASS: dnd #+TAGS: FF SS WP * Teleport diff --git a/src/dnd/Tastavi.md b/src/dnd/Tastavi.md index 0f7eb12..d9b7e86 100644 --- a/src/dnd/Tastavi.md +++ b/src/dnd/Tastavi.md @@ -1,7 +1,7 @@ --- title: "Tastavi D'Maelnor of Llolethane" updated: "2016-08-30 Tue 23:56" -html_head_extra: "" +class: "dnd" tags: SS --- diff --git a/src/main.scss b/src/main.scss index 4917724..c40cb52 100644 --- a/src/main.scss +++ b/src/main.scss @@ -139,3 +139,57 @@ footer { margin: 0 2em; font-size: smaller; } + +body.dnd { + background: url(dnd/Background.png) repeat-y; + background-size: 100%; + + /* This bit is taken from the defaults of org-mode export */ + article { + font-family: Times, serif; font-size: 12pt; + .title { text-align: center; } + .todo { color: red; } + .done { color: green; } + .tag { background-color: #add8e6; font-weight:normal } + .target { } + .timestamp { color: #bebebe; } + .timestamp-kwd { color: #5f9ea0; } + .right {margin-left:auto; margin-right:0px; text-align:right;} + .left {margin-left:0px; margin-right:auto; text-align:left;} + .center {margin-left:auto; margin-right:auto; text-align:center;} + p.verse { margin-left: 3% } + pre { + border: 1pt solid #AEBDCC; + background-color: #F3F5F7; + padding: 5pt; + font-family: courier, monospace; + font-size: 90%; + overflow:auto; + } + table { border-collapse: collapse; } + td, th { vertical-align: top; } + th.right { text-align:center; } + th.left { text-align:center; } + th.center { text-align:center; } + td.right { text-align:right; } + td.left { text-align:left; } + td.center { text-align:center; } + dt { font-weight: bold; } + div.figure { padding: 0.5em; } + div.figure p { text-align: center; } + div.inlinetask { + padding:10px; + border:2px solid gray; + margin:10px; + background: #ffffcc; + } + textarea { overflow-x: auto; } + .linenr { font-size:smaller } + .code-highlighted {background-color:#ffff00;} + .org-info-js_info-navigation { border-style:none; } + #org-info-js_console-label { font-size:10px; font-weight:bold; + white-space:nowrap; } + .org-info-js_search-highlight {background-color:#ffff00; color:#000000; + font-weight:bold; } + } +} -- cgit v1.1-4-g5e80