* Tables of contents for individual sections wanted -- will donate
@ 2014-06-29 18:51 D. C. Toedt
2014-06-30 18:40 ` Ian Barton
2014-07-01 13:10 ` Nick Dokos
0 siblings, 2 replies; 6+ messages in thread
From: D. C. Toedt @ 2014-06-29 18:51 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 2647 bytes --]
Hi all --
BACKGROUND: I've been using org-mode to develop the *Common Draft*
annotated collection of business contract clauses, in part for the law
school course in contract drafting that I teach to third-year law students.
I've been posting the collection as a Creative Commons document at
http://www.CommonDraft.org, and plan to expand and maintain it.
QUESTION: I'm currently using a single, multi-level table of contents
(TOC) at the beginning of the document. That ends up being a lot to scroll
through to get to the first chapter. I'd like instead to have:
- a one-level "master" TOC at the beginning of the document, listing and
linking to just the articles (in contracts, "articles" are the same as
"chapters" in books, that is, the top-level sections); and
- at the beginning of each article, a TOC listing and linking to the
subheadings within that article.
EXAMPLE of the desired capability:
[book title:] COMMON DRAFT: Business Contract Clauses, Annotated and
Explained
SUMMARY OF CONTENTS
1. Definitions & Usages
2. Arbitration
3. Assignment of Agreement
[etc.]
ART. 1. DEFINITIONS & USAGES
TABLE OF CONTENTS
1.1 Affiliate Status
1.2 Agreement Definition
[etc.]
1.1 Affiliate Status
Two entities are affiliates if one of them controls, is controlled by, or
is under common control of the other, where "control" refers ....
1.2 Agreement Definition
The term "this Agreement" refers to this signed document as well as its
exhibits, appendixes, annexes, .....
Suggestions? If it can't currently be done in org-mode but can be
implemented, I'd donate US$100.00 to the org-mode support fund if someone
were to come up with and publish a working solution. As for doing it
myself in e-lisp, I'm just scratching the surface of e-lisp, so it's not
something I could undertake at this juncture.
Regards,
--D. C.
*D*ell *C*harles "D. C." Toedt III *(my** last name is pronounced "Tate") *
Attorney and neutral arbitrator -- tech contracts and intellectual property
Editor, Common Draft <http://www.commondraft.org/> project: Model
contract term sheets & clauses, annotated
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)
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: 9541 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Tables of contents for individual sections wanted -- will donate
2014-06-29 18:51 Tables of contents for individual sections wanted -- will donate D. C. Toedt
@ 2014-06-30 18:40 ` Ian Barton
2014-06-30 18:55 ` D. C. Toedt
2014-07-01 13:10 ` Nick Dokos
1 sibling, 1 reply; 6+ messages in thread
From: Ian Barton @ 2014-06-30 18:40 UTC (permalink / raw)
To: D. C. Toedt, emacs-orgmode
On 29/06/14 19:51, D. C. Toedt wrote:
at http://www.CommonDraft.org, and plan to expand and maintain it.
>
> QUESTION: I'm currently using a single, multi-level table of contents
> (TOC) at the beginning of the document. That ends up being a lot to
> scroll through to get to the first chapter. I'd like instead to have:
>
> * a one-level "master" TOC at the beginning of the document, listing
> and linking to just the articles (in contracts, "articles" are the
> same as "chapters" in books, that is, the top-level sections); and
>
> * at the beginning of each article, a TOC listing and linking to the
> subheadings within that article.
>
Not an org-mode solution, but if your audience is consuming the content
as a web page generated from org-mode, you can do most of this using jQuery.
What I am suggesting is you make your TOC collapsible and clicking on a
heading in the TOC expands the links to the sub headings underneath the
heading. You can probably do nested collapsible headings so you can
expand various level of subheadings like a concertina.
I am definitely not a Javascript expert, but I have managed to use this
technique on some of my documents.
Ian.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Tables of contents for individual sections wanted -- will donate
2014-06-30 18:40 ` Ian Barton
@ 2014-06-30 18:55 ` D. C. Toedt
2014-06-30 20:19 ` Ian Barton
0 siblings, 1 reply; 6+ messages in thread
From: D. C. Toedt @ 2014-06-30 18:55 UTC (permalink / raw)
To: ian; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 1680 bytes --]
Thanks, Ian. I've done things like that in the past, but it'd entail
maintaining the TOC by hand, which I was hoping to avoid. True, I'd be
able to create the initial TOC using org-mode, followed by manually
inserting jQuery calls. But I'd have to manually edit the TOC every time I
added a new chapter or section and every time I edited a heading title.
On Mon, Jun 30, 2014 at 1:40 PM, Ian Barton <lists@wilkesley.net> wrote:
> On 29/06/14 19:51, D. C. Toedt wrote:
> at http://www.CommonDraft.org, and plan to expand and maintain it.
>
>>
>> QUESTION: I'm currently using a single, multi-level table of contents
>> (TOC) at the beginning of the document. That ends up being a lot to
>> scroll through to get to the first chapter. I'd like instead to have:
>>
>> * a one-level "master" TOC at the beginning of the document, listing
>>
>> and linking to just the articles (in contracts, "articles" are the
>> same as "chapters" in books, that is, the top-level sections); and
>>
>> * at the beginning of each article, a TOC listing and linking to the
>> subheadings within that article.
>>
>>
> Not an org-mode solution, but if your audience is consuming the content as
> a web page generated from org-mode, you can do most of this using jQuery.
>
> What I am suggesting is you make your TOC collapsible and clicking on a
> heading in the TOC expands the links to the sub headings underneath the
> heading. You can probably do nested collapsible headings so you can expand
> various level of subheadings like a concertina.
>
> I am definitely not a Javascript expert, but I have managed to use this
> technique on some of my documents.
>
> Ian.
>
>
[-- Attachment #2: Type: text/html, Size: 2768 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Tables of contents for individual sections wanted -- will donate
2014-06-30 18:55 ` D. C. Toedt
@ 2014-06-30 20:19 ` Ian Barton
2014-07-01 2:45 ` D. C. Toedt
0 siblings, 1 reply; 6+ messages in thread
From: Ian Barton @ 2014-06-30 20:19 UTC (permalink / raw)
To: D. C. Toedt; +Cc: ian, emacs-orgmode
On 2014-06-30 19:55, D. C. Toedt wrote:
> Thanks, Ian. I've done things like that in the past, but it'd entail
> maintaining the TOC by hand, which I was hoping to avoid. True, I'd
> be able to create the initial TOC using org-mode, followed by manually
> inserting jQuery calls. But I'd have to manually edit the TOC every
> time I added a new chapter or section and every time I edited a
> heading title.
>
You can do it without editing the TOC manually. You use the <div> </div>
of each level of the org headline css as a selector in jQuery. You then
add a JS function to the DocumentReady function which does the jQuery
expanding/collapsing. This can all be done as part of your org-mode
document. I can knock up a simple example tomorrow if it's of interest.
Best wishes,
Ian.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Tables of contents for individual sections wanted -- will donate
2014-06-30 20:19 ` Ian Barton
@ 2014-07-01 2:45 ` D. C. Toedt
0 siblings, 0 replies; 6+ messages in thread
From: D. C. Toedt @ 2014-07-01 2:45 UTC (permalink / raw)
To: Ian Barton; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 637 bytes --]
That would be very much of interest, Ian. One potential issue, though:
The table of contents generated by org-mode uses just one <div></div>,
with nested <ul><li> elements.
I spent a few hours tinkering with variations on the jQuery approach at
http://www.sitepoint.com/forums/showthread.php?822342-JavaScript-list-of-links-with-sub-lists-hide-and-show,
with code at http://jsfiddle.net/GeekyJohn/9kaQQ/. It initially
looked promising, but I haven't been able to make it reliably play well
with having links in the TOC headings. Of course, when it comes to jQuery
I'm not much better than a cargo-cult programmer.
Thanks,
--D. C.
[-- Attachment #2: Type: text/html, Size: 1622 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Tables of contents for individual sections wanted -- will donate
2014-06-29 18:51 Tables of contents for individual sections wanted -- will donate D. C. Toedt
2014-06-30 18:40 ` Ian Barton
@ 2014-07-01 13:10 ` Nick Dokos
1 sibling, 0 replies; 6+ messages in thread
From: Nick Dokos @ 2014-07-01 13:10 UTC (permalink / raw)
To: emacs-orgmode
"D. C. Toedt" <dc@toedt.com> writes:
> Hi all --
>
> BACKGROUND: I've been using org-mode to develop the Common Draft annotated collection of business contract clauses, in part for the law school course in contract drafting that I
> teach to third-year law students. I've been posting the collection as a Creative Commons document at http://www.CommonDraft.org, and plan to expand and maintain it.
>
> QUESTION: I'm currently using a single, multi-level table of contents (TOC) at the beginning of the document. That ends up being a lot to scroll through to get to the first
> chapter. I'd like instead to have:
>
> * a one-level "master" TOC at the beginning of the document, listing and linking to just the articles (in contracts, "articles" are the same as "chapters" in books, that is, the
> top-level sections); and
>
> * at the beginning of each article, a TOC listing and linking to the subheadings within that article.
>
It's not a pure org solution, but I'd go this way:
o have each "article" in a separate org file - export each one to HTML
(that can be scripted easily) - you get the article TOCs for free.
o have a separate top-level org (or HTML) file that contains the TOC with
pointers to the "articles". The production of this file can be scripted
as well: get the #+TITLEs of each "article" file and turn them into
links.
The whole thing can be wrapped up in a Makefile to automate the process.
Navigation (prev/next/top) may be a problem but it shouldn't be too hard
either.
--
Nick
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-07-01 13:10 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-29 18:51 Tables of contents for individual sections wanted -- will donate D. C. Toedt
2014-06-30 18:40 ` Ian Barton
2014-06-30 18:55 ` D. C. Toedt
2014-06-30 20:19 ` Ian Barton
2014-07-01 2:45 ` D. C. Toedt
2014-07-01 13:10 ` Nick Dokos
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).