Home
Categories
Dictionary
Download
Project Details
Changes Log
What Links Here
How To
Syntax
FAQ
License

API documentation elements basic tutorial



This article is a tutorial explaining how to reference APIs in the wiki. You will:

Initialize the wiki content

As for the first tutorial, we will:
  • Create an index file
  • Create a first empty article
Let's create our index article:
   <index>
   The index for the tutorial wiki.
   </index>
And also an empty article:
   <article desc="api article">
   </article>
We will reference existing APIs on the Web. First we will add a reference to the javax.swing.JComponent javadoc API for Java:
   <article desc="api article">
      <javadoc path="javax.swing.JComponent" />
   </article>
We will have the following result:
Button

Now we will add a reference to a method of the javax.swing.JComponent class:
   <article desc="api article">
      <javadoc path="javax.swing.JComponent" />
         
      <javadoc path="javax.swing.JComponent" member="setEnabled(boolean)"/>
   </article>
We will have the following result:
JComponent
JComponent.setEnabled(boolean) Now we will add a reference to the System.AppDomain .NET API:
   <article desc="api article">
      <javadoc path="javax.swing.JComponent" />
         
      <javadoc path="javax.swing.JComponent" member="setEnabled(boolean)"/>      
      <empty/>
      <dotnetdoc path="System.AppDomain"/>
   </article>
We will have the following result:
JComponent
JComponent.setEnabled(boolean)

System.AppDomain

Now we will add a reference to a method of the System.AppDomain class:
   <article desc="api article">
      <javadoc path="javax.swing.JComponent" />
         
      <javadoc path="javax.swing.JComponent" member="setEnabled(boolean)"/>      
      <empty/>
      <dotnetdoc path="System.AppDomain"/>
         
      <dotnetdoc path="System.AppDomain" member="CreateDomain(string)"/>
   </article>
We will have the following result:
JComponent
JComponent.setEnabled(boolean)

System.AppDomain
System.AppDomain.org.docgene.model.APIMember@5d479419

Embed APIs in the wiki

We will now embed APIs directly in the wiki. To do that, let's create a second empty article:
  <article desc="second api article">
  </article>

Embed a javadoc API

First we will embed the JComponent API for Java:
   <article desc="second api article">
      <javaAPI path="JComponent" modifiers="public">The base class for all Swing components except top-level containers.</javaAPI>
   </article>
We will have the following result:


public class JComponent



The base class for all Swing components except top-level containers.

Now let's add the setEnabled method:
   <article desc="second api article">
      <javaAPI path="JComponent" modifiers="public">The base class for all Swing components except top-level containers.</javaAPI>
        <method member="setEnabled(boolean enabled)">Sets whether or not this component is enabled</method>     
      </javaAPI>    
   </article>
We will have the following result:


public class JComponent
The base class for all Swing components except top-level containers.

Modifier and Type Method and Description
void setEnabled(boolean enabled)
Sets whether or not this component is enabled

Embed a python API

Now we will embed the io API for Python:
   <article desc="second api article">
      <javaAPI path="JComponent" modifiers="public">The base class for all Swing components except top-level containers.</javaAPI>
        <method member="setEnabled(boolean enabled)">Sets whether or not this component is enabled</method>     
      </javaAPI>  
      <pythonAPI path="io">The io module provides Python&#x00E2;&#x20AC;&#x2122;s main facilities for dealing with various types of I/O.</pythonAPI>         
   </article>
We will have the following result:


public class JComponent
The base class for all Swing components except top-level containers.

Modifier and Type Method and Description
void setEnabled(boolean enabled)
Sets whether or not this component is enabled



class io



The io module provides Python main facilities for dealing with various types of I/O.


Now let's add the open method:
   <article desc="second api article">
      <javaAPI path="JComponent" modifiers="public">The base class for all Swing components except top-level containers.</javaAPI>
        <method member="setEnabled(boolean enabled)">Sets whether or not this component is enabled</method>     
      </javaAPI>  
      <pythonAPI path="io">The io module provides Python main facilities for dealing with various types of I/O.
        <method member="open(file, mode='r', buffering=- 1, encoding=None, errors=None, newline=None, closefd=True, opener=None)">Open file and return a corresponding file object.</method>              
      </pythonAPI>         
   </article>
We will have the following result:


public class JComponent
The base class for all Swing components except top-level containers.

Modifier and Type Method and Description
void setEnabled(boolean enabled)
Sets whether or not this component is enabled



class io
The io module provides Python main facilities for dealing with various types of I/O.

def open(file, mode='r', buffering=- 1, encoding=None, errors=None, newline=None, closefd=True, opener=None)
Open file and return a corresponding file object.

See also


Categories: tutorials

docJGenerator Copyright (c) 2016-2023 Herve Girod. All rights reserved.