mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-21 17:48:31 +00:00
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]
This commit is contained in:
parent
a73ce76fe3
commit
cb23060a46
|
@ -554,7 +554,7 @@ publishing directory."
|
||||||
table-buffer table-orig-buffer
|
table-buffer table-orig-buffer
|
||||||
ind item-type starter
|
ind item-type starter
|
||||||
rpl path attr caption label desc descp desc1 desc2 link
|
rpl path attr caption label desc descp desc1 desc2 link
|
||||||
fnc item-tag initial-number
|
fnc item-tag item-number
|
||||||
footref-seen footnote-list
|
footref-seen footnote-list
|
||||||
id-file
|
id-file
|
||||||
)
|
)
|
||||||
|
@ -1023,9 +1023,9 @@ publishing directory."
|
||||||
(substring (match-string 2 line) 0 -1))
|
(substring (match-string 2 line) 0 -1))
|
||||||
line (substring line (match-beginning 5))
|
line (substring line (match-beginning 5))
|
||||||
item-tag nil
|
item-tag nil
|
||||||
initial-number nil)
|
item-number nil)
|
||||||
(if (string-match "\\`\\[@start:\\([0-9]+\\)\\][ \t]?" line)
|
(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)))
|
line (replace-match "" t t line)))
|
||||||
(if (and starter (string-match "\\(.*?\\) ::[ \t]*" line))
|
(if (and starter (string-match "\\(.*?\\) ::[ \t]*" line))
|
||||||
(setq item-type "d"
|
(setq item-type "d"
|
||||||
|
@ -1055,7 +1055,7 @@ publishing directory."
|
||||||
(org-export-docbook-close-para-maybe)
|
(org-export-docbook-close-para-maybe)
|
||||||
(insert (cond
|
(insert (cond
|
||||||
((equal item-type "u") "<itemizedlist>\n<listitem>\n")
|
((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
|
;; Check for a specific start number. If it
|
||||||
;; is specified, we use the ``override''
|
;; is specified, we use the ``override''
|
||||||
;; attribute of element <listitem> to pass the
|
;; attribute of element <listitem> to pass the
|
||||||
|
@ -1063,10 +1063,8 @@ publishing directory."
|
||||||
;; ``startingnumber'' attribute of element
|
;; ``startingnumber'' attribute of element
|
||||||
;; <orderedlist>, but the former works on both
|
;; <orderedlist>, but the former works on both
|
||||||
;; DocBook 5.0 and prior versions.
|
;; DocBook 5.0 and prior versions.
|
||||||
(if initial-number
|
(format "<orderedlist>\n<listitem override=\"%s\">\n" item-number))
|
||||||
(format "<orderedlist>\n<listitem override=\"%s\">\n"
|
((equal item-type "o") "<orderedlist>\n<listitem>\n")
|
||||||
initial-number)
|
|
||||||
"<orderedlist>\n<listitem>\n"))
|
|
||||||
((equal item-type "d")
|
((equal item-type "d")
|
||||||
(format "<variablelist>\n<varlistentry><term>%s</term><listitem>\n" item-tag))))
|
(format "<variablelist>\n<varlistentry><term>%s</term><listitem>\n" item-tag))))
|
||||||
;; For DocBook, we need to open a para right after tag
|
;; For DocBook, we need to open a para right after tag
|
||||||
|
@ -1080,6 +1078,8 @@ publishing directory."
|
||||||
(let ((listtype (car local-list-type)))
|
(let ((listtype (car local-list-type)))
|
||||||
(org-export-docbook-close-li listtype)
|
(org-export-docbook-close-li listtype)
|
||||||
(insert (cond
|
(insert (cond
|
||||||
|
((and (equal listtype "o") item-number)
|
||||||
|
(format "<listitem override=\"%s\">" item-number))
|
||||||
((equal listtype "o") "<listitem>")
|
((equal listtype "o") "<listitem>")
|
||||||
((equal listtype "u") "<listitem>")
|
((equal listtype "u") "<listitem>")
|
||||||
((equal listtype "d") (format
|
((equal listtype "d") (format
|
||||||
|
|
|
@ -962,7 +962,7 @@ PUB-DIR is set, use this as the publishing directory."
|
||||||
table-buffer table-orig-buffer
|
table-buffer table-orig-buffer
|
||||||
ind item-type starter
|
ind item-type starter
|
||||||
rpl path attr desc descp desc1 desc2 link
|
rpl path attr desc descp desc1 desc2 link
|
||||||
snumber fnc item-tag initial-number
|
snumber fnc item-tag item-number
|
||||||
footnotes footref-seen
|
footnotes footref-seen
|
||||||
id-file href
|
id-file href
|
||||||
)
|
)
|
||||||
|
@ -1546,10 +1546,10 @@ lang=\"%s\" xml:lang=\"%s\">
|
||||||
starter (if (match-beginning 2)
|
starter (if (match-beginning 2)
|
||||||
(substring (match-string 2 line) 0 -1))
|
(substring (match-string 2 line) 0 -1))
|
||||||
line (substring line (match-beginning 5))
|
line (substring line (match-beginning 5))
|
||||||
initial-number nil
|
item-number nil
|
||||||
item-tag nil)
|
item-tag nil)
|
||||||
(if (string-match "\\`\\[@start:\\([0-9]+\\)\\][ \t]?" line)
|
(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)))
|
line (replace-match "" t t line)))
|
||||||
(if (and starter (string-match "\\(.*?\\) ::[ \t]*" line))
|
(if (and starter (string-match "\\(.*?\\) ::[ \t]*" line))
|
||||||
(setq item-type "d"
|
(setq item-type "d"
|
||||||
|
@ -1571,15 +1571,13 @@ lang=\"%s\" xml:lang=\"%s\">
|
||||||
((and starter
|
((and starter
|
||||||
(or (not in-local-list)
|
(or (not in-local-list)
|
||||||
(> ind (car local-list-indent))))
|
(> ind (car local-list-indent))))
|
||||||
;; check for a specified start number
|
|
||||||
;; Start new (level of) list
|
;; Start new (level of) list
|
||||||
(org-close-par-maybe)
|
(org-close-par-maybe)
|
||||||
(insert (cond
|
(insert (cond
|
||||||
((equal item-type "u") "<ul>\n<li>\n")
|
((equal item-type "u") "<ul>\n<li>\n")
|
||||||
((equal item-type "o")
|
((and (equal item-type "o") item-number)
|
||||||
(if initial-number
|
(format "<ol>\n<li value=\"%s\">\n" item-number))
|
||||||
(format "<ol start=%s>\n<li>\n" initial-number)
|
((equal item-type "o") "<ol>\n<li>\n")
|
||||||
"<ol>\n<li>\n"))
|
|
||||||
((equal item-type "d")
|
((equal item-type "d")
|
||||||
(format "<dl>\n<dt>%s</dt><dd>\n" item-tag))))
|
(format "<dl>\n<dt>%s</dt><dd>\n" item-tag))))
|
||||||
(push item-type local-list-type)
|
(push item-type local-list-type)
|
||||||
|
@ -1591,6 +1589,8 @@ lang=\"%s\" xml:lang=\"%s\">
|
||||||
(insert (cond
|
(insert (cond
|
||||||
((equal (car local-list-type) "d")
|
((equal (car local-list-type) "d")
|
||||||
(format "<dt>%s</dt><dd>\n" (or item-tag "???")))
|
(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")))))
|
(t "<li>\n")))))
|
||||||
(if (string-match "^[ \t]*\\[\\([X ]\\)\\]" line)
|
(if (string-match "^[ \t]*\\[\\([X ]\\)\\]" line)
|
||||||
(setq line
|
(setq line
|
||||||
|
|
Loading…
Reference in a new issue