From 2b78fd32196a5193dd1932c06d89aeb004f84afd Mon Sep 17 00:00:00 2001 From: Thomas Letan Date: Wed, 19 Feb 2020 10:58:12 +0100 Subject: Initiate a literate programming approach for the Makefile rules --- .gitignore | 19 +++++----- Makefile | 35 ++++++++----------- site/posts/SoupaultConfiguration.org | 68 ------------------------------------ site/posts/meta/Contents.org | 48 +++++++++++++++++++++++++ site/posts/meta/Soupault.org | 68 ++++++++++++++++++++++++++++++++++++ 5 files changed, 142 insertions(+), 96 deletions(-) delete mode 100644 site/posts/SoupaultConfiguration.org create mode 100644 site/posts/meta/Contents.org create mode 100644 site/posts/meta/Soupault.org diff --git a/.gitignore b/.gitignore index d03deed..6472c52 100644 --- a/.gitignore +++ b/.gitignore @@ -11,17 +11,20 @@ node_modules/ package-lock.json # begin generated files -site/posts.html +site/style/main.css site/news/ColorlessThemes-0.2.html -site/posts/Thanks.html -site/posts/SoupaultConfiguration.html -site/posts/DiscoveringCommonLisp.html site/posts/ExtensibleTypeSafeErrorHandling.html +site/posts/DiscoveringCommonLisp.html site/posts/MonadTransformers.html -site/posts/StronglySpecifiedFunctionsProgram.html -site/posts/MiniHTTPServer.html -site/posts/StronglySpecifiedFunctions.html +site/posts/meta/Soupault.html +site/posts/meta/Contents.html +site/posts/Thanks.html +site/posts.html site/posts/RewritingInCoq.html +site/posts/StronglySpecifiedFunctions.html site/posts/Ltac101.html -site/style/main.css +site/posts/StronglySpecifiedFunctionsProgram.html +site/posts/MiniHTTPServer.html +org.mk +coq.mk # begin generated files diff --git a/Makefile b/Makefile index c24a187..b8dbffc 100644 --- a/Makefile +++ b/Makefile @@ -1,37 +1,32 @@ SASS := $(shell find site/ -name "*.sass") -ORG_POSTS := $(shell find site/ -name "*.org") -COQ_POSTS := $(shell find site/ -name "*.v") -INPUTS := $(ORG_POSTS:.org=.html) $(COQ_POSTS:.v=.html) $(SASS:.sass=.css) +INPUTS := $(SASS:.sass=.css) +MAKEFILES := org.mk coq.mk -COQCARGS := -async-proofs-cache force -w -custom-entry-overriden +include ${MAKEFILES} build: ${INPUTS} soupault.conf @echo "run soupault" @soupault - @scripts/update-gitignore.sh ${INPUTS} + @echo "update gitignore" + @scripts/update-gitignore.sh ${INPUTS} ${MAKEFILES} clean: - rm -f ${INPUTS} - rm -rf build + @echo "remove generated makefiles" + @rm -f ${MAKEFILES} + @echo "remove generated files in site/" + @rm -f ${INPUTS} + @echo "remove build/ directory" + @rm -rf build force: clean build -soupault.conf: site/posts/SoupaultConfiguration.org +soupault.conf: site/posts/meta/Soupault.org @echo "generate soupault.conf" @emacs $< --batch --eval "(org-babel-tangle)" --kill 2>/dev/null -%.html: %.v - @echo "export $*.v" - @coqc ${COQCARGS} $*.v - @coqdoc --no-index --charset utf8 --short --body-only -d site/posts/ \ - --coqlib "https://coq.inria.fr/distrib/current/stdlib/" \ - $*.v - @sed -i -e 's/href="$(shell basename $*.html)\#/href="\#/g' $*.html - @rm -f site/posts/coqdoc.css - -%.html: %.org - @echo "export $*.org" - @emacs $< --batch --eval "(setq org-html-htmlize-output-type nil)" --eval "(org-html-export-to-html nil nil nil t)" --kill +org.mk coq.mk &: site/posts/meta/Contents.org + @echo "generate org.mk, coq.mk" + @emacs $< --batch --eval "(org-babel-tangle)" --kill 2>/dev/null %.css: %.sass @echo "compile $*.sass" diff --git a/site/posts/SoupaultConfiguration.org b/site/posts/SoupaultConfiguration.org deleted file mode 100644 index a2ed313..0000000 --- a/site/posts/SoupaultConfiguration.org +++ /dev/null @@ -1,68 +0,0 @@ -#+BEGIN_EXPORT html -

soap.coffee/~lthms Soupault Configuration

