Re: [O] Tables of contents for individual sections wanted -- will donate

2014-07-01 Thread Nick Dokos
D. C. Toedt d...@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




Re: [O] Tables of contents for individual sections wanted -- will donate

2014-06-30 Thread Ian Barton

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.




Re: [O] Tables of contents for individual sections wanted -- will donate

2014-06-30 Thread D. C. Toedt
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 li...@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.




Re: [O] Tables of contents for individual sections wanted -- will donate

2014-06-30 Thread Ian Barton

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.




Re: [O] Tables of contents for individual sections wanted -- will donate

2014-06-30 Thread D. C. Toedt
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 ulli 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.


[O] Tables of contents for individual sections wanted -- will donate

2014-06-29 Thread D. C. Toedt
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
d...@toedt.com LinkedIn: dctoedt http://www.linkedin.com/in/dctoedt
Calendar
https://www.google.com/calendar/embed?src=dc.to...@toedt.commode=WEEK
(redacted)
O: +1 (713) 364-6545C: +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.