From mboxrd@z Thu Jan 1 00:00:00 1970 From: Baoqiu Cui Subject: Re: Renumber HTML ordered lists from org-mode? Date: Mon, 26 Apr 2010 14:39:12 -0700 Message-ID: References: <20100210181430.00000bdb@unknown> <8BD3FCFE-364D-4774-A20C-9502FD313C86@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O6W1c-00061u-Il for emacs-orgmode@gnu.org; Mon, 26 Apr 2010 17:39:32 -0400 Received: from [140.186.70.92] (port=56536 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6W1a-00061G-TK for emacs-orgmode@gnu.org; Mon, 26 Apr 2010 17:39:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O6W1Z-0001oX-Tt for emacs-orgmode@gnu.org; Mon, 26 Apr 2010 17:39:30 -0400 Received: from lo.gmane.org ([80.91.229.12]:43080) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O6W1Z-0001oO-Ir for emacs-orgmode@gnu.org; Mon, 26 Apr 2010 17:39:29 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1O6W1V-0000EO-PY for emacs-orgmode@gnu.org; Mon, 26 Apr 2010 23:39:25 +0200 Received: from nat-dip6.cfw-a-gci.corp.yahoo.com ([209.131.62.115]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 26 Apr 2010 23:39:25 +0200 Received: from cbaoqiu by nat-dip6.cfw-a-gci.corp.yahoo.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 26 Apr 2010 23:39:25 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Cc: carsten.dominik@gmail.com --=-=-= Hi Carsten, Attached please find the patch to support this new feature in the DocBook exporter: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=orderedlist-startingnumber.diff diff --git a/lisp/org-docbook.el b/lisp/org-docbook.el index bb8d048..d7ea4b7 100644 --- a/lisp/org-docbook.el +++ b/lisp/org-docbook.el @@ -533,7 +533,7 @@ publishing directory." table-buffer table-orig-buffer ind item-type starter didclose rpl path attr caption label desc descp desc1 desc2 link - fnc item-tag + fnc item-tag initial-number footref-seen footnote-list id-file ) @@ -998,7 +998,11 @@ publishing directory." starter (if (match-beginning 2) (substring (match-string 2 line) 0 -1)) line (substring line (match-beginning 5)) - item-tag nil) + item-tag nil + initial-number nil) + (if (string-match "\\`\\[@start:\\([0-9]+\\)\\][ \t]?" line) + (setq initial-number (match-string 1 line) + line (replace-match "" t t line))) (if (and starter (string-match "\\(.*?\\) ::[ \t]*" line)) (setq item-type "d" item-tag (match-string 1 line) @@ -1031,7 +1035,18 @@ publishing directory." (org-export-docbook-close-para-maybe) (insert (cond ((equal item-type "u") "\n\n") - ((equal item-type "o") "\n\n") + ((equal item-type "o") + ;; Check for a specific start number. If it + ;; is specified, we use the ``override'' + ;; attribute of element to pass the + ;; info to DocBook. We could also use the + ;; ``startingnumber'' attribute of element + ;; , but the former works on both + ;; DocBook 5.0 and prior versions. + (if initial-number + (format "\n\n" + initial-number) + "\n\n")) ((equal item-type "d") (format "\n%s\n" item-tag)))) ;; For DocBook, we need to open a para right after tag --=-=-= Carsten Dominik writes: > On Feb 11, 2010, at 12:14 AM, Uriel Avalos wrote: > >> In HTML, one way of renumbering OL lists is to use "start". (Ex:
    > start=13>...
restarts the numbering at 13.) >> >> Is there anyway to do that from within org-mode without hacking the >> exported HTML file? >> >> Is there a +ATTR_HTML: planned for OL and UL lists? > > This has taken a long time. I have not done an ATTR_, but you > can now write > > 1. [@start:20] item number 20 > > to have a list start at 20. > > Currently this works in Org-mode itself to change the list with > a different counter, and for the HTML, LaTeX, and ASCII > exporters. I hope that it can also be translated for the docbook > exporter. Thanks, -- Baoqiu --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--