From mboxrd@z Thu Jan 1 00:00:00 1970 From: "D. C. Toedt" Subject: Configurable prefixes for heading-tree numbering in HTML export? ($) Date: Thu, 28 Jul 2016 09:15:19 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113ced32e1ac550538b2c5d5 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34972) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSm6U-0003Re-KW for emacs-orgmode@gnu.org; Thu, 28 Jul 2016 10:16:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSm6S-0003JR-FS for emacs-orgmode@gnu.org; Thu, 28 Jul 2016 10:16:02 -0400 Received: from mail-oi0-x22a.google.com ([2607:f8b0:4003:c06::22a]:34858) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSm6S-0003J9-5K for emacs-orgmode@gnu.org; Thu, 28 Jul 2016 10:16:00 -0400 Received: by mail-oi0-x22a.google.com with SMTP id l72so64750842oig.2 for ; Thu, 28 Jul 2016 07:15:59 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --001a113ced32e1ac550538b2c5d5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable So far as I can tell, org-mode currently allows heading numbering in only one style (1, 1.1, 1.1.1, etc.). For HTML export, I'm interested in having the heading numbering be configurable on a per-subtree basis, along something like the following lines for a hypothetical consulting-agreement contract (indentation is for convenient reading only). This is for my Com= mon Draft contract terms and conditions project --- I'd like to be able to arrange the trees in an arbitrary order and have the top-level headings start with prefixes and heading numbers instead of heading numbers alone. This can be done in a very kludgy fashion with CSS (see below), but doing it in org-mode would be far preferable for several reasons. I'd be happy to pay an honorarium, or make a donation, of USD$100-$200 for the appropriate elisp code that I could include in the relevant file(s). I'd want the elisp code to be open-sourced, and at least minimal documentation, so that it could be made a candidate for possible inclusion in a future org-mode release. Here's an example of the desired org-mode code: =3D=3D=3DBEGIN=3D=3D=3D * Services :PROPERTIES: :CUSTOM_ID: SVC :CUSTOM_PREFIX: t :END: # =3D=3D=3D=3D=3D=3D=3D=3D NOTE THE :CUSTOM_PREFIX: property above =3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D # ** Statements of Work [properties and text omitted] *** Written Statements of Work Required [properties and text omitted] # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D AN ARBITRARY NUMBER OF SUBHEADING LEVEL= S BENEATH THE TOP LEVEL =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # *** Changes Must Be in Writing [properties and text omitted] ** Billing Rates [properties and text omitted] ** IP Ownership [properties and text omitted] * General Provisions :PROPERTIES: :CUSTOM_ID: GP :CUSTOM_PREFIX: t :END: ** Amendments [properties and text omitted] ** Notices [properties and text omitted] =3D=3D=3DEND=3D=3D=3D I'd like for the resulting HTML export to be something like the following: SVC Services # =3D=3D=3D=3D=3D=3D=3D=3D NOTE THAT THERE'S NO HEADING /NUMBER/ FOR THE TO= P-LEVEL HEADING, JUST THE PREFIX =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # SVC-1 Statements of Work [properties and text omitted] # =3D=3D=3D=3D=3D=3D=3D=3D PREFERABLY THE SEPARATOR IN "SVC-1" COULD BE CON= FIGURED AS A HYPHEN, A PERIOD, A COLON, A FORWARD SLASH, ETC. =3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D # SVC-1.1 Written Statements of Work Required [properties and text omitted] SVC-1.2 Changes Must Be in Writing [properties and text omitted] SVC-2 Billing Rates [properties and text omitted] SVC-3 IP Ownership [properties and text omitted] GP General Provisions GP-1 Amendments [properties and text omitted] GP-2 Notices [properties and text omitted] I've played with doing this in CSS --- a suboptimal solution would be to: 1. set the :UNNUMBERED: property to non-nil 2. define separate CSS div classes for each top-level heading (e.g., SVC and GP in the examples above) 3. for each top-level heading in question: 1. use the :HTML_CONTAINER_CLASS: property to specify the div class for that top-level heading 2. for each subheading level in that div class, use the psuedo-element ":before" to add the appropriate prefix and counter Apart from being kludgy, doing it this way (in CSS) would eliminate org-mode's ability to produce automatic cross-referencing during export. Also, the heading numbers wouldn't transfer over when copying and pasting from HTML to a Word document, which is an important user feature. In case it matters, I run the 2016-07-25 release of org-mode on Emacs 25.1.50 (9.0) with the most recent update of Mac OS X El Capitan. I know a little about elisp and have cobbled together a few simple functions for my own use, but I'm far from being even minimally competent at it. Any ideas for an org-mode elisp solution? =E2=80=8BThanks in advance, --D. C. D. C. Toedt III *(My last name is pronounced "Tate")* Attorney & arbitrator -- tech contracts & IP O: +1 (713) 364-6545 C: +1 (713) 516-8968 =E2=80=8B=E2=80=8B dc@toedt.com @dctoedt =E2=80=8B Skype: dctoedt =E2=80=8B www.OnContracts.com/About =E2=80=8B=E2=80=8B Unless expressly stated otherwise, this message is not intended to serve as assent to an agreement or other document, even if attached to this message. --001a113ced32e1ac550538b2c5d5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


