Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » toc.xml generator
toc.xml generator [message #437667] Fri, 30 September 2005 19:08 Go to next message
Eclipse UserFriend
Originally posted by: shashireo.hotmail.com

Is there a tool (plugin/API) which can generate toc.xml files from an
html source tree?

We'd like to be able to pull our html from a version control system, use
some tool and automatically package the help into a plugin. If such a
tool doesn't exist I think a good solution would be to insert custom xml
tags into html documents that a parser can interpret and generate
toc.xml out of.

A related question therefore is: how does eclipse generate the
plugin.xml files? Is it possible to use this API (which I can't seem to
find!) for generating the toc.xml?

Thanks for your help.

Shashi
Re: toc.xml generator [message #437679 is a reply to message #437667] Sat, 01 October 2005 14:17 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
There isn't a tool that you can use to generate the toc.xml files directly. You won't be able to use the editor for plugin.xml files because ... well, it's a completely different type of file. Yes, they're both XML, but they are as similar as Atom files are to Microsoft Office XML format.

One way would be to write a simple command-line tool using utilities such as 'grep' to find out what the HTML title was. If you're writing well-formed XHTML, you could even use something like xsltproc to query the documents (if you knew enough about XSLT).

However, one thing that any automated tool won't be able to tell you is which order they should appear in the toc. That's why the toc files are usually created by hand, unless you've got some kind of naming convention in the files (e.g. 01_Welcome.html, 02_Overview.html) that you can use.

Although of little use (if you've already got large amounts of documentation) it's also possible to generate Eclipse help documentation from DocBook source material, which can then also be used to generate HTML, PDF, XSL-FO etc.:

http://www.xml.com/lpt/a/2003/08/13/docbook-eclipse.html
http://cvs.sf.net/viewcvs.py/docbook/xsl/eclipse/
http://docbook.sourceforge.net/projects/xsl/index.html

FYI the Plugin.xml file is not 'generated' as such; rather, the plugin.xml file is parsed and presented as an Editor. Changes in the UI (e.g. clicking on an 'add dependency' results in a new entry being inserted into the document.
Re: toc.xml generator [message #437680 is a reply to message #437679] Sat, 01 October 2005 15:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: shashireo.hotmail.com

Very useful information. Thank you.

As regards this:

>> FYI the Plugin.xml file is not 'generated' as such; rather, the
>> plugin.xml file is parsed and presented as an Editor. Changes in the
>> UI (e.g. clicking on an 'add dependency' results in a new entry being
>> inserted into the document.

I was wondering how this 'insertion' is performed. Are they somewhat
hard-wired into the code? Or is it possible to create a class that gets
instantiated with an XML schema and then can be used to insert sections
of XML? Guess I can read the source to find out...

Shashi

Alex Blewitt wrote:
> There isn't a tool that you can use to generate the toc.xml files
> directly. You won't be able to use the editor for plugin.xml files
> because ... well, it's a completely different type of file. Yes,
> they're both XML, but they are as similar as Atom files are to
> Microsoft Office XML format.
>
> One way would be to write a simple command-line tool using utilities
> such as 'grep' to find out what the HTML title was. If you're writing
> well-formed XHTML, you could even use something like xsltproc to
> query the documents (if you knew enough about XSLT).
>
> However, one thing that any automated tool won't be able to tell you
> is which order they should appear in the toc. That's why the toc
> files are usually created by hand, unless you've got some kind of
> naming convention in the files (e.g. 01_Welcome.html,
> 02_Overview.html) that you can use.
>
> Although of little use (if you've already got large amounts of
> documentation) it's also possible to generate Eclipse help
> documentation from DocBook source material, which can then also be
> used to generate HTML, PDF, XSL-FO etc.:
>
> http://www.xml.com/lpt/a/2003/08/13/docbook-eclipse.html
> http://cvs.sf.net/viewcvs.py/docbook/xsl/eclipse/
> http://docbook.sourceforge.net/projects/xsl/index.html
>
> FYI the Plugin.xml file is not 'generated' as such; rather, the
> plugin.xml file is parsed and presented as an Editor. Changes in the
> UI (e.g. clicking on an 'add dependency' results in a new entry being
> inserted into the document.
Re: toc.xml generator [message #437684 is a reply to message #437680] Sat, 01 October 2005 22:09 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
>> FYI the Plugin.xml file is not 'generated' as such; rather, the
>> plugin.xml file is parsed and presented as an Editor. Changes in the
>> UI (e.g. clicking on an 'add dependency' results in a new entry being
>> inserted into the document.
>
> I was wondering how this 'insertion' is performed. Are they somewhat
> hard-wired into the code? Or is it possible to create a class that gets
> instantiated with an XML schema and then can be used to insert sections
> of XML? Guess I can read the source to find out...

You might be interested in looking into EMF (the Eclipse Modelling Framework) that allows data to be modelled as classes. There's an oldish article on the EMF at:

http://www.eclipse.org/articles/Article-Using%20EMF/using-em f.html

I don't think the PDE uses EMF to edit the plugin.xml file. It's possible to serialise documents generated from EMF into an xml file, but the format is an EMF-specific one (though it wouldn't be hard to translate it to/from your own XML schema if you wanted to).

If you're looking for XML processing libraries, I can recommend the Xml Object Model at http://www.xom.nu -- it allows documents to be parsed, manipulated, and saved in a very object oriented way (with less verbosity than either using SAX or DOM).
Re: toc.xml generator [message #437687 is a reply to message #437684] Sun, 02 October 2005 02:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: shashireo.hotmail.com

Thanks for that link. XOM looks like it might serve our needs very well.

Shashi

Alex Blewitt wrote:
>>>FYI the Plugin.xml file is not 'generated' as such; rather, the
>>>plugin.xml file is parsed and presented as an Editor. Changes in the
>>>UI (e.g. clicking on an 'add dependency' results in a new entry being
>>>inserted into the document.
>>
>>I was wondering how this 'insertion' is performed. Are they somewhat
>>hard-wired into the code? Or is it possible to create a class that gets
>>instantiated with an XML schema and then can be used to insert sections
>>of XML? Guess I can read the source to find out...
>
>
> You might be interested in looking into EMF (the Eclipse Modelling Framework) that allows data to be modelled as classes. There's an oldish article on the EMF at:
>
> http://www.eclipse.org/articles/Article-Using%20EMF/using-em f.html
>
> I don't think the PDE uses EMF to edit the plugin.xml file. It's possible to serialise documents generated from EMF into an xml file, but the format is an EMF-specific one (though it wouldn't be hard to translate it to/from your own XML schema if you wanted to).
>
> If you're looking for XML processing libraries, I can recommend the Xml Object Model at http://www.xom.nu -- it allows documents to be parsed, manipulated, and saved in a very object oriented way (with less verbosity than either using SAX or DOM).
Re: toc.xml generator [message #437693 is a reply to message #437667] Sun, 02 October 2005 17:17 Go to previous message
Chris Aniszczyk is currently offline Chris AniszczykFriend
Messages: 674
Registered: July 2009
Senior Member
Just to let you know, an eclipse.org article will be coming out soon
that addresses authoring in Eclipse.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=108397

Give it about 2-3 weeks max ;)

It will discuss how to author things in Eclipse like books, articles,
technical documentation etc... it will include an example (docbook) and
generate html out of it, pdf and an Eclipse infocenter. The article
itself was written in docbook and generated into an eclipse.org via a
custom docbook stylesheet.

If you have any comments on what else should be in the article, let me
know :)

Cheers,

~ Chris
Previous Topic:J-Integra for COM in RCP causes NoClassDefFoundError while shutdown
Next Topic:Action does not work after deployment: "The chosen operation is not currently available"
Goto Forum:
  


Current Time: Sat Dec 07 22:19:51 GMT 2024

Powered by FUDForum. Page generated in 0.03408 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top