Add function documentation checker/converter
[sheep] / resources / success1.lisp
1 (defpackage #:success1 (:use :cl)
2  (:documentation
3 "This defines a simple successful package.
4
5 This is should all get pulled in and the markdown.md should be equal
6 to success1.md.")
7  (:export
8   #:func-that-does-stuff #:noargs #:result-list #:has-no-examples
9   #:values-result #:has-optional #:has-keywords #:has-rest
10   ))
11
12 (in-package #:success1)
13
14 (defun func-that-does-stuff (path x)
15  "FUNC-THAT-DOES-STUFF PATH X => RESULT
16
17   RESULT: SUCCESS-RESULT | FAILURE-RESULT
18   SUCCESS-RESULT: (:success FILENAME)
19   FAILURE-RESULT: (:failure FILENAME MSG)
20
21 ARGUMENTS AND VALUES:
22
23   PATH: a pathname
24   X: a random value related to PATH
25   FILENAME: the file this func was run on
26   MSG: a string containing the failure message
27
28 DESCRIPTION:
29
30   FUNC-THAT-DOES-STUFF runs all the things against a file and returns
31   as soon as the first func error is found.
32
33   This second section uses PATH and X as something we should talk about, but
34   doesn't use all the arguments (let's include PATH here for fun)
35
36 EXAMPLES:
37
38   (func-that-does-stuff #P\"path/to/file.lisp\" t) => (:success \"path/to/file.lisp\")
39   (func-that-does-stuff #P\"path/to/error.lisp\" nil) => (:failure \"path/to/error.lisp\" \"Error msg\" 20 0)"
40   path)
41
42 (defun result-list ()
43  "RESULT-LIST => RESULT
44
45   RESULT: FAILURE-RESULT*
46   FAILURE-RESULT: (:failure FILENAME MSG)
47
48 ARGUMENTS AND VALUES:
49
50   FILENAME: the file this func was run on
51   MSG: a string containing the failure message
52
53 DESCRIPTION:
54
55   NOARGS runs all the things against a file and returns
56   as soon as the first func error is found."
57   nil)
58
59 (defun noargs ()
60  "NOARGS => RESULT
61
62   RESULT: SUCCESS-RESULT | FAILURE-RESULT
63   SUCCESS-RESULT: (:success FILENAME)
64   FAILURE-RESULT: (:failure FILENAME MSG)
65
66 ARGUMENTS AND VALUES:
67
68   FILENAME: the file this func was run on
69   MSG: a string containing the failure message
70
71 DESCRIPTION:
72
73   NOARGS runs all the things against a file and returns
74   as soon as the first func error is found.
75
76 EXAMPLES:
77
78   (func-that-does-stuff) => (:success \"path/to/file.lisp\")
79   (func-that-does-stuff) => (:failure \"path/to/error.lisp\" \"Error msg\" 20 0)"
80   nil)
81
82 (defun has-no-examples ()
83  "HAS-NO-EXAMPLES => RESULT
84
85   RESULT: SUCCESS-RESULT | FAILURE-RESULT
86   SUCCESS-RESULT: (:success FILENAME)
87   FAILURE-RESULT: (:failure FILENAME MSG)
88
89 ARGUMENTS AND VALUES:
90
91   FILENAME: the file this func was run on
92   MSG: a string containing the failure message
93
94 DESCRIPTION:
95
96   HAS-NO-EXAMPLES runs all the things against a file and returns
97   as soon as the first func error is found."
98   nil)
99
100 (defun values-result ()
101  "VALUES-RESULT => RESULT1, RESULT2, RESULT3
102
103   RESULT1: SUCCESS-RESULT | FAILURE-RESULT
104   SUCCESS-RESULT: (:success FILENAME)
105   FAILURE-RESULT: (:failure FILENAME MSG)
106
107 ARGUMENTS AND VALUES:
108
109   RESULT2: second result
110   RESULT3: third result
111   FILENAME: the file this func was run on
112   MSG: a string containing the failure message
113
114 DESCRIPTION:
115
116   VALUES-RESULT runs all the things against a file and returns
117   as soon as the first func error is found."
118   nil)
119
120 (defun has-optional (path &optional x)
121  "HAS-OPTIONAL PATH &optional X => RESULT
122
123   RESULT: SUCCESS-RESULT | FAILURE-RESULT
124   SUCCESS-RESULT: (:success FILENAME)
125   FAILURE-RESULT: (:failure FILENAME MSG)
126
127 ARGUMENTS AND VALUES:
128
129   PATH: a pathname
130   X: a random value related to PATH
131   FILENAME: the file this func was run on
132   MSG: a string containing the failure message
133
134 DESCRIPTION:
135
136   HAS-OPTIONAL runs all the things against a file and returns
137   as soon as the first func error is found.
138
139   This second section uses PATH and X as something we should talk about, but
140   doesn't use all the arguments (let's include PATH here for fun)"
141   path)
142
143 (defun has-keywords (path &key x)
144  "HAS-KEYWORDS PATH &key X => RESULT
145
146   RESULT: SUCCESS-RESULT | FAILURE-RESULT
147   SUCCESS-RESULT: (:success FILENAME)
148   FAILURE-RESULT: (:failure FILENAME MSG)
149
150 ARGUMENTS AND VALUES:
151
152   PATH: a pathname
153   X: a random value related to PATH
154   FILENAME: the file this func was run on
155   MSG: a string containing the failure message
156
157 DESCRIPTION:
158
159   HAS-KEYWORDS runs all the things against a file and returns
160   as soon as the first func error is found.
161
162   This second section uses PATH and X as something we should talk about, but
163   doesn't use all the arguments (let's include PATH here for fun)"
164   path)
165
166 (defun has-rest (path &rest x)
167  "HAS-REST PATH &rest X => RESULT
168
169   RESULT: SUCCESS-RESULT | FAILURE-RESULT
170   SUCCESS-RESULT: (:success FILENAME)
171   FAILURE-RESULT: (:failure FILENAME MSG)
172
173 ARGUMENTS AND VALUES:
174
175   PATH: a pathname
176   X: a random value related to PATH
177   FILENAME: the file this func was run on
178   MSG: a string containing the failure message
179
180 DESCRIPTION:
181
182   HAS-REST runs all the things against a file and returns
183   as soon as the first func error is found.
184
185   This second section uses PATH and X as something we should talk about, but
186   doesn't use all the arguments (let's include PATH here for fun)"
187   path)