MetroWind / color-block-org

A versatile custom CSS for org docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Color Block Org

A versatile custom CSS for Emacs org-mode.

screenshot

Installation & Usage

Copy the CSS file somewhere, and follow the official instruction.

I have this piece in my Emacs configuration that allows me to globally specify a CSS file to embed automatically, which I shamelessly copied from here.

  ;; Embed inline CSS read from a file.
  (defun my-org-inline-css-hook (exporter)
    "Insert custom inline css"
    (when (eq exporter 'html)
      (let* ((dir (ignore-errors (file-name-directory (buffer-file-name))))
             (path (concat dir "style.css"))
             (homestyle (and (or (null dir) (null (file-exists-p path)))
                             (not (null-or-unboundp 'my-org-inline-css-file))))
             (final (if homestyle my-org-inline-css-file path)))
        (if (file-exists-p final)
            (progn
              (setq-local org-html-head-include-default-style nil)
              (setq-local org-html-head (concat
                                         "<style type=\"text/css\">\n"
                                         "<!--/*--><![CDATA[/*><!--*/\n"
                                         (with-temp-buffer
                                           (insert-file-contents final)
                                           (buffer-string))
                                         "/*]]>*/-->\n"
                                         "</style>\n")))))))

  (add-hook 'org-export-before-processing-hook 'my-org-inline-css-hook)

About

A versatile custom CSS for org docs

License:Do What The F*ck You Want To Public License


Languages

Language:CSS 100.0%