diff options
author | Nicolas Goaziou <n.goaziou@gmail.com> | 2010-07-28 19:24:46 +0200 |
---|---|---|
committer | Nicolas Goaziou <n.goaziou@gmail.com> | 2010-09-01 19:05:51 +0200 |
commit | cb23060a460a7474f0762ef3d56dc7ad151879cc (patch) | |
tree | 84990eef8229d4fe9e40777ab9ee55e9e00c7dee | |
parent | a73ce76fe378f07cee27a05a5f7a51977d7b0500 (diff) | |
download | org-mode-cb23060a460a7474f0762ef3d56dc7ad151879cc.tar.gz |
HTML and DocBook exporters handle multiple uses of [@start:?].
* org-docbook.el (org-export-as-docbook): Use override="num" in any
listitem matching [@start:num]
* org-html.el (org-export-as-html): Use value="num" in any li matching
[@start:num]
-rw-r--r-- | lisp/org-docbook.el | 16 | ||||
-rw-r--r-- | lisp/org-html.el | 16 |
2 files changed, 16 insertions, 16 deletions
diff --git a/lisp/org-docbook.el b/lisp/org-docbook.el index ab2dfd6..d90d949 100644 --- a/lisp/org-docbook.el +++ b/lisp/org-docbook.el @@ -554,7 +554,7 @@ publishing directory." table-buffer table-orig-buffer ind item-type starter rpl path attr caption label desc descp desc1 desc2 link - fnc item-tag initial-number + fnc item-tag item-number footref-seen footnote-list id-file ) @@ -1023,9 +1023,9 @@ publishing directory." (substring (match-string 2 line) 0 -1)) line (substring line (match-beginning 5)) item-tag nil - initial-number nil) + item-number nil) (if (string-match "\\`\\[@start:\\([0-9]+\\)\\][ \t]?" line) - (setq initial-number (match-string 1 line) + (setq item-number (match-string 1 line) line (replace-match "" t t line))) (if (and starter (string-match "\\(.*?\\) ::[ \t]*" line)) (setq item-type "d" @@ -1055,7 +1055,7 @@ publishing directory." (org-export-docbook-close-para-maybe) (insert (cond ((equal item-type "u") "<itemizedlist>\n<listitem>\n") - ((equal item-type "o") + ((and (equal item-type "o") item-number) ;; Check for a specific start number. If it ;; is specified, we use the ``override'' ;; attribute of element <listitem> to pass the @@ -1063,10 +1063,8 @@ publishing directory." ;; ``startingnumber'' attribute of element ;; <orderedlist>, but the former works on both ;; DocBook 5.0 and prior versions. - (if initial-number - (format "<orderedlist>\n<listitem override=\"%s\">\n" - initial-number) - "<orderedlist>\n<listitem>\n")) + (format "<orderedlist>\n<listitem override=\"%s\">\n" item-number)) + ((equal item-type "o") "<orderedlist>\n<listitem>\n") ((equal item-type "d") (format "<variablelist>\n<varlistentry><term>%s</term><listitem>\n" item-tag)))) ;; For DocBook, we need to open a para right after tag @@ -1080,6 +1078,8 @@ publishing directory." (let ((listtype (car local-list-type))) (org-export-docbook-close-li listtype) (insert (cond + ((and (equal listtype "o") item-number) + (format "<listitem override=\"%s\">" item-number)) ((equal listtype "o") "<listitem>") ((equal listtype "u") "<listitem>") ((equal listtype "d") (format diff --git a/lisp/org-html.el b/lisp/org-html.el index 60b4b96..1a5c5eb 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -962,7 +962,7 @@ PUB-DIR is set, use this as the publishing directory." table-buffer table-orig-buffer ind item-type starter rpl path attr desc descp desc1 desc2 link - snumber fnc item-tag initial-number + snumber fnc item-tag item-number footnotes footref-seen id-file href ) @@ -1546,10 +1546,10 @@ lang=\"%s\" xml:lang=\"%s\"> starter (if (match-beginning 2) (substring (match-string 2 line) 0 -1)) line (substring line (match-beginning 5)) - initial-number nil + item-number nil item-tag nil) (if (string-match "\\`\\[@start:\\([0-9]+\\)\\][ \t]?" line) - (setq initial-number (match-string 1 line) + (setq item-number (match-string 1 line) line (replace-match "" t t line))) (if (and starter (string-match "\\(.*?\\) ::[ \t]*" line)) (setq item-type "d" @@ -1571,15 +1571,13 @@ lang=\"%s\" xml:lang=\"%s\"> ((and starter (or (not in-local-list) (> ind (car local-list-indent)))) - ;; check for a specified start number ;; Start new (level of) list (org-close-par-maybe) (insert (cond ((equal item-type "u") "<ul>\n<li>\n") - ((equal item-type "o") - (if initial-number - (format "<ol start=%s>\n<li>\n" initial-number) - "<ol>\n<li>\n")) + ((and (equal item-type "o") item-number) + (format "<ol>\n<li value=\"%s\">\n" item-number)) + ((equal item-type "o") "<ol>\n<li>\n") ((equal item-type "d") (format "<dl>\n<dt>%s</dt><dd>\n" item-tag)))) (push item-type local-list-type) @@ -1591,6 +1589,8 @@ lang=\"%s\" xml:lang=\"%s\"> (insert (cond ((equal (car local-list-type) "d") (format "<dt>%s</dt><dd>\n" (or item-tag "???"))) + ((and (equal item-type "o") item-number) + (format "<li value=\"%s\">\n" item-number)) (t "<li>\n"))))) (if (string-match "^[ \t]*\\[\\([X ]\\)\\]" line) (setq line |