Difference between revisions of "Documentation/4.1/Developers/Tutorials/DocumentModule"

From Slicer Wiki
Jump to: navigation, search
m (Created page with '{{documentation/underconstruction}}')
 
Line 1: Line 1:
{{documentation/underconstruction}}
+
= Module page =
 +
# [[Template:Documentation/{{documentation/version}}/module-header|module-header]] and [[Template:Documentation/{{documentation/version}}/module-footer|module-footer]] templates should be respectively used at the top and the bottom of the page.
 +
# [[Template:Documentation/modulename|modulename]] should be used instead of writing in plain text the name of the module.
 +
# Base your work on either [[Documentation/{{documentation/version}}/Modules/YOURMODULENAME]] or an [[:Category:Documentation/{{documentation/version}}/Modules|existing module]] documentation.
 +
# For CLI modules, the '''SVNREVISION''' revision number is reported on this [http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/Applications/CLI page]. The module description and the information for developers would be automatically extracted from the corresponding XML description.
 +
# See [[Documentation/{{documentation/version}}/ModulesMetadata|this page]] to define the revision number. The revision number associated to a module is used to extract module information from the source code directly.
 +
 
 +
== Documentation for a CLI module ==
 +
The main idea is to re-use the documentation of the CLI parameters in the wiki. When a CLI is added into Slicer, please execute the following steps to create the module online documentation.
 +
# Create a CLI in Slicer4/Modules/CLI
 +
# Add your module in [[Documentation/{{documentation/version}}/ModulesMetadata]]. Adding a module consists of adding a module name+revision pair alphabetically in the list. The revision number must correspond to the most up to date revision number of your module.
 +
# Copy the content of the [[Documentation/{{documentation/version}}/Modules/YOURMODULENAME|template]] module and paste it in a page you created with the name of your module: [[Documentation/{{documentation/version}}/Modules/YOURMODULENAME]].
 +
# Edit the wiki code to replace the generic information with the module specific information. You can upload screenshots and tutorials.
 +
 
 +
== Documentation for a loadable module ==
 +
Creating online documentation for loadable modules is similar to CLI modules. The difference is that loadable modules don't have parameter descriptions, it must be added separately.
 +
# In Slicer4, if it doesn't exist yet
 +
## create a ''Documentation'' subdirectory in your module directory (e.g. ''Slicer4/Modules/Loadable/Transforms/Documentation'').
 +
## Copy and rename the ''YourModuleName.{xml,dox}'' files from an existing module documentation.
 +
# Add description for each [[Documentation/{{documentation/version}}/Developers/Style_Guide/UI#Section|section]] of your module (''YourModuleName.xml'') applying the following pattern:
 +
<pre>
 +
  <parameters>
 +
    <label>Section1 header</label>
 +
    <parameter>
 +
      <label>Parameter1 name</label>
 +
      <description><![CDATA[Parameter1 description]]></description>
 +
    </parameter>
 +
  </parameters>
 +
  <parameters>
 +
    <label>Section2 header</label>
 +
    <parameter>
 +
      <label>Parameter2 name</label>
 +
      <description><![CDATA[Parameter2 description]]></description>
 +
    </parameter>
 +
    <parameter>
 +
      <label>Parameter3 name</label>
 +
      <description><![CDATA[Parameter3 description]]></description>
 +
    </parameter>
 +
  ...
 +
</pre>
 +
 
 +
== Documentation for a scripted module ==
 +
The trick used in loadable module documentation is not supported yet for scripted modules. Documentation must be written directly in the created module wiki page.
 +
== Documentation for an extension ==
 +
#Create a regular wiki page for each module of the extension using the [[Documentation/{{documentation/version}}/Modules/YOURMODULENAME|template]] page. The URLs of the extension modules are the same than the core modules.
 +
# Add an extension entry in [[Documentation/{{documentation/version}}/Extensions]]
 +
# Edit [[Documentation/{{documentation/version}}]] to make sure your extension is listed.

Revision as of 06:28, 17 June 2012

Home < Documentation < 4.1 < Developers < Tutorials < DocumentModule

Module page

  1. module-header and module-footer templates should be respectively used at the top and the bottom of the page.
  2. modulename should be used instead of writing in plain text the name of the module.
  3. Base your work on either Documentation/4.1/Modules/YOURMODULENAME or an existing module documentation.
  4. For CLI modules, the SVNREVISION revision number is reported on this page. The module description and the information for developers would be automatically extracted from the corresponding XML description.
  5. See this page to define the revision number. The revision number associated to a module is used to extract module information from the source code directly.

Documentation for a CLI module

The main idea is to re-use the documentation of the CLI parameters in the wiki. When a CLI is added into Slicer, please execute the following steps to create the module online documentation.

  1. Create a CLI in Slicer4/Modules/CLI
  2. Add your module in Documentation/4.1/ModulesMetadata. Adding a module consists of adding a module name+revision pair alphabetically in the list. The revision number must correspond to the most up to date revision number of your module.
  3. Copy the content of the template module and paste it in a page you created with the name of your module: Documentation/4.1/Modules/YOURMODULENAME.
  4. Edit the wiki code to replace the generic information with the module specific information. You can upload screenshots and tutorials.

Documentation for a loadable module

Creating online documentation for loadable modules is similar to CLI modules. The difference is that loadable modules don't have parameter descriptions, it must be added separately.

  1. In Slicer4, if it doesn't exist yet
    1. create a Documentation subdirectory in your module directory (e.g. Slicer4/Modules/Loadable/Transforms/Documentation).
    2. Copy and rename the YourModuleName.{xml,dox} files from an existing module documentation.
  2. Add description for each section of your module (YourModuleName.xml) applying the following pattern:
  <parameters>
    <label>Section1 header</label>
    <parameter>
      <label>Parameter1 name</label>
      <description><![CDATA[Parameter1 description]]></description>
    </parameter>
  </parameters>
  <parameters>
    <label>Section2 header</label>
    <parameter>
      <label>Parameter2 name</label>
      <description><![CDATA[Parameter2 description]]></description>
    </parameter>
    <parameter>
      <label>Parameter3 name</label>
      <description><![CDATA[Parameter3 description]]></description>
    </parameter>
  ...

Documentation for a scripted module

The trick used in loadable module documentation is not supported yet for scripted modules. Documentation must be written directly in the created module wiki page.

Documentation for an extension

  1. Create a regular wiki page for each module of the extension using the template page. The URLs of the extension modules are the same than the core modules.
  2. Add an extension entry in Documentation/4.1/Extensions
  3. Edit Documentation/4.1 to make sure your extension is listed.