Merida in the movie Ralph 2.0

1 Author Guidelines

2 Under the Hood

(use-package lua-mode :ensure t :defer t)
(use-package rust-mode :ensure t :defer t)
(use-package sass-mode :ensure t :defer t)
(use-package haskell-mode :ensure t :defer t)
(use-package toml-mode :ensure t :defer t)
(use-package json-mode :ensure t :defer t)
(use-package monokai-pro-theme :ensure t :defer t
  :init
  (load-theme 'monokai-pro t))
scripts/packages.el
(cleopatra:configure)

(org-babel-do-load-languages
 'org-babel-load-languages
 '((shell . t)))

(setq org-export-with-toc nil)

(add-to-list 'org-entities-user
             '("im" "\\(" nil "<span class=\"imath\">" "" "" ""))
(add-to-list 'org-entities-user
             '("mi" "\\)" nil "</span>" "" "" ""))

(setq org-babel-exp-code-template
      (concat "#+BEGIN_SRC %lang "
              ":tangle "scripts/export-org.el" :name \n"
              "%body\n"
              "#+END_SRC"))

(defun cleopatra-html-src-block (oldfun src-block contents info)
  (let*
      ((old-ret (funcall oldfun src-block contents info))
       (pars (org-babel-parse-header-arguments
              (org-element-property :parameters src-block)))
       (tangle (cdr (assoc :tangle pars)))
       (name (cdr (assoc :name pars))))
    (cond
     (name
      (concat
       "<div class=\"org-literate-programming\">"
       (format "<div class=\"org-src-name\">&lt;&lt%s&gt;&gt :=</div>" name)
       old-ret
       "</div>"))
     ((not (string= tangle "no"))
      (concat
       "<div class=\"org-literate-programming\">"
       old-ret
       (format "<div class=\"org-src-tangled-to\">%s</div>" tangle)
       "</div>"))
     (t old-ret))))

(advice-add 'org-html-src-block
            :around #'cleopatra-html-src-block)

(org-html-export-to-html nil nil nil t)
scripts/export-org.el
EMACS := cleopatra-emacs

ORG_POSTS := $(shell find site/ -name "*.org")
ORG_HTML := $(ORG_POSTS:.org=.html)

org-prebuild : .emacs
org-build : ${ORG_HTML}

theme-build : site/style/org.sass
soupault-build : org-build

ARTIFACTS += ${ORG_HTML}
CONFIGURE += .emacs

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

.emacs : scripts/packages.el
        @cleopatra echo Initiating  "Emacs configuration"
        @${EMACS} ${INIT}
        @touch .emacs

%.html : %.org scripts/packages.el scripts/export-org.el \
         .emacs org.mk
        @cleopatra echo Exporting "$*.org"
        @${EMACS} $< ${EXPORT}
org.mk
.org-src-container
    @include code-block
    padding-top : .1rem
    padding-bottom : .1rem

.org-src-tangled-to, .org-src-name
    @include padding-centered(4rem)

.example
    @include verbatim-block
    // this is hacky, but it works: no need for a padding-bottom
    padding-top : 1rem

.footdef
    @include padding-centered

.footpara
    display: inline
    margin-left: .2em

.section-number-2:after,
.section-number-3:after
    content: ". "

.section-number-4,
.section-number-5,
.section-number-6
    display: none

dl
  dt
    font-weight: bold
  dd p
    margin-top: 0

.footnotes
  font-size : 1rem

.org-literate-programming
  padding-top : 1rem
  padding-bottom : 1rem
  .org-src-name
    @include code-font
    font-weight: bold

  .org-src-tangled-to:before
    content: "\f054"
    font : normal normal normal 14px/1 ForkAwesome

  .org-src-tangled-to
    @include code-font
    font-weight: bold
    text-align: right
site/style/org.sass