Add documentation and generator.
[sheep] / README.md
1 # Common Lisp Document Generator
2
3 Enforcement of documentation guidelines for my Common Lisp Projects, as well as conversion to markdown for my github repositories.
4
5 I wish I had aspirations for this being some standard that someone else might follow, but realistically I'm just irritated at my own laziness with regard to documentation, so I wrote a solution.  The forceful nature of the validator is really just because I didn't want to write a smarter parser.  As an added bonus, all the docs now look the same when I look at them in the repl, so that's kind of nice.
6
7 ## Usage
8
9 See the [wiki](https://github.com/frankduncan/docgen/wiki) for usage information (generated by this package).
10
11 To see how that page was created, take a look at bin/generatedocs.sh
12
13 ## Package documentation
14
15 Packages are documented by sections broken up by one empty line, with the first section limited to 120 characters.
16
17 ## Structure/Condition documentation
18
19 Requirements are the same as the package
20
21 ## Function documentation
22
23 Functions should follow the template:
24
25 ````
26 FUNC PATH => RESULT
27
28   RESULT: SUCCESS-RESULTS | FAILURE-RESULT
29   SUCCESS-RESULTS: SUCCESS-RESULT*
30   SUCCESS-RESULT: (:success FILENAME)
31   FAILURE-RESULT: (:failure FILENAME MSG)
32
33 ARGUMENTS AND VALUES:
34
35   PATH: a pathname
36   FILENAME: the file this func was run on
37   MSG: a string containing the failure message
38
39 DESCRIPTION:
40
41   FUNC runs all the things against a file located at PATH and returns
42   as soon as the first func error is found.
43
44 EXAMPLES:
45
46   (func #P\"path/to/file.lisp\" t) => (:success \"path/to/file.lisp\")
47   (func #P\"path/to/error.lisp\" nil) => (:failure \"path/to/error.lisp\" \"Error msg\")
48 ````
49
50 There are four sections to each function definition:
51
52 ### Header section
53
54 Arguments should all be upper case, but &rest, &optional, and &key should be lower case.  Arguments are seperated by a space.
55
56 Results should also be upper case, and in the case of values, separated by commas.
57
58 Types can be further elucidated by providing more information either as a list of options seperated by pipes, a tuple contained in parens, or a list denoted by an *
59
60 ### Arguments and values section:
61
62 All the types that weren't broken down into subtypes must be explained.  The form is type name in all upper case, a colon, then a description.  That description can have upper case type names in it which will then get italicized later.
63
64 ### Description
65
66 Descriptins should be indented two spaces, and not longer than 120 characters wide.  Like the arguments and values, upper cased types will be italicized later.
67
68 ### Examples
69
70 This section is optional.
71
72 Examples are of the form:  example-code => example result