;;; seam-export.el --- Seam HTML exporter -*- lexical-binding: t -*- ;; Copyright (C) 2025 Spencer Williams ;; Author: Spencer Williams ;; SPDX-License-Identifier: GPL-3.0-or-later ;; This file is not part of GNU Emacs. ;; This program is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . ;;; Commentary: ;; Frontend for Seam's HTML exporter. ;;; Code: (require 'cl-lib) (require 'seam-html) (defvar seam-export--types nil) (defvar seam-export--template nil) (defvar seam-export--root-path nil) (defvar seam-export--no-extension nil) (defvar seam-export--internal-link-class nil) (defvar seam-export--options nil) (defgroup seam-export nil "Options for Seam exporter." :tag "Seam Export" :group 'seam) (defcustom seam-export-alist nil "Association list used by Seam to determine how to export notes. The car of each element is an HTML directory to which Seam will export a subset of notes. The cdr is a plist containing any number of these properties: `:types' List of note types to export to this directory. Required. `:template-file' The HTML template file to be used by the exporter. If this is missing, falls back to :template-string, `seam-export-template-file', or `seam-export-template-string' in that order. `:template-string' The HTML template string to be used by the exporter. If this is missing, falls back to :template-file, `seam-export-template-file', or `seam-export-template-string' in that order. `:root-path' The root path used for rendering internal links. Defaults to \"\", which means all paths are relative. `:no-extension' Whether to drop the \".html\" file extension in links. Defaults to nil. `:internal-link-class' CSS class name for internal links. Defaults to the value of `seam-export-internal-link-class'. `:backend-options' A plist of extra options passed to the Org HTML backend. This can be used to override any of the defaults set in `seam-export-backend-options'." :group 'seam-export :type '(alist :key-type string :value-type plist)) (defcustom seam-export-template-file nil "The HTML template file to be used by the exporter. The template format is documented at `seam-export-default-template-string'. See `seam-export-alist' for more information about specifying templates." :group 'seam-export :type '(choice file (const nil))) (defvar seam-export-default-template-string " {{title}}

{{title}}

Last modified:

{{contents}}

Backlinks

{{backlinks}}
" "The default HTML template string if no other template is specified. It should be plain HTML5. Several variables are defined which can be interpolated using the {{variable}} syntax: `contents' The full HTML contents of the note, sans the title header. `title' The note's title (HTML-escaped). `backlinks' A list (