# HG changeset patch # User ellis # Date 1700524967 18000 # Node ID d0daa407ec1356fc99ae1a0c8b4eaad88edbd068 # Parent 15ed6871ad0865aaa7ead8d9b7e3471d382c31fc org publishing diff -r 15ed6871ad08 -r d0daa407ec13 .hgsub --- a/.hgsub Sun Nov 19 22:13:06 2023 -0500 +++ b/.hgsub Mon Nov 20 19:02:47 2023 -0500 @@ -1,3 +1,2 @@ blog=https://lab.rwest.io/comp/blog -docs=https://lab.rwest.io/comp/docs -web=https://lab.rwest.io/comp/web \ No newline at end of file +docs=https://lab.rwest.io/comp/docs \ No newline at end of file diff -r 15ed6871ad08 -r d0daa407ec13 .hgsubstate --- a/.hgsubstate Sun Nov 19 22:13:06 2023 -0500 +++ b/.hgsubstate Mon Nov 20 19:02:47 2023 -0500 @@ -1,3 +1,2 @@ -9f4fb0ad27313a7ff7aec8cc92c640434d1e7b99 blog -bd85a72319d85b4cc4d96df2459a6c500ec26271 docs -c87ea7510f8c9b5538714c83d3adb4e0c1d8a301 web +6b286d6cf099069357b01b6cf2386ed990572259 blog +1c57e053f043e7f164e18edda6edfc235662cadb docs diff -r 15ed6871ad08 -r d0daa407ec13 pitch.org --- a/pitch.org Sun Nov 19 22:13:06 2023 -0500 +++ b/pitch.org Mon Nov 20 19:02:47 2023 -0500 @@ -0,0 +1,5 @@ +#+AUTHOR: Richard Westhaver +#+OPTIONS: ^:nil toc:nil num:nil html-postamble:nil +#+HTML_HEAD: +#+HTML_HEAD: +#+HTML_HEAD: diff -r 15ed6871ad08 -r d0daa407ec13 publish.el --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/publish.el Mon Nov 20 19:02:47 2023 -0500 @@ -0,0 +1,97 @@ +;;; publish.el --- the.compiler.company publishing script -*- lexical-binding: t; -*- + +;;; Code: +(require 'ox-publish) +(require 'org-id) +;; vendored +(require 'htmlize) +(defvar project-dir "~/dev/comp/org") +(defvar publish-dir "/mnt/w/compiler.company") +(defvar html-theme nil) +(defvar url "https://compiler.company") +(defvar html-nav "
~/ ( blog docs code )
") + +(defvar html-foot "
updated %C
") + +(setq org-html-style-default "" + org-html-scripts "" + org-html-htmlize-output-type 'css + org-export-htmlize-output-type 'css + org-html-doctype "html5" + org-html-html5-fancy t + org-html-validation-link nil + org-src-fontify-natively t + make-backup-files nil + debug-on-error t) + +(setq org-publish-project-alist + `(("compiler.company" :components ("index" "blog" "docs")) + ("index" + :base-directory ,project-dir + :base-extension "org" + :recursive nil + :htmlized-source t + :html-preamble ,html-nav + :publishing-directory ,publish-dir + :publishing-function org-html-publish-to-html + :html-postamble ,html-foot) + ("blog" + :base-directory ,(expand-file-name "blog" project-dir) + :base-extension "org" + :publishing-directory ,(expand-file-name "blog" publish-dir) + :publishing-function org-html-publish-to-html + :htmlized-source t + :html-preamble ,html-nav + :html-postamble ,html-foot) + ("docs" + :base-directory ,(expand-file-name "docs" project-dir) + :base-extension "org" + :recursive t + :publishing-directory ,(expand-file-name "docs" publish-dir) + :publishing-function org-html-publish-to-html + :htmlized-source t + :html-preamble ,html-nav + :html-postamble ,html-foot))) + +(defun org-custom-id-get (&optional pom create prefix) + "Get the CUSTOM_ID property of the entry at point-or-marker POM. + If POM is nil, refer to the entry at point. If the entry does + not have an CUSTOM_ID, the function returns nil. However, when + CREATE is non nil, create a CUSTOM_ID if none is present + already. PREFIX will be passed through to `org-id-new'. In any + case, the CUSTOM_ID of the entry is returned." + (interactive) +(org-with-point-at pom + (let ((id (org-entry-get nil "CUSTOM_ID")) + ;; use CUSTOM_ID for links + (org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id)) + (cond + ((and id (stringp id) (string-match "\\S-" id)) + id) + (create + (setq id (org-id-new prefix)) + (org-entry-put pom "CUSTOM_ID" id) + (org-id-add-location id (buffer-file-name (buffer-base-buffer))) + id))))) +;;;###autoload +(defun org-id-add-to-headlines-in-file () + "Add CUSTOM_ID properties to all headlines in the + current file which do not already have one." + (interactive) + (org-map-entries (lambda () (org-custom-id-get (point) 'create)))) + +;;;###autoload +(defun publish (&optional sitemap static force async) + "publish `rwest-io' content. +If STATIC is t, also publish media and static files. +If FORCE is t, skip checking file mod date and just publish all files. +If ASYNC is t, call `org-publish' asynchronously. +If given a prefix (C-u), set all args to t" + (interactive) + (if current-prefix-arg + (setq static t + force t + async t)) + (let ((default-directory project-dir)) + (message (format "publishing from %s" default-directory)) + (org-publish "compiler.company" force async))) diff -r 15ed6871ad08 -r d0daa407ec13 readme.org --- a/readme.org Sun Nov 19 22:13:06 2023 -0500 +++ b/readme.org Mon Nov 20 19:02:47 2023 -0500 @@ -1,15 +1,17 @@ -#+TITLE: comp/org +#+TITLE: The Compiler Company #+AUTHOR: Richard Westhaver -Welcome to /The Compiler Company/. +#+OPTIONS: ^:nil toc:nil num:nil html-postamble:nil +#+HTML_HEAD: +#+HTML_HEAD: +#+HTML_HEAD: +#+EXPORT_FILE_NAME: index +Welcome stranger. |[[https://lab.rwest.io/comp.atom][vc.feed]]| -* [[file:blog/][blog]] - -* [[file:docs/][docs]] +- [[file:blog][blog]] + - [2023-11-19 Sun] [[https://compiler.company/blog/hello-world][hello-world]] -* [[file:scratch/][scratch]] - -* [[file:pitch.org][pitch]] - -* [[file:roadmap.org][roadmap]] +- [[file:docs][docs]] +- [[file:roadmap.org][roadmap]] +- [[file:pitch.org][pitch]] diff -r 15ed6871ad08 -r d0daa407ec13 roadmap.org --- a/roadmap.org Sun Nov 19 22:13:06 2023 -0500 +++ b/roadmap.org Mon Nov 20 19:02:47 2023 -0500 @@ -1,6 +1,10 @@ #+TITLE: roadmap #+AUTHOR: Richard Westhaver #+EMAIL: ellis@rwest.io +#+OPTIONS: ^:nil toc:nil num:nil +#+HTML_HEAD: +#+HTML_HEAD: +#+HTML_HEAD: * WIP 2023 SCHEDULED: <2023-01-01 Mon>--[2023-12-31 Tue]