summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Letan <lthms@soap.coffee>2020-04-04 02:34:38 +0200
committerThomas Letan <lthms@soap.coffee>2020-04-04 02:34:38 +0200
commita38a43028d05096369aa7bcec827bb6c08e3af8e (patch)
tree327dfad2b1d463ff13597b5b6bdaef5d15f4ea09
parentea291d2af9aa63f4b228964a1baf4b532da8e6df (diff)
Benefit from cleopatra org-related functions to export org filesHEADmaster
-rw-r--r--.gitignore2
-rw-r--r--scripts/tangle-org.el10
-rw-r--r--site/cleopatra/org.org51
3 files changed, 8 insertions, 55 deletions
diff --git a/.gitignore b/.gitignore
index d9d181c..6aac4b9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,7 +4,6 @@
coq.mk
site/style/coq.sass
.emacs
-emacs.d/
scripts/export-org.el
scripts/packages.el
org.mk
@@ -50,7 +49,6 @@ site/posts/DiscoveringCommonLisp.html
site/posts/ExtensibleTypeSafeErrorHandling.html
site/posts/MonadTransformers.html
site/posts/CleopatraV1.html
-*.html~
build/
site/style/main.css
site/style/main.sass
diff --git a/scripts/tangle-org.el b/scripts/tangle-org.el
deleted file mode 100644
index 7ddead6..0000000
--- a/scripts/tangle-org.el
+++ /dev/null
@@ -1,10 +0,0 @@
-(require 'org)
-(cd (getenv "ROOT"))
-(setq org-confirm-babel-evaluate nil)
-(setq org-src-preserve-indentation t)
-(add-to-list 'org-babel-default-header-args
- '(:mkdirp . "yes"))
-(org-babel-do-load-languages
- 'org-babel-load-languages
- '((shell . t)))
-(org-babel-tangle)
diff --git a/site/cleopatra/org.org b/site/cleopatra/org.org
index bab4dc9..b846ee8 100644
--- a/site/cleopatra/org.org
+++ b/site/cleopatra/org.org
@@ -3,34 +3,6 @@
* Under the Hood
#+BEGIN_SRC emacs-lisp :tangle scripts/packages.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 ensure-package-installed (&rest packages)
- "Ensure every PACKAGES is installed."
- (mapcar
- (lambda (package)
- (if (package-installed-p package)
- nil
- (package-install package))
- package)
- packages))
-
-(ensure-package-installed 'use-package)
-(eval-when-compile (require 'use-package))
-
-(use-package org :ensure t)
-(use-package htmlize :ensure t)
(use-package lua-mode :ensure t :defer t)
(use-package rust-mode :ensure t :defer t)
(use-package sass-mode :ensure t :defer t)
@@ -40,21 +12,16 @@
(use-package monokai-pro-theme :ensure t :defer t
:init
(load-theme 'monokai-pro t))
-
-(provide 'packages)
#+END_SRC
#+BEGIN_SRC emacs-lisp :tangle scripts/export-org.el
-(require 'packages)
+(cleopatra:configure)
(org-babel-do-load-languages
'org-babel-load-languages
'((shell . t)))
-(setq org-src-preserve-indentation t)
-(setq org-src-fontify-natively t)
-(setq org-confirm-babel-evaluate nil)
+
(setq org-export-with-toc nil)
-(setq org-export-with-sub-superscripts nil)
(add-to-list 'org-entities-user
'("im" "\\(" nil "<span class=\"imath\">" "" "" ""))
@@ -96,11 +63,7 @@
#+END_SRC
#+BEGIN_SRC makefile :tangle org.mk
-EMACSBIN := emacs
-EMACS := ROOT="${ROOT}" ${EMACSBIN}
-TANGLE := --batch \
- --load="${ROOT}/scripts/tangle-org.el" \
- 2>> build.log
+EMACS := cleopatra-emacs
ORG_POSTS := $(shell find site/ -name "*.org")
ORG_HTML := $(ORG_POSTS:.org=.html)
@@ -111,12 +74,14 @@ org-build : ${ORG_HTML}
theme-build : site/style/org.sass
soupault-build : org-build
-ARTIFACTS += ${ORG_HTML} "*.html~"
-CONFIGURE += .emacs emacs.d/
+ARTIFACTS += ${ORG_HTML}
+CONFIGURE += .emacs
-EXPORT := --directory="${ROOT}/scripts/" --batch \
+EXPORT := --batch \
+ --load="${ROOT}/scripts/packages.el" \
--load="${ROOT}/scripts/export-org.el" \
2>> build.log
+
INIT := --batch --load="${ROOT}/scripts/packages.el" \
2>> build.log