By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,780 Members | 1,520 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,780 IT Pros & Developers. It's quick & easy.

Wanted - Simple section numbering prog for HTML document

P: n/a
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 (jo**********@N-O-S-P-A-Msagitta-ps.com)
Jul 16 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a

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.)
See my page at
www.geog.cam.ac.uk/~mvl22/javascript/toc.html

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="generate_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.

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


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
www.lucas-smith.co.uk

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

& Webmaster, SPRI we*******@spri.cam.ac.uk
Scott Polar Research Institute, University of Cambridge
Jul 16 '05 #2

P: n/a
Hi!

On 15 Sep 2003 02:45:28 -0700, jo**********@sagitta-ps.com (John
Ramsden) wrote:
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".


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.
http://sourceforge.net/projects/phpdbedittk/
Jul 16 '05 #3

P: n/a
Martin Lucas-Smith <mv***@cam.ac.uk> wrote in message news:<Pi**************************************@gre en.csi.cam.ac.uk>...
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).

[...]


See my page at
www.geog.cam.ac.uk/~mvl22/javascript/toc.html

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


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


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 (jo************@SPAMsagitta-ps.com)
Jul 16 '05 #4

P: n/a


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


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..


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

Jul 16 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.