summaryrefslogtreecommitdiffstats
path: root/project.el
blob: 4cee90a9269538e9c1ba08dc48a5a124ce0ca465 (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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
(require 'ox-publish)
(require 'ox-rss)
;; (require 'ox-html)

(load "common.el")

;; (defun org-html-template (contents info)
;;   "Return complete document string after HTML conversion.
;; CONTENTS is the transcoded contents string.  INFO is a plist
;; holding export options."
;;   (concat
;;    (format
;;     (or (and (stringp org-html-xml-declaration)
;;              org-html-xml-declaration)
;;         (cdr (assoc (plist-get info :html-extension)
;;                     org-html-xml-declaration))
;;         (cdr (assoc "html" org-html-xml-declaration))

;;         "")
;;     (or (and org-html-coding-system
;;              (fboundp 'coding-system-get)
;;              (coding-system-get org-html-coding-system 'mime-charset))
;;         "iso-8859-1"))
;;    "\n"
;;    (plist-get info :html-doctype)
;;    "\n"
;;    (format "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"%s\" xml:lang=\"%s\">\n"
;;            (plist-get info :language) (plist-get info :language))
;;    "<head>\n"
;;    (org-html--build-meta-info info)
;;    (org-html--build-head info)
;;    (org-html--build-mathjax-config info)
;;    "</head>\n"
;;    "<body>\n"
;;    (let ((link-up (org-trim (plist-get info :html-link-up)))
;;          (link-home (org-trim (plist-get info :html-link-home))))
;;      (unless (and (string= link-up "") (string= link-up ""))
;;        (format org-html-home/up-format
;;                (or link-up link-home)
;;                (or link-home link-up))))
;;    ;; Preamble.
;;    (org-html--build-pre/postamble 'preamble info)
;;    ;; Document contents.
;;    (format "<%s class=\"%s\">\n"
;;            (nth 1 (assq 'content org-html-divs))
;;            (nth 2 (assq 'content org-html-divs)))
;;    ;; Document title.
;;    "<div class=\"navbar\">\n<div class=\"navbar-inner\">\n"
;;    (let ((title (plist-get info :title)))
;;      (format "<a class=\"brand\" href=\"#\">%s</a>\n" (org-export-data (or title "") info)))
;;    "</div>\n</div>\n"
;;    contents
;;    (format "")
;;    (format "</%s>\n"
;;            (nth 1 (assq 'content org-html-divs)))
;;    ;; Postamble.
;;    "<div class=\"container\">\n"
;;    (org-html--build-pre/postamble 'postamble info)
;;    "</div>\n"
;;    ;; Closing document.
;;    "</body>\n</html>"))

;; (defun org-html--tags (tags)
;;   "Format TAGS into HTML."
;;   (when tags
;;     (format "<small class=\"tag pull-right\">%s</small>"
;;             (mapconcat
;;              (lambda (tag)
;;                (format "<span class=\"%s\">%s</span>"
;;                        (concat org-html-tag-class-prefix
;;                                (org-html-fix-class-name tag))
;;                        tag))
;;              tags "&#xa0;"))))

;; (defun org-html-inner-template (contents info)
;;   "Return body of document string after HTML conversion.
;; CONTENTS is the transcoded contents string.  INFO is a plist
;; holding export options."
;;   (let ((depth (plist-get info :with-toc)))
;;     (concat
;;      (when depth
;;        (concat
;;         "<div class=\"row\">\n"
;;         "<div class=\"span3\">\n"
;;         ;; Table of contents.
;;         (when depth (org-html-toc depth info))
;;         "</div>\n"
;;         "<div class=\"span9\">\n"))
;;      ;; Document contents.
;;      contents
;;      (when depth
;;        "</div>\n</div>")
;;      ;; Footnotes section.
;;      (org-html-footnote-section info)
;;      ;; Bibliography.
;;      (org-html-bibliography))))

;; (defun org-html-toc (depth info)
;;   "Build a table of contents.
;; DEPTH is an integer specifying the depth of the table.  INFO is a
;; plist used as a communication channel.  Return the table of
;; contents as a string, or nil if it is empty."
;;   (let ((toc-entries
;;          (mapcar (lambda (headline)
;;                    (cons (org-html--format-toc-headline headline info)
;;                          (org-export-get-relative-level headline info)))
;;                  (org-export-collect-headlines info depth))))
;;     (when toc-entries (org-html--toc-text toc-entries))))

;; (defun org-html--toc-text (toc-entries)
;;   "Return innards of a table of contents, as a string.
;; TOC-ENTRIES is an alist where key is an entry title, as a string,
;; and value is its relative level, as an integer."
;;   (let* ((prev-level (1- (cdar toc-entries)))
;;          (start-level prev-level))
;;     (concat
;;      (mapconcat
;;       (lambda (entry)
;;         (let ((headline (car entry))
;;               (level (cdr entry)))
;;           (concat
;;            (let* ((cnt (- level prev-level))
;;                   (times (if (> cnt 0) (1- cnt) (- cnt)))
;;                   rtn)
;;              (setq prev-level level)
;;              (concat
;;               (org-html--make-string
;;                times (cond ((> cnt 0) "\n<ul class=\"nav nav-tabs nav-stacked\">\n<li>")
;;                            ((< cnt 0) "</li>\n</ul>\n")))
;;               (if (> cnt 0) "\n<ul class=\"nav nav-tabs nav-stacked\">\n<li class=\"nav-header\">Table of Contents</li>\n<li>" "</li>\n<li>")))
;;            headline)))
;;       toc-entries "")
;;      (org-html--make-string (- prev-level start-level) "</li>\n</ul>\n"))))

(setq org-publish-use-timestamps-flag nil
      org-rss-extension "rss"
      org-publish-project-alist
      '(("oni-files"
          :base-directory "./"
          :publishing-directory "_publish/"
          :recursive nil
          :base-extension "css\\|png"
          :publishing-function org-publish-attachment)
        ("org"
         :base-directory "./"
         :publishing-directory "_publish/"
         :recursive nil
         :base-extension "org"
         :publishing-function org-html-publish-to-html
         :section-numbers nil
         :table-of-contents 1
         :html-doctype "<!DOCTYPE html>"
         :html-head "<link rel=\"stylesheet\" media=\"screen\" href=\"//openfontlibrary.org/face/fantasque-sans-mono\" rel=\"stylesheet\" type=\"text/css\"/>\n<link href=\"https://ryuslash.org/org.css\" type=\"text/css\" rel=\"stylesheet\" />"
         :html-link-home "https://ryuslash.org")
        ("projects"
         :base-directory "./projects/"
         :publishing-directory "_publish/projects/"
         :recursive t
         :base-extension "org"
         :publishing-function org-html-publish-to-html
         :section-numbers nil
         :table-of-contents 1
         :html-doctype "<!DOCTYPE html>"
         :html-head "<link rel=\"stylesheet\" media=\"screen\" href=\"//openfontlibrary.org/face/fantasque-sans-mono\" rel=\"stylesheet\" type=\"text/css\"/>\n<link href=\"https://ryuslash.org/org.css\" type=\"text/css\" rel=\"stylesheet\" />"
         :html-link-home "https://ryuslash.org")))