summaryrefslogtreecommitdiffstats
path: root/site/posts/meta/Contents.org
blob: d287585ec7b0ff0360af159cce46d9625ae8a7d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#+BEGIN_EXPORT html
<h1>Authoring Contents and HTML Generation</h1>
#+END_EXPORT

* Using Org files

** Author Guidelines

** Under the Hood

#+BEGIN_SRC emacs-lisp :tangle (concat (getenv "ROOT") "/scripts/export-org.el")
(require 'package)

(setq user-emacs-directory (concat (getenv "ROOT") "/emacs.d"))
(setq package-user-dir (concat (getenv "ROOT") "/emacs.d"))
(setq package-archives '(("gnu"   . "https://elpa.gnu.org/packages/")
                         ("melpa" . "https://melpa.org/packages/")))

(package-initialize)

(or (file-exists-p package-user-dir)
    (package-refresh-contents))

(defun require-packages-force (&rest packages)
  "Ensure every PACKAGES is available"
  (mapcar
   (lambda (package)
     (let ((package (if (listp package)
                        package
                      (cons package package))))
       (if (not (package-installed-p (car package)))
           (package-install (car package)))
       (if (cdr package)
           (require (cdr package)))
       package))
   packages))

(require-packages-force
 'org 'htmlize 'nordless-theme
 'sass-mode 'haskell-mode)
#+END_SRC

#+BEGIN_SRC emacs-lisp :tangle (concat (getenv "ROOT") "/scripts/export-org.el")
(setq htmlize-output-type 'inline-css)
(setq org-export-with-toc nil)
(org-html-export-to-html nil nil nil t)
#+END_SRC

#+BEGIN_SRC makefile :tangle (concat (getenv "ROOT") "/org.mk")
ORG_POSTS := $(shell find site/ -name "*.org")

CONTENTS += $(ORG_POSTS:.org=.html)
GENSASS += site/style/org.sass
GENFILES += emacs.d/

EXPORTARGS := --batch \
              --load="${ROOT}/scripts/export-org.el"

%.html : %.org scripts/export-org.el
	@echo "  export  $*.org"
	@${EMACS} $< ${EXPORTARGS}
#+END_SRC

#+BEGIN_SRC sass :tangle (concat (getenv "ROOT") "/site/style/org.sass")
.footpara
    display: inline
    margin-left: .2em

.section-number-2:after, .section-number-3:after, .section-number-4:after
    content: ". "
#+END_SRC

* Using Coq files

** Author Guidelines

** Under the Hood

#+BEGIN_SRC makefile :tangle (concat (getenv "ROOT") "/coq.mk")
COQ_POSTS := $(shell find site/ -name "*.v")
CONTENTS += $(COQ_POSTS:.v=.html)
GENSASS += site/style/coq.sass

COQLIB := "https://coq.inria.fr/distrib/current/stdlib/"
COQCARG := -async-proofs-cache force \
           -w -custom-entry-overriden
COQDOCARG := --no-index --charset utf8 --short \
             --body-only --coqlib "${COQLIB}"

%.html : %.v
	@echo "  export  $*.v"
	@coqc ${COQCARG} $<
	@coqdoc ${COQDOCARG} -d $(shell dirname $<) $<
	@sed -i -e 's/href="$(shell basename $@)\#/href="\#/g' $@
	@rm -f $(shell dirname $<)/coqdoc.css
#+END_SRC

#+BEGIN_SRC sass :tangle (concat (getenv "ROOT") "/site/style/coq.sass")
div.code
    white-space: nowrap
    overflow-x: visible

.code a[href]
    text-decoration: none

    .fa-external-link
      display: none

.paragraph
    margin-top: 1em
    margin-bottom: 1em
#+END_SRC

# Local Variables:
# org-src-preserve-indentation: t
# End: