Skip to content

Commit 9ad1bd3

Browse files
committed
Use Sphinx as documentation tool
1 parent 3eb1f5b commit 9ad1bd3

14 files changed

+3110
-2889
lines changed

README.rst

+31-13
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,52 @@
1-
Argparse4j - The command line argument parser library
2-
=====================================================
1+
Argparse4j - The Java command-line argument parser library
2+
==========================================================
33

4-
The argparse4j is a command line argument parser library for Java
5-
based on Python's argparse.
4+
Argparse4j is a command line argument parser library for Java based
5+
on Python's
6+
`argparse <http://docs.python.org/3/library/argparse.html>`_ module.
67

7-
To see how to use argparse4j, see http://argparse4j.sourceforge.net/
8+
Argparse4j is available in Maven central repository:
9+
10+
.. code-block:: xml
11+
12+
<dependency>
13+
<groupId>net.sourceforge.argparse4j</groupId>
14+
<artifactId>argparse4j</artifactId>
15+
<version>0.3.2</version>
16+
</dependency>
817
918
There are still missing features which exist in argparse but not in
1019
argparse4j, but there are also new features which only exist in
1120
argparse4j.
1221

13-
Here is a summary of features:
22+
Here is summary of features:
1423

1524
* Supported positional arguments and optional arguments.
1625
* Variable number of arguments.
1726
* Generates well formatted line-wrapped help message.
1827
* Suggests optional arguments/sub-command if unrecognized
19-
arguments/sub-command were given, e.g., ``unrecognized argument
20-
'--tpye'. Did you mean: --type``.
28+
arguments/sub-command were given, e.g.:
29+
30+
.. code-block:: console
31+
32+
unrecognized argument '--tpye'
33+
Did you mean:
34+
--type
35+
2136
* Takes into account East Asian Width ambiguous characters when
2237
line-wrap.
2338
* Sub-commands like, ``git add``.
2439
* Sub-command alias names, e.g., ``co`` for ``checkout``.
25-
* Customizable option prefix characters, e.g., ``+f`` and ``/h``.
40+
* Customizable option prefix characters, e.g. ``+f`` and ``/h``.
2641
* Print default values in help message.
2742
* Choice from given collection of values.
2843
* Type conversion from option strings.
29-
* Can directly assign values into user defined classes using
30-
annotation.
31-
* Group arguments so that it will be printed in help message in more
32-
readable way.
44+
* Can directly assign values into user defined classes using annotation.
45+
* Group arguments so that it will be printed in help message in
46+
more readable way.
3347
* Mutually exclusive argument group.
3448
* Read additional arguments from file.
49+
* Argument/sub-command abbreviations.
50+
51+
The primary documentation is done using `Sphinx
52+
<http://sphinx-doc.org/>`_. You need Sphinx to run ``mvn site``.

pom.xml

+20
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,26 @@
107107
<artifactId>maven-site-plugin</artifactId>
108108
<version>3.0</version>
109109
</plugin>
110+
<plugin>
111+
<groupId>org.codehaus.mojo</groupId>
112+
<artifactId>exec-maven-plugin</artifactId>
113+
<version>1.2.1</version>
114+
<executions>
115+
<execution>
116+
<id>sphinx-doc</id>
117+
<phase>site</phase>
118+
<goals>
119+
<goal>exec</goal>
120+
</goals>
121+
<configuration>
122+
<executable>sphinx-make-html</executable>
123+
<arguments>
124+
<argument>${project.version}</argument>
125+
</arguments>
126+
</configuration>
127+
</execution>
128+
</executions>
129+
</plugin>
110130
<plugin>
111131
<artifactId>maven-assembly-plugin</artifactId>
112132
<version>2.2.1</version>

sphinx-make-html

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh -e
2+
echo "Building sphinx documentation for version $1"
3+
cd src/site/sphinx
4+
make html PACKAGE_VERSION=$1
5+
cp -vr _build/html/* ../../../target/site/

src/site/apt/examples.apt

-155
This file was deleted.

0 commit comments

Comments
 (0)