- -
site/posts/SoupaultConfiguration.org
-#+END_EXPORT - -#+BEGIN_SRC toml :tangle ../../soupault.conf -[settings] - strict = true - verbose = false - debug = false - site_dir = "site" - build_dir = "build" - - page_file_extensions = ["html"] - ignore_extensions = ["draft", "vo", "vok", "vos", "glob", "html~", "org", "aux", "sass"] - - generator_mode = true - complete_page_selector = "html" - default_template = "templates/main.html" - content_selector = "main" - doctype = "" - clean_urls = true - -[widgets.page-title] - widget = "title" - selector = "h1" - default = "~lthms" - prepend = "~lthms: " - -[widgets.generator-meta] - widget = "insert_html" - html = '' - selector = "head" - -[widgets.table-of-contents] - widget = "toc" - selector = "div#generate-toc" - action = "replace_element" - min_level = 2 - numbered_list = true - -[plugins.fix_urls] - file = "plugins/fix_urls.lua" - -[plugins.external_links] - file = "plugins/external_links.lua" - -[widgets.fix-urls] - widget = "fix_urls" - prefix_url = "/~lthms" - -[widgets.mark-external-urls] - after = "generate-history" - widget = "external_links" - -[widgets.generate-history] - widget = "preprocess_element" - selector = "#history" - command = "./scripts/generate_history.sh \"templates/history.html\"" - action = "replace_content" - -[widgets.math] - widget = "preprocess_element" - selector = ".imath" - command = "node scripts/katex.js" - action = "replace_content" -#+END_SRC diff --git a/site/posts/meta/Contents.org b/site/posts/meta/Contents.org new file mode 100644 index 0000000..c2e67d7 --- /dev/null +++ b/site/posts/meta/Contents.org @@ -0,0 +1,48 @@ +#+BEGIN_EXPORT html +

Authoring Contents and HTML Generation

+#+END_EXPORT + +* Using Org files + +** Author Guidelines + +** Generation Process + +#+BEGIN_SRC emacs-lisp :tangle ../../../scripts/configure-org.el +(setq org-html-htmlize-output-type nil) +(org-html-export-to-html nil nil nil t) +#+END_SRC + +#+BEGIN_SRC makefile :tangle ../../../org.mk +ORG_POSTS := $(shell find site/ -name "*.org") +INPUTS += $(ORG_POSTS:.org=.html) + +%.html: %.org + @echo "export $*.org" + @emacs $< \ + --batch \ + --load=$(shell pwd)/scripts/configure-org.el \ + --kill +#+END_SRC + +* Using Coq files + +#+BEGIN_SRC makefile :tangle ../../../coq.mk +COQ_POSTS := $(shell find site/ -name "*.v") +INPUTS += $(COQ_POSTS:.v=.html) + +COQCARGS := -async-proofs-cache force -w -custom-entry-overriden + +%.html: %.v + @echo "export $*.v" + @coqc ${COQCARGS} $*.v + @coqdoc --no-index --charset utf8 --short --body-only -d site/posts/ \ + --coqlib "https://coq.inria.fr/distrib/current/stdlib/" \ + $*.v + @sed -i -e 's/href="$(shell basename $*.html)\#/href="\#/g' $*.html + @rm -f site/posts/coqdoc.css +#+END_SRC + +# Local Variables: +# org-src-preserve-indentation: t +# End: diff --git a/site/posts/meta/Soupault.org b/site/posts/meta/Soupault.org new file mode 100644 index 0000000..bbc05c5 --- /dev/null +++ b/site/posts/meta/Soupault.org @@ -0,0 +1,68 @@ +#+BEGIN_EXPORT html +

soap.coffee/~lthms Soupault Configuration

+ +
site/posts/meta/Soupault.org
+#+END_EXPORT + +#+BEGIN_SRC toml :tangle ../../soupault.conf +[settings] + strict = true + verbose = false + debug = false + site_dir = "site" + build_dir = "build" + + page_file_extensions = ["html"] + ignore_extensions = ["draft", "vo", "vok", "vos", "glob", "html~", "org", "aux", "sass"] + + generator_mode = true + complete_page_selector = "html" + default_template = "templates/main.html" + content_selector = "main" + doctype = "" + clean_urls = true + +[widgets.page-title] + widget = "title" + selector = "h1" + default = "~lthms" + prepend = "~lthms: " + +[widgets.generator-meta] + widget = "insert_html" + html = '' + selector = "head" + +[widgets.table-of-contents] + widget = "toc" + selector = "div#generate-toc" + action = "replace_element" + min_level = 2 + numbered_list = true + +[plugins.fix_urls] + file = "plugins/fix_urls.lua" + +[plugins.external_links] + file = "plugins/external_links.lua" + +[widgets.fix-urls] + widget = "fix_urls" + prefix_url = "/~lthms" + +[widgets.mark-external-urls] + after = "generate-history" + widget = "external_links" + +[widgets.generate-history] + widget = "preprocess_element" + selector = "#history" + command = "./scripts/generate_history.sh \"templates/history.html\"" + action = "replace_content" + +[widgets.math] + widget = "preprocess_element" + selector = ".imath" + command = "node scripts/katex.js" + action = "replace_content" +#+END_SRC -- cgit v1.2.3