summaryrefslogtreecommitdiffstats
path: root/site/posts
diff options
context:
space:
mode:
authorThomas Letan <lthms@soap.coffee>2020-02-21 23:25:14 +0100
committerThomas Letan <lthms@soap.coffee>2020-02-21 23:25:14 +0100
commite792118e1e8e5213dff01f80240a98c14a55344f (patch)
tree4b257088f829376c1c079655eb59d4ad31aa814d /site/posts
parentb3a30963af918d1d4edf03ac67ba44089c1a5417 (diff)
Various improvement in cleopatra
- Fix the dependencies in the Makefile - Use a minimal emacs configuration with themes - Dark theme again
Diffstat (limited to 'site/posts')
-rw-r--r--site/posts/MonadTransformers.org5
-rw-r--r--site/posts/meta.org4
-rw-r--r--site/posts/meta/Bootstrap.org21
-rw-r--r--site/posts/meta/Contents.org36
4 files changed, 53 insertions, 13 deletions
diff --git a/site/posts/MonadTransformers.org b/site/posts/MonadTransformers.org
index 7947ef4..4c28fe5 100644
--- a/site/posts/MonadTransformers.org
+++ b/site/posts/MonadTransformers.org
@@ -43,9 +43,10 @@ Monad. It carries an environment in a transparent way. The only thing is, I was
already using the State Monad to carry the computation result. But that’s not an
issue with the Monad Transformers.
-#+BEGIN_SRC patch
+#+BEGIN_SRC diff
-type Builder = StateT Text IO
+type Builder = StateT Text (ReaderT Language IO)
+
#+END_SRC
As you may have already understood, I wasn't using the “raw” ~State~ Monad, but
@@ -56,7 +57,7 @@ function call easily” problem.
Retrieving the chosen language is as simple as:
-#+BEGIN_SRC patch
+#+BEGIN_SRC haskell
getLanguage :: Builder Language
getLanguage = lift ask
#+END_SRC
diff --git a/site/posts/meta.org b/site/posts/meta.org
index e01b451..918d15b 100644
--- a/site/posts/meta.org
+++ b/site/posts/meta.org
@@ -24,10 +24,12 @@ according to [[https://fr.wikipedia.org/wiki/Polyglotte][Wikipedia France]])?
*Beware* this series is far from being complete.
-- [[/posts/meta/Bootstrap][Bootstrapping an Extensible Toolchain ~(TODO)~]] ::
+- [[/posts/meta/Bootstrap][Bootstrapping an Extensible Toolchain ~(WIP)~]] ::
- [[/posts/meta/Contents][Authoring Content and HTML Generation ~(WIP)~]] ::
+- [[/posts/meta/Theme][Theming and Templating ~(WIP)~]] ::
+
- [[/posts/meta/Soupault/][Soupault Configuration ~(WIP)~]] ::
#+BEGIN_EXPORT html
diff --git a/site/posts/meta/Bootstrap.org b/site/posts/meta/Bootstrap.org
index 5da62a0..60c9134 100644
--- a/site/posts/meta/Bootstrap.org
+++ b/site/posts/meta/Bootstrap.org
@@ -3,21 +3,21 @@
#+END_EXPORT
#+BEGIN_SRC emacs-lisp :tangle (concat (getenv "ROOT") "/scripts/tangle-org.el")
- (require 'org)
- (setq org-src-preserve-indentation t)
- (org-babel-tangle)
+(require 'org)
+(setq org-src-preserve-indentation t)
+(org-babel-tangle)
#+END_SRC
#+BEGIN_SRC makefile :tangle (concat (getenv "ROOT") "/bootstrap.mk")
GENSASS :=
CONTENTS :=
-GENFILES += scripts/export-org.el org.mk coq.mk \
- sass.mk soupault.conf
-
-EMACS := ROOT="${ROOT}" emacs
+GENFILES += org.mk scripts/export-org.el coq.mk \
+ sass.mk ${SASS} templates/main.html \
+ soupault.conf
include org.mk coq.mk sass.mk
+EMACS := ROOT="${ROOT}" emacs
TANGLEARGS := --batch \
--load="${ROOT}/scripts/tangle-org.el" \
2>/dev/null
@@ -38,11 +38,14 @@ soupault.conf : ${CLEODIR}/Soupault.org
@echo " tangle $<"
@${EMACS} $< ${TANGLEARGS}
-org.mk coq.mk scripts/export-org.el &: ${CLEODIR}/Contents.org
+org.mk scripts/export-org.el site/style/org.sass \
+coq.mk site/style/coq.sass \
+ &: ${CLEODIR}/Contents.org
@echo " tangle $<"
@${EMACS} $< ${TANGLEARGS}
-sass.mk ${SASS} &: ${CLEODIR}/Theme.org
+sass.mk ${SASS} templates/main.html \
+ &: ${CLEODIR}/Theme.org
@echo " tangle $<"
@${EMACS} $< ${TANGLEARGS}
#+END_SRC
diff --git a/site/posts/meta/Contents.org b/site/posts/meta/Contents.org
index 1690801..d287585 100644
--- a/site/posts/meta/Contents.org
+++ b/site/posts/meta/Contents.org
@@ -9,15 +9,49 @@
** Under the Hood
#+BEGIN_SRC emacs-lisp :tangle (concat (getenv "ROOT") "/scripts/export-org.el")
-(setq org-html-htmlize-output-type nil)
+(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"