473,385 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 (jo**********@N-O-S-P-A-Msagitta-ps.com)
Jul 16 '05 #1
4 1994

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


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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jacek Generowicz | last post by:
:::Title::: A simple text markup utility :::/Title::: :::Section Introduction ::: I'm looking for something to help developers wirte documentation for bits of software they are writing. The...
2
by: Andy Glew | last post by:
I have long looked for (and occasionally posted questions to groups such as this about) a tool that can take a group of HTML pages (nowadays XHTML, or XML) and produce a nicely formatted...
3
by: Alan Clark | last post by:
Dear All I need to do something very simple with Javascript and have been looking all over the web for two days for a suitable script. I'm the kind of person who learns by seeing how it's done....
1
by: William Starr Moake | last post by:
This may be difficult to understand unless you are familiar with the design mode feature built into Internet Explorer 5.5+. I used this feature to develop a browser-based WYSIWYG HTML editor for...
0
gemmountain
by: gemmountain | last post by:
Hi, does anyone know how to use Word Automation to insert page numbers for each section in a Word document, and the numbering scheme of each section is independent, not the same as previous? ...
72
by: goacross | last post by:
char ch='a'; int v=sizeof ++ch; cout<<ch<<endl;// output: 'a' why not 'b'? thanks
7
by: freddukes | last post by:
Okay... So this is my first project and I want to be able to make a tool tip appear with the basket contents whenever you hover over a link using the onmousehover='javascriptFunction()'. I have...
16
by: dhtml | last post by:
Breaking up the FAQ has been discussed. http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/d11878ddfb2ac892/ I'm interested in doing this now. I propose something along the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.