changelog shortlog graph tags branches files raw help

Mercurial > org / changeset: org publishing

changeset 13: d0daa407ec13
parent 12: 15ed6871ad08
child 14: 06842841bf42
author: ellis <ellis@rwest.io>
date: Mon, 20 Nov 2023 19:02:47 -0500
files: .hgsub .hgsubstate pitch.org publish.el readme.org roadmap.org
description: org publishing
     1.1--- a/.hgsub	Sun Nov 19 22:13:06 2023 -0500
     1.2+++ b/.hgsub	Mon Nov 20 19:02:47 2023 -0500
     1.3@@ -1,3 +1,2 @@
     1.4 blog=https://lab.rwest.io/comp/blog
     1.5-docs=https://lab.rwest.io/comp/docs
     1.6-web=https://lab.rwest.io/comp/web
     1.7\ No newline at end of file
     1.8+docs=https://lab.rwest.io/comp/docs
     1.9\ No newline at end of file
     2.1--- a/.hgsubstate	Sun Nov 19 22:13:06 2023 -0500
     2.2+++ b/.hgsubstate	Mon Nov 20 19:02:47 2023 -0500
     2.3@@ -1,3 +1,2 @@
     2.4-9f4fb0ad27313a7ff7aec8cc92c640434d1e7b99 blog
     2.5-bd85a72319d85b4cc4d96df2459a6c500ec26271 docs
     2.6-c87ea7510f8c9b5538714c83d3adb4e0c1d8a301 web
     2.7+6b286d6cf099069357b01b6cf2386ed990572259 blog
     2.8+1c57e053f043e7f164e18edda6edfc235662cadb docs
     3.1--- a/pitch.org	Sun Nov 19 22:13:06 2023 -0500
     3.2+++ b/pitch.org	Mon Nov 20 19:02:47 2023 -0500
     3.3@@ -0,0 +1,5 @@
     3.4+#+AUTHOR: Richard Westhaver <ellis@rwest.io>
     3.5+#+OPTIONS: ^:nil toc:nil num:nil html-postamble:nil
     3.6+#+HTML_HEAD: <link rel="stylesheet" href="https://fonts.xz.style/serve/inter.css"/>
     3.7+#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="https://packy.rwest.io/style/css/new.min.css"/>
     3.8+#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="https://packy.rwest.io/style/css/terminal.css"/>
     4.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2+++ b/publish.el	Mon Nov 20 19:02:47 2023 -0500
     4.3@@ -0,0 +1,97 @@
     4.4+;;; publish.el --- the.compiler.company publishing script  -*- lexical-binding: t; -*-
     4.5+
     4.6+;;; Code:
     4.7+(require 'ox-publish)
     4.8+(require 'org-id)
     4.9+;; vendored
    4.10+(require 'htmlize)
    4.11+(defvar project-dir "~/dev/comp/org")
    4.12+(defvar publish-dir "/mnt/w/compiler.company")
    4.13+(defvar html-theme nil)
    4.14+(defvar url "https://compiler.company")
    4.15+(defvar html-nav "<div> <a href = \"https://compiler.company\">~/</a> ( <a href = \"https://compiler.company/blog\">blog</a> <a href = \"https://compiler.company/docs\">docs</a> <a href = \"https://vc.compiler.company/comp\">code</a> ) </div>")
    4.16+
    4.17+(defvar html-foot "<footer>updated %C</footer>")
    4.18+
    4.19+(setq org-html-style-default ""
    4.20+      org-html-scripts ""
    4.21+      org-html-htmlize-output-type 'css
    4.22+      org-export-htmlize-output-type 'css
    4.23+      org-html-doctype "html5"
    4.24+      org-html-html5-fancy t
    4.25+      org-html-validation-link nil
    4.26+      org-src-fontify-natively t
    4.27+      make-backup-files nil
    4.28+      debug-on-error t)
    4.29+
    4.30+(setq org-publish-project-alist
    4.31+      `(("compiler.company" :components ("index" "blog" "docs"))
    4.32+        ("index"
    4.33+         :base-directory ,project-dir
    4.34+         :base-extension "org"
    4.35+         :recursive nil
    4.36+         :htmlized-source t
    4.37+	 :html-preamble ,html-nav
    4.38+         :publishing-directory ,publish-dir
    4.39+         :publishing-function org-html-publish-to-html
    4.40+         :html-postamble ,html-foot)
    4.41+        ("blog"
    4.42+         :base-directory ,(expand-file-name "blog" project-dir)
    4.43+         :base-extension "org"
    4.44+	 :publishing-directory ,(expand-file-name "blog" publish-dir)
    4.45+	 :publishing-function org-html-publish-to-html
    4.46+	 :htmlized-source t
    4.47+	 :html-preamble ,html-nav
    4.48+         :html-postamble ,html-foot)
    4.49+        ("docs"
    4.50+         :base-directory ,(expand-file-name "docs" project-dir)
    4.51+         :base-extension "org"
    4.52+         :recursive t
    4.53+         :publishing-directory ,(expand-file-name "docs" publish-dir)
    4.54+	 :publishing-function org-html-publish-to-html
    4.55+	 :htmlized-source t
    4.56+         :html-preamble ,html-nav
    4.57+         :html-postamble ,html-foot)))
    4.58+
    4.59+(defun org-custom-id-get (&optional pom create prefix)
    4.60+  "Get the CUSTOM_ID property of the entry at point-or-marker POM.
    4.61+   If POM is nil, refer to the entry at point. If the entry does
    4.62+   not have an CUSTOM_ID, the function returns nil. However, when
    4.63+   CREATE is non nil, create a CUSTOM_ID if none is present
    4.64+   already. PREFIX will be passed through to `org-id-new'. In any
    4.65+   case, the CUSTOM_ID of the entry is returned."
    4.66+  (interactive)
    4.67+(org-with-point-at pom
    4.68+  (let ((id (org-entry-get nil "CUSTOM_ID"))
    4.69+	;; use CUSTOM_ID for links
    4.70+	(org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id))
    4.71+      (cond
    4.72+       ((and id (stringp id) (string-match "\\S-" id))
    4.73+        id)
    4.74+       (create
    4.75+        (setq id (org-id-new prefix))
    4.76+        (org-entry-put pom "CUSTOM_ID" id)
    4.77+        (org-id-add-location id (buffer-file-name (buffer-base-buffer)))
    4.78+        id)))))
    4.79+;;;###autoload
    4.80+(defun org-id-add-to-headlines-in-file ()
    4.81+  "Add CUSTOM_ID properties to all headlines in the
    4.82+   current file which do not already have one."
    4.83+  (interactive)
    4.84+  (org-map-entries (lambda () (org-custom-id-get (point) 'create))))
    4.85+
    4.86+;;;###autoload
    4.87+(defun publish (&optional sitemap static force async)
    4.88+  "publish `rwest-io' content.
    4.89+If STATIC is t, also publish media and static files.
    4.90+If FORCE is t, skip checking file mod date and just publish all files.
    4.91+If ASYNC is t, call `org-publish' asynchronously.
    4.92+If given a prefix (C-u), set all args to t"
    4.93+  (interactive)
    4.94+  (if current-prefix-arg
    4.95+      (setq static t
    4.96+	    force t
    4.97+            async t))
    4.98+  (let ((default-directory project-dir))
    4.99+    (message (format "publishing from %s" default-directory))    
   4.100+    (org-publish "compiler.company" force async)))
     5.1--- a/readme.org	Sun Nov 19 22:13:06 2023 -0500
     5.2+++ b/readme.org	Mon Nov 20 19:02:47 2023 -0500
     5.3@@ -1,15 +1,17 @@
     5.4-#+TITLE: comp/org
     5.5+#+TITLE: The Compiler Company
     5.6 #+AUTHOR: Richard Westhaver <ellis@rwest.io>
     5.7-Welcome to /The Compiler Company/.
     5.8+#+OPTIONS: ^:nil toc:nil num:nil html-postamble:nil
     5.9+#+HTML_HEAD: <link rel="stylesheet" href="https://fonts.xz.style/serve/inter.css"/>
    5.10+#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="https://packy.rwest.io/style/css/new.min.css"/>
    5.11+#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="https://packy.rwest.io/style/css/terminal.css"/>
    5.12+#+EXPORT_FILE_NAME: index
    5.13+Welcome stranger.
    5.14 
    5.15 |[[https://lab.rwest.io/comp.atom][vc.feed]]|
    5.16 
    5.17-* [[file:blog/][blog]]
    5.18-
    5.19-* [[file:docs/][docs]]
    5.20+- [[file:blog][blog]] 
    5.21+  - [2023-11-19 Sun] [[https://compiler.company/blog/hello-world][hello-world]]
    5.22 
    5.23-* [[file:scratch/][scratch]]
    5.24-
    5.25-* [[file:pitch.org][pitch]]
    5.26-
    5.27-* [[file:roadmap.org][roadmap]]
    5.28+- [[file:docs][docs]] 
    5.29+- [[file:roadmap.org][roadmap]]
    5.30+- [[file:pitch.org][pitch]]
     6.1--- a/roadmap.org	Sun Nov 19 22:13:06 2023 -0500
     6.2+++ b/roadmap.org	Mon Nov 20 19:02:47 2023 -0500
     6.3@@ -1,6 +1,10 @@
     6.4 #+TITLE: roadmap
     6.5 #+AUTHOR: Richard Westhaver
     6.6 #+EMAIL: ellis@rwest.io
     6.7+#+OPTIONS: ^:nil toc:nil num:nil
     6.8+#+HTML_HEAD: <link rel="stylesheet" href="https://fonts.xz.style/serve/inter.css"/>
     6.9+#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="https://packy.rwest.io/style/css/new.min.css"/>
    6.10+#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="https://packy.rwest.io/style/css/terminal.css"/>
    6.11 
    6.12 * WIP 2023
    6.13 SCHEDULED: <2023-01-01 Mon>--[2023-12-31 Tue]