-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtranspile_html.el
executable file
·109 lines (93 loc) · 3.94 KB
/
transpile_html.el
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
#!/usr/bin/emacs --script
; bad!
; (add-to-list 'load-path "~/.emacs.d/elpa/")
(load-file "./resources/s.el")
(load-file "./resources/dash.el")
(load-file "./resources/lf.el")
(load-file "./resources/htmlize.el")
(load-file "./resources/org-special-block-extras.el")
(require 'org)
(require 'org-id)
(require 'htmlize)
(require 'org-special-block-extras)
(add-hook #'org-mode-hook #'org-special-block-extras-mode)
(setq user-full-name "Taproot")
(setq user-mail-address "[email protected]")
(setq org-html-preamble t)
(setq org-html-postamble nil)
(setq org-export-with-broken-links t)
(setq org-src-fontify-natively t)
(setq org-html-htmlize-output-type 'css)
(org-id-locations-load)
(o-defblock aside (title "") (contents "")
(format
"<div class=\"admonition\" style=\"--admonition-color: 173, 173, 173;\"><div class=\"admonition-title\"><div class=\"admonition-title-content\"><div class=\"admonition-title-icon\"><i class=\"fas fa-quote-left\" aria-hidden=\"true\"></i></div><div class=\"admonition-title-markdown\">%s</div></div></div><div class=\"admonition-content-holder\"><div class=\"admonition-content\">%s</div></div></div>" title contents))
(setq org-html-preamble-format '(("en" "<div class=\"header\"><span class=\"site\"><a href=\"https://taproot3.sanity.gq\">TR3.5</a></span></div><div class=\"datarow\"><h1 class=\"title\">%t</h1> <h2 class=\"subtitle\">%s</h2> <span class=\"author\">%a</span> <span class=\"date\">%C</date></div>")))
(setq org-html-mathjax-options
'((path "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML")
(scale "100")
(align "center")
(indent "2em")
(mathml t)))
(setq org-html-mathjax-template
"
<script type=\"text/javascript\" src=\"%PATH\"></script>
<script type=\"text/javascript\">
<!--/*--><![CDATA[/*><!--*/
MathJax.Hub.Config({
jax: [\"input/TeX\", \"output/HTML-CSS\"],
extensions: [\"tex2jax.js\",\"TeX/AMSmath.js\",\"TeX/AMSsymbols.js\",
\"TeX/noUndefined.js\", \"[Contrib]/siunitx/siunitx.js\", \"[Contrib]/mhchem/mhchem.js\"],
tex2jax: {
inlineMath: [ [\"\\\\(\",\"\\\\)\"] ],
displayMath: [ ['$$','$$'], [\"\\\\[\",\"\\\\]\"], [\"\\\\begin{displaymath}\",\"\\\\end{displaymath}\"] ],
skipTags: [\"script\",\"noscript\",\"style\",\"textarea\",\"pre\",\"code\"],
ignoreClass: \"tex2jax_ignore\",
processEscapes: false,
processEnvironments: true,
preview: \"TeX\"
},
TeX: {extensions: [\"AMSmath.js\",\"AMSsymbols.js\", \"[Contrib]/siunitx/siunitx.js\", \"[Contrib]/mhchem/mhchem.js\"]},
showProcessingMessages: true,
displayAlign: \"%ALIGN\",
displayIndent: \"%INDENT\",
\"HTML-CSS\": {
scale: %SCALE,
availableFonts: [\"STIX\",\"TeX\"],
preferredFont: \"TeX\",
webFont: \"TeX\",
imageFont: \"TeX\",
showMathMenu: true,
},
MMLorHTML: {
prefer: {
MSIE: \"MML\",
Firefox: \"MML\",
Opera: \"HTML\",
other: \"HTML\"
}
}
});
/*]]>*///-->
</script>")
(defun admonition-block (color icon title contents)
(format
"<div class=\"admonition admonition-plugin\" style=\"--admonition-color: %s;\">
<div class=\"admonition-title \">
<div class=\"admonition-title-content\">
<div class=\"admonition-title-icon\">
<i class=\"fas %s\">
</div>
<div class=\"admonition-title-markdown\">%s</div>
</div>
</div>
<div class=\"admonition-content-holder\">
<div class=\"admonition-content\">
<p>%s</p>
</div>
</div>
</div>" color icon title contents))
; (org-special-block-extras-defblock defn (admonition-block "255, 0, 0" "fa-info-circle" "Testeroo" "dsadjakl"))
(find-file (car argv))
;;(org-special-block-extras-mode)
(org-html-export-to-html)