=3D=3D=3DBEGIN=3D= =3D=3D




=
*** Changes Must Be i= n Writing
[properties and text omitted]

<= blockquote style=3D"color:rgb(34,34,34);font-family:arial,sans-serif;margin= :0px 0px 0px 40px;border:none;padding:0px">

** Billing R= ates
[properties and text om= itted]

** IP Ownership
[properties and text omitted]

* Gen= eral Provisions
=C2=A0 :PROPERTIES:
<= div class=3D"gmail_default">=C2=A0 :CUSTOM_ID: GP
=C2=A0=C2=A0:CUSTOM_PREFIX: t
<= div class=3D"gmail_default">=C2=A0 :END:

** Amendments
[properties and text omitted]

** Notices
[properties and = text omitted]

=3D=3D=3DEND=3D=3D=3D

I'd like for the resulting HT= ML export to be something like the following:

=
=
<= div title=3D"signature">
SVC Services
# =3D= =3D=3D=3D=3D=3D=3D=3D NOTE THAT THERE'S NO HEADING /NUMBER/ FOR THE TOP= -LEVEL HEADING, JUST THE PREFIX =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D #

SVC-1 Sta= tements of Work
[properties and text omitted]

# =3D=3D=3D=3D=3D=3D=3D=3D PREFERABLY THE SEPARATOR IN "SVC-1&quo= t; COULD BE CONFIGURED AS A HYPHEN, A PERIOD, A COLON, A FORWARD SLASH, ETC= . =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D #

SVC-1.1 =C2=A0Writt= en Statements of Work Required
[properties and text omitted]<= /div>

=
SVC-1.2 =C2=A0Changes = Must Be in Writing
[properties and text omitted]
<= /div>

=
SVC-2 Billing Rates
<= /blockquote>
[proper= ties and text omitted]

<= div title=3D"signature">
SVC-3 IP Ownership
[properties and text omitted]
<= /div>
=

<= /div>
GP General P= rovisions
GP-1 Amendment= s
[properties and tex= t omitted]
<= div title=3D"signature">

GP-2 Notices
[properties and text omitte= d]


I've play= ed with doing this in CSS --- a suboptimal solution would be to:
  1. set the :UNNUMBERED: property to non-nil
  2. define separate CSS div classes for each top-level = heading (e.g., SVC and GP in the examples above)=C2=A0
  3. for each top-level heading in question:
    1. use the :HTML_CONTAINER_CLASS: property to specify the div class for= that top-level heading
    2. for each subheading le= vel in that div class, use the psuedo-element ":before" to add th= e appropriate prefix and counter
Apart f= rom being kludgy, doing it this way (in CSS) would eliminate org-mode's= ability to produce automatic cross-referencing during export.=C2=A0 Also, = the heading numbers wouldn't transfer over when copying and pasting fro= m HTML to a Word document, which is an important user feature.

In case it matters, I run the 2016-07-25 release of org-mode on= Emacs 25.1.50 (9.0) with the most recent update of Mac OS X El Capitan.=C2= =A0 I know a little about elisp and have cobbled together a few simple func= tions for my own use, but I'm far from being even minimally competent a= t it.

<= div style=3D"color:rgb(0,0,0);font-family:arial,helvetica,sans-serif;font-s= ize:12.8px">Any ideas for an org-mode elis= p solution?

--001a113ced32e1ac550538b2c5d5--