浏览代码

Wrote record formatter

Samuel W. Flint 8 年之前
父节点
当前提交
f132f69dde
共有 1 个文件被更改,包括 14 次插入0 次删除
  1. 14 0
      cl-genealogy.org

+ 14 - 0
cl-genealogy.org

@@ -377,6 +377,20 @@ As LambdaLite is schemaless, the following attributes can be mixed in to other t
 :CREATED:  <2016-01-06 Wed 14:35>
 :END:
 
+#+Caption: Format Ahnentafel Record
+#+Name: format-ahnentafel-record
+#+BEGIN_SRC lisp
+  (defun format-ahnentafel-record (record)
+    (destructuring-bind (number . person) record
+      (let ((name (:/person-name (get-person person)))
+            (birthdate (:/birth-date (get-birth person)))
+            (death (let ((death-record (get-death person)))
+                     (if (null death-record)
+                         ""
+                         (format nil " -- ~a" (:/death-date death-record))))))
+        (format nil "~10,5R: ~A, ~A~A" number name birthdate death)))))
+#+END_SRC
+
 ** TODO Final Output
 :PROPERTIES:
 :CREATED:  <2016-01-06 Wed 14:35>