From a4e04f954b8c3f76002bbd4f36784b4e1d7d5fef Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 23 Mar 2014 19:44:35 -0400 Subject: [PATCH] update doc for org 8.x Keeping compabitily with 7.9 for now --- doc/org-setup.inc | 2 ++ doc/yas-doc-helper.el | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/doc/org-setup.inc b/doc/org-setup.inc index 98f7c04a7..6ad09c933 100644 --- a/doc/org-setup.inc +++ b/doc/org-setup.inc @@ -6,4 +6,6 @@ #+OPTIONS: author:nil num:nil #+AUTHOR: +# org < 8.0 use +STYLE, after use +HTML_HEAD #+STYLE: +#+HTML_HEAD: diff --git a/doc/yas-doc-helper.el b/doc/yas-doc-helper.el index 925e41bee..f6e101c79 100755 --- a/doc/yas-doc-helper.el +++ b/doc/yas-doc-helper.el @@ -27,9 +27,18 @@ (eval-when-compile (require 'cl)) (require 'org) -(require 'org-publish) +(or (require 'org-publish nil t) + (require 'ox-publish)) (require 'yasnippet) ; docstrings must be loaded +(defun yas--org-raw-html (tag content) + ;; in version 8.0 org-mode changed the export syntax, see + ;; http://orgmode.org/worg/org-8.0.html#sec-8-1 + (format (if (version< org-version "8.0.0") + "@<%s>%s@" ; old: @ + "@@html:<%s>@@%s@@html:@@") ; new: @@html:@@ + tag content tag)) + (defun yas--document-symbol (symbol level) (flet ((concat-lines (&rest lines) (mapconcat #'identity lines "\n"))) @@ -71,7 +80,8 @@ (prefix (downcase match1)) (suffix (match-string 2 match)) (fmt (cond - ((member prefix args) "@%s@") + ((member prefix args) + (yas--org-raw-html "code" "%s")) ((null suffix) "/%s/")))) (if fmt (format fmt prefix) match1))) @@ -125,6 +135,7 @@ (princ yas--version (current-buffer))))) (proj-plist (list + :publishing-function 'org-html-publish-to-html :base-directory dir :publishing-directory dir :html-preamble (with-temp-buffer -- 2.39.2