emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "D. C. Toedt" <dc@toedt.com>
To: emacs-orgmode@gnu.org
Subject: Include heading title in HTML section-number cross-reference, like LaTex \nameref?
Date: Sat, 8 Feb 2014 15:11:22 -0600	[thread overview]
Message-ID: <CAGN11+1uLErNDnqMJUxTycFO+9Bd4rFUPSV5w9r24Vk0nyLjeQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2516 bytes --]

I'm using Org-mode version 8.2.5f with Gnu Emacs 24.3 on a Macbook Air with
Mavericks. I'm using it to build building an annotated collection of
contract clauses that I'm releasing under a Creative Commons license (see
http://www.CommonDraft.org), which I hope to monetize with a book on
contract drafting and negotiation.

I've done a fair amount of Google searching and also searching within this
list. If the following isn't already implemented, I'd pay USD$100 (via
PayPal) to have that done to whoever implements it in an official org-mode
release, plus another USD$100 donation to the org-mode maintainer.

QUESTION:  When org-mode headings are NUMBERED, and the file is exported to
HTML, is there any way to have org-mode include the TITLE, not just the
section number, of a cross-referenced section, along the lines of the LaTex
\nameref{} function?  Here's an example:

==BEGIN EXAMPLE==

#+OPTIONS: H:7 TOC:nil @:t num:1 email:t author:t

* Introduction to Technology Contracts
  :PROPERTIES:
  :CUSTOM_ID: IntroTechContracts
  :END:

Lorem ipsum etc. etc.

* Dangerous Clauses
  :PROPERTIES:
  :CUSTOM_ID: DangerousClauses
  :END:

Lorem ipsum etc. etc. -- see Section [[#IntroTechContracts]].

==END EXAMPLE==

With numbering turned ON (#+OPTIONS: num:1), the link is exported to HTML
as:  Section <a href="#IntroTechContracts">1</a>.

With numbering turned OFF (#+OPTIONS: num:nil), the link is exported to
HTML as:  Section <a href="#IntroTechContracts">Introduction to Technology
Contracts</a>.

Using a macro, I'd like to be able to AUTOMATICALLY do the latter --- that
is, have the link text be the heading title --- even with numbering turned
ON, so that a macro such as {{{SECREF(IntroTechContracts)}}} would render
in HTML as, let's say:   Section <a href="#IntroTechContracts">1</a>,
entitled "<a href="#IntroTechContracts">Introduction to Technology
Contracts</a>."

Is that currently doable?

*D. C. Toedt III * *(my** last name is pronounced "Tate") *
Attorney and neutral arbitrator -- tech contracts and intellectual property

dc@toedt.com     LinkedIn: dctoedt <http://www.linkedin.com/in/dctoedt>
Calendar<https://www.google.com/calendar/embed?src=dc.toedt@toedt.com&mode=WEEK>
 (redacted)
O: +1 (713) 364-6545    C: +1 (713) 516-8968

Houston, Texas (Central time zone)
*Common Draft* <http://www.commondraft.org> annotated collection of
contract clauses

Unless expressly stated otherwise, this message is not intended
to serve as an electronic signature nor as assent to an agreement.

[-- Attachment #2: Type: text/html, Size: 8162 bytes --]

             reply	other threads:[~2014-02-08 21:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-08 21:11 D. C. Toedt [this message]
2014-02-08 21:50 ` Include heading title in HTML section-number cross-reference, like LaTex \nameref? Nicolas Goaziou
2014-02-08 22:46   ` D. C. Toedt
2014-02-09  0:04     ` D. C. Toedt
2014-02-09  8:29       ` Nicolas Goaziou
2014-02-09 12:08         ` D. C. Toedt
2014-02-09 22:36           ` Nicolas Goaziou
2014-02-10  8:44             ` Bastien
2014-02-10 16:38               ` Nicolas Goaziou
2014-02-09  8:19     ` Bastien
2014-02-09 11:51       ` D. C. Toedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGN11+1uLErNDnqMJUxTycFO+9Bd4rFUPSV5w9r24Vk0nyLjeQ@mail.gmail.com \
    --to=dc@toedt.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).