org_reader.el 531 B

12345678910111213
  1. (require 'org)
  2. (defun org->pelican (filename backend)
  3. (progn
  4. (save-excursion
  5. (find-file filename)
  6. (let ((properties (org-export-get-environment)))
  7. (princ (json-encode
  8. (list
  9. :date (org-timestamp-format (car (plist-get properties :date)) "%Y-%m-%d")
  10. :category (cdr (assoc "CATEGORY" org-file-properties))
  11. :post (org-export-as backend nil nil t)
  12. :title (substring-no-properties (car (plist-get properties :title))))))))))