Mercurial > core / lisp/lib/organ/document.lisp
changeset 490: |
7a7e6c273f52 |
parent: |
609931bd65ba
|
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Sun, 30 Jun 2024 17:54:33 -0400 |
permissions: |
-rw-r--r-- |
description: |
skel component updates |
1 ;;; lib/organ/document.lisp --- Org Document API 8 (defclass org-document () 9 ((meta :initform nil :initarg :meta :type (or null org-zeroth-section) :accessor doc-meta) 10 (tree :initform nil :initarg :tree :type (or (vector org-heading) null) :accessor doc-tree))) 12 (defmethod org-create ((type (eql :document)) &rest initargs) 13 (apply #'make-instance (sym-to-org-class-name type) initargs)) 15 (defmethod org-parse ((type (eql :document)) (input pathname)) 16 (if (probe-file input) 17 (let ((res (org-create type))) 18 (with-open-file (fstream input) 20 (org-parse :meta fstream)) 23 (loop for c = (peek-char nil fstream nil nil) 25 collect (org-parse :heading fstream)) 26 '(vector org-heading)))) 28 (org-file-missing input)))