;; -*- lexical-binding: t -*-
;;; Package -- make.el
;;; Commentary:
;;;
;;; Code:
(package-initialize)
(require 'org)
(require 'cl-lib)
(require 'ox)
(require 'ox-html)
(dolist (d '("public_html"))
(unless (file-exists-p d)
(make-directory d)))
(require 'org-special-block-extras)
(add-hook #'org-mode-hook #'org-special-block-extras-mode)
(defun my-org--support-special-blocks-with-args (backend)
(let ((fbackend (if (equal backend '(templated-html)) 'html backend)))
`(,fbackend)))
(advice-add 'org--support-special-blocks-with-args :filter-args #'my-org--support-special-blocks-with-args)
(ignore-errors (require 'ox-thtml))
;; https://alhassy.github.io/AlBasmala.html#Floating-TOC
(advice-add 'org-html--translate :before-until 'display-toc-as-toc)
(defun display-toc-as-toc (phrase info)
(when (equal phrase "Table of Contents")
"
TOC
"))
(require 'extra-blocks)
;; DOES NOT WORK https://github.com/alphapapa/unpackaged.el#export-to-html-with-useful-anchors
(setq org-export-with-sub-superscripts '{}
org-export-headline-levels 6
; emacs-htmlize does not work when Emacs is ran in =script= mode unfortunately
;; org-html-html5-fancy t
org-html-htmlize-output-type 'css
indent-tabs-mode nil)
(setq-default indent-tabs-mode nil)
(defvar magic_rb/asset-include
"\\(ttf\\|svg\\|jpg\\|gif\\|png\\|css\\|js\\|el\\|nb\\|ipynb\\|pdf\\|xml\\|woff2\\)")
(defun org-export-add-target-blank-to-http-links (text backend info)
"Add target=\"_blank\" to external links."
(when (and
(org-export-derived-backend-p backend 'html)
(string-match "href=\"https?[^\"]+" text)
(not (string-match "target=\"" text)))
(string-match "