org-contribute.org: Add Utkarsh Singh as a TINYCHANGE contributor
[worg.git] / worgtest-init.el
blobf4ab55b0b284da5d2d2e9366506a9378c1708ba0
1 (mapc (lambda (e)
2 (add-to-list 'load-path e))
3 worg-add-load-path)
5 (require 'org)
6 (require 'htmlize)
8 ;; to have things work correctly in batch-mode
9 (require 'font-lock)
10 (require 'cc-mode)
11 (c-after-font-lock-init)
13 (custom-set-variables
14 ;; custom-set-variables was added by Custom.
15 ;; If you edit it by hand, you could mess it up, so be careful.
16 ;; Your init file should contain only one such instance.
17 ;; If there is more than one, they won't work right.
18 '(org-modules (quote (org-jsinfo)))
19 '(safe-local-variable-values (quote ((org-tags-column . -80) (org-export-latex-image-default-option . "width=30em") (org-html-head . "<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" />") (org-html-head-extra . "<link rel=stylesheet href=\"org-faq.css\" type=\"text/css\"> <style type=\"text/css\"> </style>") (org-export-publishing-directory . "tmp") (org-html-head . "<link rel=stylesheet href=\"freeshell2.css\" type=\"text/css\"> <style type=\"text/css\"> .tag { color: red; font-weight:bold}</style>")))))
21 (show-paren-mode 1)
22 (menu-bar-mode 0)
23 (set-face-foreground 'font-lock-keyword-face "DeepSkyBlue1")
24 (set-face-foreground 'font-lock-string-face "pale goldenrod")
26 (setq make-backup-files nil
27 vc-handled-backends nil)
29 (setq org-export-default-language "en"
30 org-export-html-extension "html"
31 org-export-with-timestamps nil
32 org-export-with-section-numbers nil
33 org-export-with-tags 'not-in-toc
34 org-export-skip-text-before-1st-heading nil
35 org-export-with-sub-superscripts '{}
36 org-export-with-LaTeX-fragments t
37 org-export-with-archived-trees nil
38 org-export-highlight-first-table-line t
39 org-export-latex-listings-w-names nil
40 org-export-html-style-include-default nil
41 org-export-htmlize-output-type 'css
42 org-startup-folded nil
43 org-export-allow-BIND t
44 org-publish-list-skipped-files t
45 org-publish-use-timestamps-flag t
46 org-export-babel-evaluate nil
47 org-confirm-babel-evaluate nil)
49 ;; re-export everything regardless of whether or not it's been modified
50 (setq org-publish-use-timestamps-flag nil)
52 (defun set-org-publish-project-alist ()
53 (interactive)
54 (setq org-publish-project-alist
55 `(("worg" :components ("worg-org-faq" "worg-pages" "worg-code" "worg-color-themes" "worg-images-dir" "worg-images" "worg-sources" "worg-extra" "worg-bibtex"))
56 ("worg-org-faq"
57 :base-directory ,worg-base-directory
58 :base-extension "dummy"
59 :include ("org-faq.org")
60 :html-extension "html"
61 :publishing-directory ,worg-publish-directory
62 :publishing-function org-html-publish-to-html
63 :section-numbers nil
64 :table-of-contents nil
65 :style "<link rel=\"stylesheet\" title=\"Standard\" href=\"/worg/style/worg.css\" type=\"text/css\" />
66 <link rel=\"alternate stylesheet\" title=\"Zenburn\" href=\"/worg/style/worg-zenburn.css\" type=\"text/css\" />
67 <link rel=\"alternate stylesheet\" title=\"Classic\" href=\"/worg/style/worg-classic.css\" type=\"text/css\" />
68 <link rel=\"stylesheet\" href=\"https://orgmode.org/css/lightbox.css\" type=\"text/css\" media=\"screen\" />
69 <link rel=\"icon\" href=\"/favicon.ico\" type=\"image/x-icon\" />"
70 :recursive t
71 :html-preamble ,(org-get-file-contents (concat worg-base "preamble.html"))
72 :html-postamble "<div id=\"show_source\"><input type=\"button\" value=\"Show Org source\" onClick='show_org_source()'></div><div id=\"license\"><p>Documentation from the https://orgmode.org/worg/ website (either in its HTML format or in its Org format) is licensed under the <a href=\"http://www.gnu.org/copyleft/fdl.html\">GNU Free Documentation License version 1.3</a> or later. The code examples and css stylesheets are licensed under the <a href=\"http://www.gnu.org/licenses/gpl.html\">GNU General Public License v3</a> or later.</p></div>"
74 ("worg-pages"
75 :base-directory ,worg-base-directory
76 :base-extension "org"
77 :exclude "FIXME"
78 :makeindex t
79 :auto-sitemap nil
80 :sitemap-ignore-case t
81 :html-extension "html"
82 :publishing-directory ,worg-publish-directory
83 :publishing-function (org-html-publish-to-html)
84 :htmlized-source nil
85 :section-numbers nil
86 :table-of-contents nil
87 :style "<link rel=\"stylesheet\" title=\"Standard\" href=\"/worg/style/worg.css\" type=\"text/css\" />
88 <link rel=\"alternate stylesheet\" title=\"Zenburn\" href=\"/worg/style/worg-zenburn.css\" type=\"text/css\" />
89 <link rel=\"alternate stylesheet\" title=\"Classic\" href=\"/worg/style/worg-classic.css\" type=\"text/css\" />
90 <link rel=\"stylesheet\" href=\"https://orgmode.org/css/lightbox.css\" type=\"text/css\" media=\"screen\" />
91 <link rel=\"icon\" href=\"/favicon.ico\" type=\"image/x-icon\" />"
92 :recursive t
93 :html-preamble ,(org-get-file-contents (concat worg-base "preamble.html"))
94 :html-postamble "<div id=\"show_source\"><input type=\"button\" value=\"Show Org source\" onClick='show_org_source()'></div><div id=\"license\"><p>Documentation from the https://orgmode.org/worg/ website (either in its HTML format or in its Org format) is licensed under the <a href=\"http://www.gnu.org/copyleft/fdl.html\">GNU Free Documentation License version 1.3</a> or later. The code examples and css stylesheets are licensed under the <a href=\"http://www.gnu.org/licenses/gpl.html\">GNU General Public License v3</a> or later.</p></div>"
96 ("worg-code"
97 :base-directory ,worg-base-code-directory
98 :base-extension "html\\|css\\|png\\|js\\|bz2\\|el\\|sty\\|awk\\|pl"
99 :html-extension "html"
100 :publishing-directory ,(concat worg-htmlroot "/code/")
101 :recursive t
102 :publishing-function org-publish-attachment)
103 ("worg-color-themes"
104 :base-directory ,worg-base-color-themes-directory
105 :base-extension "el"
106 :html-extension "html"
107 :publishing-directory ,(concat worg-htmlroot "/code/elisp/")
108 :recursive t
109 :publishing-function org-publish-attachment)
110 ("worg-images-dir"
111 :base-directory ,worg-base-images-directory
112 :base-extension "png\\|jpg\\|gif\\|pdf\\|cvs\\|css"
113 :publishing-directory ,(concat worg-htmlroot "/images/")
114 :recursive t
115 :publishing-function org-publish-attachment)
116 ("worg-images"
117 :base-directory ,worg-base-directory
118 :base-extension "png\\|jpg\\|gif\\|pdf\\|csv\\|css\\|tex"
119 :publishing-directory ,worg-publish-directory
120 :recursive t
121 :publishing-function org-publish-attachment)
122 ("worg-sources"
123 :base-directory ,worg-base-directory
124 :base-extension "org"
125 :publishing-directory ,(concat worg-htmlroot "/sources/")
126 :recursive t
127 :publishing-function org-publish-attachment)
128 ("worg-extra"
129 :base-directory ,worg-base-directory
130 :base-extension "css"
131 :publishing-directory ,worg-publish-directory
132 :publishing-function org-publish-attachment)
133 ("worg-bibtex"
134 :base-directory ,(concat worg-base "org-contrib/bibtex/")
135 :base-extension "bib"
136 :publishing-directory ,(concat worg-htmlroot "/org-contrib/bibtex/")
137 :recursive nil
138 :publishing-function org-publish-attachment)
141 (setq worg-base-directory worg-base)
142 (setq worg-base-code-directory (concat worg-base "code/"))
143 (setq worg-base-color-themes-directory (concat worg-base "code/elisp/"))
144 (setq worg-base-images-directory (concat worg-base "images/"))
145 (setq worg-publish-directory worg-htmlroot)
146 (set-org-publish-project-alist)
148 (defun worg-fix-symbol-table ()
149 (when (string-match "org-symbols\\.html" buffer-file-name)
150 (goto-char (point-min))
151 (while (re-search-forward "<td>&amp;\\([^<;]+;\\)" nil t)
152 (replace-match (concat "<td>&" (match-string 1)) t t))))
154 (defun publish-worg-old nil
155 "Publish Worg."
156 (interactive)
157 (add-hook 'org-publish-after-export-hook 'worg-fix-symbol-table)
158 (let ((org-format-latex-signal-error nil)
159 (worg-base-directory worg-base)
160 (worg-base-code-directory (concat worg-base "code/"))
161 (worg-base-color-themes-directory (concat worg-base "code/elisp/"))
162 (worg-base-images-directory (concat worg-base "images/"))
163 (worg-publish-directory worg-htmlroot))
164 (set-org-publish-project-alist)
165 (org-publish-project "worg")))
167 (defun publish-worg nil
168 "Publish Worg."
169 (interactive)
170 (add-hook 'org-publish-after-export-hook 'worg-fix-symbol-table)
171 (let ((org-format-latex-signal-error nil)
172 (worg-base-directory worg-base)
173 (worg-base-code-directory (concat worg-base "code/"))
174 (worg-base-color-themes-directory (concat worg-base "code/elisp/"))
175 (worg-base-images-directory (concat worg-base "images/"))
176 (worg-publish-directory worg-htmlroot))
177 (set-org-publish-project-alist)
178 (message "Emacs %s" emacs-version)
179 (org-version)
180 (org-publish-project "worg")))
182 (defun parse-org-quotes ()
183 "Create ~/orgmode.org/org-quotes.js from org-quotes.org."
184 (interactive)
185 (load (concat worg-base "code/elisp/worg-fortune.el"))
186 (worg-write-fortune-file
187 (concat worg-base "org-quotes.org")
188 "~/orgmode.org/org-quotes.js"
190 "r_text[%d] = \"%s\";" "\n"
191 'worg-fortune-insert-javascript-pre
192 'worg-fortune-insert-javascript-post))