Merge lp:~allenap/commandant/readme-to-rest into lp:commandant

Proposed by Gavin Panella
Status: Merged
Approved by: Jamu Kakar
Approved revision: 44
Merged at revision: 43
Proposed branch: lp:~allenap/commandant/readme-to-rest
Merge into: lp:commandant
Diff against target: 335 lines (+53/-53)
1 file modified
README (+53/-53)
To merge this branch: bzr merge lp:~allenap/commandant/readme-to-rest
Reviewer Review Type Date Requested Status
Jamu Kakar Approve
Review via email: mp+109888@code.launchpad.net

Commit message

Ensure README is valid reST, and renders without warnings.

Description of the change

Fix README so that it's valid reST. I've already uploaded the README in the branch by hand to PyPI and confirmed it works okay there (see http://pypi.python.org/pypi/commandant).

To post a comment you must log in.
Revision history for this message
Jamu Kakar (jkakar) wrote :

This is great, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README'
2--- README 2010-06-12 13:56:44 +0000
3+++ README 2012-06-12 17:11:25 +0000
4@@ -27,18 +27,18 @@
5 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
6
7 On Ubuntu systems, the complete text of the GNU General Public
8-Version 2 License is in `/usr/share/common-licenses/GPL-2'.
9+Version 2 License is in ``/usr/share/common-licenses/GPL-2``.
10
11
12 Using Commandant
13 ================
14
15-Commandant can be used as a command runner. The bin/commandant
16-program can present an application made up of commands and help
17-topics grouped together in a directory. The 'example' program
18-described in the following sections is available in the
19-extras/example directory. You can try it out from the current
20-directory by running the following commands.
21+Commandant can be used as a command runner. The ``bin/commandant``
22+program can present an application made up of commands and help topics
23+grouped together in a directory. The ``example`` program described in
24+the following sections is available in the ``example`` directory. You
25+can try it out from the current directory by running the following
26+commands::
27
28 $ alias example="bin/commandant example"
29 $ source example/tab-completion.sh
30@@ -48,12 +48,12 @@
31 ---------------------------
32
33 Commands are grouped into Commandant programs. A Commandant program
34-is made up of an arbitrary number of commands stored in a directory.
35+is made up of an arbitrary number of commands stored in a directory::
36
37 $ mkdir -p ~/example
38
39 An alias can be used to provide a name that can used to run commands
40-in the Commandant program.
41+in the Commandant program::
42
43 $ alias example="commandant ~/example"
44
45@@ -61,8 +61,8 @@
46 Getting help
47 ------------
48
49-Commands provides builtin 'help' and 'version' commands. Running
50-the example program by itself shows basic help information.
51+Commands provides builtin ``help`` and ``version`` commands. Running
52+the example program by itself shows basic help information::
53
54 $ example
55 Commandant -- a framework for building command-oriented tools
56@@ -72,21 +72,21 @@
57 commandant help commands List all commands
58 commandant help topics List all help topics
59
60-Passing the 'commands' topic to the 'help' command lists the
61-commands that are available, with a short summary about each one.
62+Passing the ``commands`` topic to the ``help`` command lists the
63+commands that are available, with a short summary about each one::
64
65 $ example help commands
66 help Show help about a command or topic.
67 version Show version of commandant.
68
69-Passing the 'topics' topic to the 'help' command lists the help
70-topics that are available, with a short summary about each one.
71+Passing the ``topics`` topic to the ``help`` command lists the help
72+topics that are available, with a short summary about each one::
73
74 $ example help topics
75 commands Basic help for all commands.
76 topics Topics list.
77
78-The 'version' command shows the version of Commandant being used.
79+The ``version`` command shows the version of Commandant being used::
80
81 $ example version
82 commandant 0.1
83@@ -96,13 +96,13 @@
84 ----------------------------
85
86 One of the easiest ways to add a command to a Commandant program is
87-by creating a shell script and making it executable.
88+by creating a shell script and making it executable::
89
90 $ echo -e '#!/bin/sh\necho Hello, world!' > ~/example/hello
91 $ chmod +x ~/example/hello
92
93-The new 'hello' command in the 'example' program is now registered
94-and ready to use.
95+The new ``hello`` command in the ``example`` program is now registered
96+and ready to use::
97
98 $ example help commands
99 hello
100@@ -110,7 +110,7 @@
101 version Show version of commandant.
102
103 You should see 'Hello, world!' printed to your screen when you run
104-it.
105+it::
106
107 $ example hello
108 Hello, world!
109@@ -120,13 +120,13 @@
110 -------------------------------------------------
111
112 Commandant will pass all arguments beyond the command name to the
113-executable for that command.
114+executable for that command::
115
116 $ echo -e '#!/bin/sh\necho $*' > ~/example/echo
117 $ chmod +x ~/example/echo
118
119 Again, just by putting an executable file in the command directory,
120-the new 'echo' command has been added to the 'example' program.
121+the new ``echo`` command has been added to the ``example`` program::
122
123 $ example help commands
124 echo
125@@ -134,7 +134,7 @@
126 help Show help about a command or topic.
127 version Show version of commandant.
128
129-The new 'echo' command will repeat whatever we tell it.
130+The new ``echo`` command will repeat whatever we tell it::
131
132 $ example echo Hello there!
133 Hello there!
134@@ -143,12 +143,12 @@
135 Providing help for commands
136 ---------------------------
137
138-The commands in the 'example' program have been very easy to add,
139+The commands in the ``example`` program have been very easy to add,
140 but they could be easier to use. Commandant's builtin help system
141 can be extended to provide help topics for user-provided commands.
142 Files in the command directory with a .txt extension, and with the
143 same name as a command, will be treated as help content for that
144-command. Adding help content for the 'hello' command is quite easy.
145+command. Adding help content for the ``hello`` command is quite easy::
146
147 $ cat ~/example/hello.txt
148 Greet the world!
149@@ -156,7 +156,7 @@
150 Print 'Hello, world!' to the screen.
151
152 The first line in a help topic is used as a short description. This
153-short description is used when listing commands.
154+short description is used when listing commands::
155
156 $ example help commands
157 echo
158@@ -164,9 +164,9 @@
159 help Show help about a command or topic.
160 version Show version of commandant.
161
162-Notice that the 'hello' command uses the short description from the
163+Notice that the ``hello`` command uses the short description from the
164 help topic. The complete help text can be seen by passing the
165-command name to the 'help' command.
166+command name to the ``help`` command::
167
168 $ example help hello
169 Print 'Hello, world!' to the screen.
170@@ -175,9 +175,9 @@
171 Providing a custom splash page
172 ------------------------------
173
174-The stock help text shown when the 'help' command is run points
175+The stock help text shown when the ``help`` command is run points
176 users to the list of commands and help topics. It can be overridden
177-by providing a file called basic.txt.
178+by providing a file called basic.txt::
179
180 $ cat ~/example/basic.txt
181 example -- A collection of command examples that work with Commandant.
182@@ -187,8 +187,8 @@
183 example help commands List all commands
184 example help topics List all help topics
185
186-The contents of this file are shown when the 'help' command is run
187-without a topic.
188+The contents of this file are shown when the ``help`` command is run
189+without a topic::
190
191 $ example help
192 example -- A collection of command examples that work with Commandant.
193@@ -206,7 +206,7 @@
194 topics, not bound to any command name. Files in the command
195 directory with a .txt extension, and with a name that doesn't match
196 any command name, will be treated as help topics. Adding help to
197-describe a concept, for example, is quite easy.
198+describe a concept, for example, is quite easy::
199
200 $ cat ~/example/greetings.txt
201 Greetings are a way to initiate communication.
202@@ -221,15 +221,15 @@
203
204 As with help files for commands, the first line contains a short
205 summary with help text following. The topic will now appear in the
206-topics list.
207+topics list::
208
209 $ example help topics
210 commands Basic help for all commands.
211 greetings Greetings are a way to initiate communication.
212 topics Topics list.
213
214-The help text can be seen by passing the topic name to the 'help'
215-command.
216+The help text can be seen by passing the topic name to the ``help``
217+command::
218
219 $ example help greetings
220 Greeting (also called accosting) is a way for human beings (as well
221@@ -252,7 +252,7 @@
222 Commandant loads commands from the command directory it imports
223 Python commands from files with a .py extension. The commands in
224 the files need to subclass the Command class and need to be named
225-using the cmd_<name> naming convention.
226+using the cmd_<name> naming convention::
227
228 $ cat example/rock-fact.py
229 from bzrlib.commands import Command
230@@ -266,9 +266,9 @@
231 print >>self.outf, "Rocks are really hard."
232
233 Just like with executable commands, adding a Python command is as
234-easy as adding a file to the command directory. An 'outf' attribute
235+easy as adding a file to the command directory. An ``outf`` attribute
236 will be set on the command object when it's run and should be used
237-when printing text.
238+when printing text::
239
240 $ example help commands
241 echo
242@@ -278,10 +278,10 @@
243 version Show version of commandant.
244
245 The new command is available using the name of the class, without
246-the 'cmd_' part, and with underscores converted to dashes. The
247+the ``cmd_`` part, and with underscores converted to dashes. The
248 doctring is used to provide builtin help. The first line is used as
249 the summary and the subsequent content is used as the help text,
250-just like in help files for executable commands.
251+just like in help files for executable commands::
252
253 $ example help rock-fact
254 This command prints a fascinating fact about rocks.
255@@ -296,7 +296,7 @@
256 One of the main advantages of writing Python commands is being able
257 to express command-line argument and option parameters. bzrlib uses
258 this data to automatically provide parsing and integration with the
259-help system.
260+help system::
261
262 $ cat example/fortune.py
263 from random import randint
264@@ -335,7 +335,7 @@
265 Commandant has builtin support for writing commands that need to run
266 in a Twisted reactor. Simply subclass TwistedCommand and implement
267 a command as you normally would. It's run() method will be called
268-inside a running reactor.
269+inside a running reactor::
270
271 $ cat example/get-page.py
272 from twisted.internet import reactor
273@@ -390,7 +390,7 @@
274
275 The first step is to create an entry point which registers commands
276 and help topics and then subsequently runs your program. The
277-CommandController is both a registry and dispatching device:
278+CommandController is both a registry and dispatching device::
279
280 from commandant import builtins
281 from commandant.controller import CommandController
282@@ -413,9 +413,9 @@
283 controller.run(argv[1:])
284
285 The name, version, summary and URL are used in generated help text.
286-The 'builtins' module contains the builtin 'help' and 'version'
287-commands, and the 'basic', 'commands', 'hidden-commands' and
288-'topics' help topics.
289+The ``builtins`` module contains the builtin ``help`` and ``version``
290+commands, and the ``basic``, ``commands``, ``hidden-commands`` and
291+``topics`` help topics.
292
293
294 Registering application commands
295@@ -423,10 +423,10 @@
296
297 Commands can be grouped in a module and registered with the command
298 controller. Just like in the examples above, command classes should
299-be named using the 'cmd_command_name' naming convention and will be
300+be named using the ``cmd_command_name`` naming convention and will be
301 loaded automatically when the module is registered. If all the
302 commands in the examples above were grouped in an example.commands
303-module they could be registered just like the builtin commands:
304+module they could be registered just like the builtin commands::
305
306 from example import commands
307
308@@ -438,7 +438,7 @@
309
310 In the examples above, help topics are text files in a directory.
311 When embedding Commandant in an application, its easier to use
312-Python for help topics:
313+Python for help topics::
314
315 from commandant.help_topics import DocstringHelpTopic
316
317@@ -456,7 +456,7 @@
318
319 Registering help topics is just like registering commands. They can
320 be grouped in a module and registered with the command controller.
321-Topics should use the 'topic_document_name' naming convention.
322+Topics should use the ``topic_document_name`` naming convention::
323
324 from example import help_topics
325
326@@ -466,7 +466,7 @@
327 Providing a custom splash page
328 ------------------------------
329
330-The stock help text shown when the 'help' command is run points
331+The stock help text shown when the ``help`` command is run points
332 users to the list of commands and help topics that have been
333-registered with the controller. If a 'topic_basic' help topic has
334+registered with the controller. If a ``topic_basic`` help topic has
335 been registered it will be shown instead of the builtin splash page.

Subscribers

People subscribed via source and target branches