Wanted - Simple section numbering prog for HTML document

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Ramsden

    Wanted - Simple section numbering prog for HTML document

    I maintain various specs and FAQs in manually edited HTML documents,
    and I'd very much like some simple way of automatic section numbering
    as in 2.1, 2.1.1, 2.1.2, 2.2 etc, with table of contents generation
    plugged into the start of the document so that each section can be
    accessed via a link (and also maybe automatic footnote numbering).

    It doesn't seem too much to ask, and I could probably whump up a
    script myself in a couple of days. But to save reinventing the
    whell, I was wondering if there is anything already available,
    short of using Word for Windows and "Saving as HTML". (As I said,
    I'd prefer to maintain the documents by hand.)

    P.S. Also, I'm not sure if SSI is suitable, as the files should be
    viewable locally via "Explore".

    Thanks in advance for any suggestions or pointers.


    Cheers

    John Ramsden (john_ramsden@N-O-S-P-A-Msagitta-ps.com)
  • Martin Lucas-Smith

    #2
    Re: Wanted - Simple section numbering prog for HTML document


    [color=blue]
    > I maintain various specs and FAQs in manually edited HTML documents,
    > and I'd very much like some simple way of automatic section numbering
    > as in 2.1, 2.1.1, 2.1.2, 2.2 etc, with table of contents generation
    > plugged into the start of the document so that each section can be
    > accessed via a link (and also maybe automatic footnote numbering).
    >
    > It doesn't seem too much to ask, and I could probably whump up a
    > script myself in a couple of days. But to save reinventing the
    > whell, I was wondering if there is anything already available,
    > short of using Word for Windows and "Saving as HTML". (As I said,
    > I'd prefer to maintain the documents by hand.)[/color]

    See my page at


    Assuming you are using structural headings (which it sounds as if you
    should be..) then this will generate a table of contents automatically
    using this javascript file. It's very simple to use. Just put in

    <body onload="generat e_TOC('toc');">
    instead of your <body> tag and

    <div id="toc"></div>
    where you want the TOC to appear.

    Based on an article in Evolt as referenced.

    [color=blue]
    > P.S. Also, I'm not sure if SSI is suitable, as the files should be
    > viewable locally via "Explore".[/color]

    Clearly this has to be client-side, then. PHP will be of no use for this
    if you require local viewing.


    Martin Lucas-Smith www.geog.cam.ac.uk/~mvl22


    Senior Computing Technician (Web Technician) webmaster@geog. cam.ac.uk
    Department of Geography, University of Cambridge (01223 3)33390

    & Webmaster, SPRI webmaster@spri. cam.ac.uk
    Scott Polar Research Institute, University of Cambridge


    Comment

    • Jochen Daum

      #3
      Re: Wanted - Simple section numbering prog for HTML document

      Hi!

      On 15 Sep 2003 02:45:28 -0700, john_ramsden@sa gitta-ps.com (John
      Ramsden) wrote:
      [color=blue]
      >I maintain various specs and FAQs in manually edited HTML documents,
      >and I'd very much like some simple way of automatic section numbering
      >as in 2.1, 2.1.1, 2.1.2, 2.2 etc, with table of contents generation
      >plugged into the start of the document so that each section can be
      >accessed via a link (and also maybe automatic footnote numbering).
      >
      >It doesn't seem too much to ask, and I could probably whump up a
      >script myself in a couple of days. But to save reinventing the
      >whell, I was wondering if there is anything already available,
      >short of using Word for Windows and "Saving as HTML". (As I said,
      >I'd prefer to maintain the documents by hand.)
      >
      >P.S. Also, I'm not sure if SSI is suitable, as the files should be
      >viewable locally via "Explore".[/color]

      LaTeX and LaTeX2HTMl do that, but it was quite a hassle to get the
      HTMl part going. Also maybe tex4ht with LaTeX. You can also produce
      PDF and PS easily from LaTeX.

      HTH, Jochen
      --
      Jochen Daum - CANS Ltd.
      PHP DB Edit Toolkit -- PHP scripts for building
      database editing interfaces.
      Download PHP DB Edit Toolkit for free. PHP DB Edit Toolkit is a set of PHP classes makes the generation of database edit interfaces easier and faster. The main class builds tabular and form views based on a data dictionary and takes over handling of insert/update/delete and user input.

      Comment

      • John Ramsden

        #4
        Re: Wanted - Simple section numbering prog for HTML document

        Martin Lucas-Smith <mvl22@cam.ac.u k> wrote in message news:<Pine.SOL. 4.44.0309151109 440.23180-100000@green.cs i.cam.ac.uk>...[color=blue][color=green]
        > > I maintain various specs and FAQs in manually edited HTML documents,
        > > and I'd very much like some simple way of automatic section numbering
        > > as in 2.1, 2.1.1, 2.1.2, 2.2 etc, with table of contents generation
        > > plugged into the start of the document so that each section can be
        > > accessed via a link (and also maybe automatic footnote numbering).
        > >
        > > [...][/color]
        >
        > See my page at
        > www.geog.cam.ac.uk/~mvl22/javascript/toc.html
        >
        > [...]
        >[color=green]
        > > P.S. Also, I'm not sure if SSI is suitable, as the files should be
        > > viewable locally via "Explore".[/color]
        >
        > Clearly this has to be client-side, then. PHP will be of no use for this
        > if you require local viewing.[/color]

        Many thanks, Martin. This server-side solution is certainly of some use,
        and hopefully if I have php installed on my PC it might work also for
        client-side viewing. Well, I guess there's only one way to find out..


        Cheers

        John Ramsden (john_ramsdenNO @SPAMsagitta-ps.com)

        Comment

        • Martin Lucas-Smith

          #5
          Re: Wanted - Simple section numbering prog for HTML document



          [color=blue][color=green]
          > > Clearly this has to be client-side, then. PHP will be of no use for
          > > this if you require local viewing.[/color]
          >
          > Many thanks, Martin. This server-side solution is certainly of some use,
          > and hopefully if I have php installed on my PC it might work also for
          > client-side viewing. Well, I guess there's only one way to find out..[/color]

          Erm, it's client side, as you presumably meant to say. It's a javascript
          solution, not PHP..


          Martin

          Comment

          Working...