blob: b197e8076d04ba565c3b82d3a02080fe556dcaa1 [file] [log] [blame]
<!doctype html public "-//w3c//dtd html 4.0//en">
<html>
<head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>README Tool Extension Points</title>
</head>
<body link="#0000FF" vlink="#800080">
<center>
<h1>
Section Parser</h1></center>
<b><i>Identifier: </i></b>org.eclipse.ui.examples.readmetool.sectionParser
<p><b><i>Description: </i></b>This extension point allows tools to provide
a parser for Readme files which identifies the sections of the file.
The sections determined by this parser will show up in the outliner when a
Readme file is open in the editor. The sections will also appear in the
"Readme sections" view.
<p>The default section parser provided with the Readme Tool is a simple parser
which considers sections to be numbered at the beginning of a line. Top-level
sections are signified by a number followed by a period, such as in the following
regular expression: "[0-9]+\.". Examples are "1.", "0.", and "12345.".
Subsections are signified by the regular expression: "([0-9]+\.)+[0-9]+". Examples
of subsections are "1.1", "1.1.1.1", and "123.456.7890". Any level of subsection
nesting may occur. Section and subsection markers must occur before any other
non-whitespace characters on a line.
<p><b><i>Configuration Markup:</i></b>
<p><tt>&nbsp;&nbsp; &lt;!ATTLIST sectionParser</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name &nbsp;CDATA #REQUIRED</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id &nbsp;&nbsp; CDATA #REQUIRED</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class CDATA #REQUIRED</tt>
<br><tt>&nbsp;&nbsp; ></tt>
<ul>
<li>
<b>name</b> - a string describing this contribution.</li>
<li>
<b>id</b> - a unique identifier that can be used to reference this extension.</li>
<li>
<b>class</b> - a fully qualified name of the class which provides this extension.</li>
</ul>
<b><i>Examples:</i></b>
<p>The following is an example of a sectionParser extension point:
<p><tt>&nbsp;&nbsp;&lt;extension point="org.eclipse.ui.examples.readmetool.sectionParser"></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;parser</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name="Custom README Section Parser"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id="com.xyz.CustomSectionParser"</tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; class="com.xyz.CustomSectionParser"></tt>
<br><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/parser></tt>
<br><tt>&nbsp;&nbsp;&lt;/extension></tt>
<p>In the example above, the class com.xyz.CustomSectionParser will be used as
the section parser for Readme files.
<p><b><i>API Information: </i></b>Value of the action attribute <b>class</b>
must be a fully qualified class name of a Java class that implements the interface
org.eclipse.ui.examples.readmetool.IReadmeFileParser. This interface is loaded as
late as possible to avoid loading the entire tool before it is really needed.
<p><b><i>Supplied Implementation: </i></b>As described above, the default section
parser uses a simple grammar of sections identified by numbers followed by periods,
and subsections identified by the pattern of a number followed by a period, repeated
an arbitrary number of times, and ending with a number.
</body>
</html>