bare-script 4.2.5__tar.gz → 4.2.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. {bare_script-4.2.5/src/bare_script.egg-info → bare_script-4.2.7}/PKG-INFO +30 -10
  2. {bare_script-4.2.5 → bare_script-4.2.7}/README.md +29 -9
  3. {bare_script-4.2.5 → bare_script-4.2.7}/setup.cfg +1 -1
  4. bare_script-4.2.7/src/bare_script/include/baredoc.bare +383 -0
  5. bare_script-4.2.7/src/bare_script/runtime_c.c +5286 -0
  6. {bare_script-4.2.5 → bare_script-4.2.7/src/bare_script.egg-info}/PKG-INFO +30 -10
  7. bare_script-4.2.5/src/bare_script/include/baredoc.bare +0 -340
  8. bare_script-4.2.5/src/bare_script/runtime_c.c +0 -1916
  9. {bare_script-4.2.5 → bare_script-4.2.7}/LICENSE +0 -0
  10. {bare_script-4.2.5 → bare_script-4.2.7}/pyproject.toml +0 -0
  11. {bare_script-4.2.5 → bare_script-4.2.7}/setup.py +0 -0
  12. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/__init__.py +0 -0
  13. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/__main__.py +0 -0
  14. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/bare.py +0 -0
  15. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/include/__init__.py +0 -0
  16. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/include/args.bare +0 -0
  17. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/include/baredocCLI.bare +0 -0
  18. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/include/data.bare +0 -0
  19. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/include/dataLineChart.bare +0 -0
  20. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/include/dataTable.bare +0 -0
  21. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/include/dataUtil.bare +0 -0
  22. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/include/diff.bare +0 -0
  23. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/include/draw.bare +0 -0
  24. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/include/elementModel.bare +0 -0
  25. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/include/forms.bare +0 -0
  26. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/include/markdown.bare +0 -0
  27. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/include/markdownElements.bare +0 -0
  28. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/include/markdownHighlight.bare +0 -0
  29. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/include/markdownParser.bare +0 -0
  30. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/include/markdownUp.bare +0 -0
  31. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/include/pager.bare +0 -0
  32. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/include/qrcode.bare +0 -0
  33. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/include/schemaDoc.bare +0 -0
  34. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/include/unittest.bare +0 -0
  35. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/include/unittestMock.bare +0 -0
  36. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/library.py +0 -0
  37. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/model.py +0 -0
  38. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/options.py +0 -0
  39. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/parser.py +0 -0
  40. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/runtime.py +0 -0
  41. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script/value.py +0 -0
  42. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script.egg-info/SOURCES.txt +0 -0
  43. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script.egg-info/dependency_links.txt +0 -0
  44. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script.egg-info/entry_points.txt +0 -0
  45. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script.egg-info/requires.txt +0 -0
  46. {bare_script-4.2.5 → bare_script-4.2.7}/src/bare_script.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bare-script
3
- Version: 4.2.5
3
+ Version: 4.2.7
4
4
  Summary: bare-script
5
5
  Home-page: https://github.com/craigahobbs/bare-script
6
6
  Author: Craig A. Hobbs
@@ -104,11 +104,11 @@ from bare_script import execute_script, fetch_http, parse_script
104
104
 
105
105
  # Parse the script
106
106
  script = parse_script('''\
107
- # Fetch the BareScript library documentation JSON
108
- docs = jsonParse(systemFetch('https://craigahobbs.github.io/bare-script-py/library/library.json'))
107
+ # Fetch the BareScript builtin library documentation JSON
108
+ docs = jsonParse(systemFetch('https://craigahobbs.github.io/bare-script-py/library/library-builtin.json'))
109
109
 
110
- # Return the number of library functions
111
- return 'The BareScript Library has ' + arrayLength(objectGet(docs, 'functions')) + ' functions'
110
+ # Return the number of builtin functions
111
+ return 'The BareScript Library has ' + arrayLength(objectGet(docs, 'functions')) + ' builtin functions'
112
112
  ''')
113
113
 
114
114
  # Execute the script
@@ -118,7 +118,7 @@ print(execute_script(script, {'fetchFn': fetch_http}))
118
118
  This outputs:
119
119
 
120
120
  ```
121
- The BareScript Library has 209 functions
121
+ The BareScript Library has 108 builtin functions
122
122
  ```
123
123
 
124
124
 
@@ -193,10 +193,30 @@ markdownPrint('Hello, Markdown!')
193
193
 
194
194
  ## C Runtime
195
195
 
196
- The package ships with an optional CPython C extension (`runtime_c`) that mirrors the pure-Python
197
- runtime for faster script execution. When the compiled extension is available, it is used
198
- automatically; otherwise the pure-Python runtime is used as a fallback. Set the environment
199
- variable `BARESCRIPT_RUNTIME_PY=1` to force the pure-Python runtime.
196
+ The package ships with an optional CPython C extension, `runtime_c`, that mirrors the pure-Python
197
+ runtime for faster script execution. The compiled extension is used automatically when available;
198
+ set the environment variable `BARESCRIPT_RUNTIME_PY=1` to force the pure-Python runtime.
199
+
200
+ The extension supports CPython 3.10 and later on both the default (GIL) and free-threaded Python
201
+ builds.
202
+
203
+ The C runtime runs the BareScript include library test suite (`make test-include`) about 3.6x
204
+ faster than the pure-Python runtime (CPython 3.14, Apple M-series):
205
+
206
+ | Runtime | Test Suite Time (ms) | Multiple |
207
+ | ------------------- | -------------------: | -------: |
208
+ | BareScript (C) | 586 | 1.0x |
209
+ | BareScript (Python) | 2115 | 3.6x |
210
+
211
+ Compute-intensive scripts run up to roughly 30x faster - for example, the
212
+ [Mandelbrot benchmark](https://github.com/craigahobbs/bare-script-py/blob/main/perf/test.bare)
213
+ (`make perf`), shown here against the equivalent native Python program:
214
+
215
+ | Language | Best Time (ms) | Multiple |
216
+ | ------------------- | -------------: | -------: |
217
+ | Python | 152 | 1.0x |
218
+ | BareScript (C) | 322 | 2.1x |
219
+ | BareScript (Python) | 10389 | 68.5x |
200
220
 
201
221
 
202
222
  ## Using BareScript with an AI Assistant
@@ -79,11 +79,11 @@ from bare_script import execute_script, fetch_http, parse_script
79
79
 
80
80
  # Parse the script
81
81
  script = parse_script('''\
82
- # Fetch the BareScript library documentation JSON
83
- docs = jsonParse(systemFetch('https://craigahobbs.github.io/bare-script-py/library/library.json'))
82
+ # Fetch the BareScript builtin library documentation JSON
83
+ docs = jsonParse(systemFetch('https://craigahobbs.github.io/bare-script-py/library/library-builtin.json'))
84
84
 
85
- # Return the number of library functions
86
- return 'The BareScript Library has ' + arrayLength(objectGet(docs, 'functions')) + ' functions'
85
+ # Return the number of builtin functions
86
+ return 'The BareScript Library has ' + arrayLength(objectGet(docs, 'functions')) + ' builtin functions'
87
87
  ''')
88
88
 
89
89
  # Execute the script
@@ -93,7 +93,7 @@ print(execute_script(script, {'fetchFn': fetch_http}))
93
93
  This outputs:
94
94
 
95
95
  ```
96
- The BareScript Library has 209 functions
96
+ The BareScript Library has 108 builtin functions
97
97
  ```
98
98
 
99
99
 
@@ -168,10 +168,30 @@ markdownPrint('Hello, Markdown!')
168
168
 
169
169
  ## C Runtime
170
170
 
171
- The package ships with an optional CPython C extension (`runtime_c`) that mirrors the pure-Python
172
- runtime for faster script execution. When the compiled extension is available, it is used
173
- automatically; otherwise the pure-Python runtime is used as a fallback. Set the environment
174
- variable `BARESCRIPT_RUNTIME_PY=1` to force the pure-Python runtime.
171
+ The package ships with an optional CPython C extension, `runtime_c`, that mirrors the pure-Python
172
+ runtime for faster script execution. The compiled extension is used automatically when available;
173
+ set the environment variable `BARESCRIPT_RUNTIME_PY=1` to force the pure-Python runtime.
174
+
175
+ The extension supports CPython 3.10 and later on both the default (GIL) and free-threaded Python
176
+ builds.
177
+
178
+ The C runtime runs the BareScript include library test suite (`make test-include`) about 3.6x
179
+ faster than the pure-Python runtime (CPython 3.14, Apple M-series):
180
+
181
+ | Runtime | Test Suite Time (ms) | Multiple |
182
+ | ------------------- | -------------------: | -------: |
183
+ | BareScript (C) | 586 | 1.0x |
184
+ | BareScript (Python) | 2115 | 3.6x |
185
+
186
+ Compute-intensive scripts run up to roughly 30x faster - for example, the
187
+ [Mandelbrot benchmark](https://github.com/craigahobbs/bare-script-py/blob/main/perf/test.bare)
188
+ (`make perf`), shown here against the equivalent native Python program:
189
+
190
+ | Language | Best Time (ms) | Multiple |
191
+ | ------------------- | -------------: | -------: |
192
+ | Python | 152 | 1.0x |
193
+ | BareScript (C) | 322 | 2.1x |
194
+ | BareScript (Python) | 10389 | 68.5x |
175
195
 
176
196
 
177
197
  ## Using BareScript with an AI Assistant
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = bare-script
3
- version = 4.2.5
3
+ version = 4.2.7
4
4
  url = https://github.com/craigahobbs/bare-script
5
5
  author = Craig A. Hobbs
6
6
  author_email = craigahobbs@gmail.com
@@ -0,0 +1,383 @@
1
+ # Licensed under the MIT License
2
+ # https://github.com/craigahobbs/bare-script/blob/main/LICENSE
3
+
4
+ include <args.bare>
5
+ include <markdown.bare>
6
+ include <dataUtil.bare>
7
+ include <dataTable.bare>
8
+ include <schemaDoc.bare>
9
+
10
+
11
+ # $function: baredocMain
12
+ # $group: baredoc.bare
13
+ # $doc: The BareScript library documentation application main entry point
14
+ # $arg config: The [documentation configuration](model.html#var.vName='BaredocConfig') object or its JSON resource URL
15
+ async function baredocMain(config):
16
+ # Parse arguments
17
+ args = argsParse(baredocArguments)
18
+ group = objectGet(args, 'group')
19
+ name = objectGet(args, 'name')
20
+ single = objectGet(args, 'single')
21
+
22
+ # Render the documentation model page?
23
+ if objectGet(args, 'doc'):
24
+ documentSetTitle('Library')
25
+ markdownPrint(schemaDocMarkdown(baredocTypes, 'BaredocLibrary'))
26
+ return
27
+ endif
28
+
29
+ # Resolve and validate the configuration
30
+ if systemType(config) == 'string':
31
+ config = jsonParse(systemFetch(config))
32
+ endif
33
+ config = schemaValidate(baredocTypes, 'BaredocConfig', config)
34
+ if config == null:
35
+ markdownPrint('**Error:** Invalid baredoc configuration')
36
+ return
37
+ endif
38
+ sections = objectGet(config, 'sections')
39
+
40
+ # Fetch and validate the section library documentation resources
41
+ sectionURLs = []
42
+ for section in sections:
43
+ arrayPush(sectionURLs, objectGet(section, 'url'))
44
+ endfor
45
+ sectionJSONs = systemFetch(sectionURLs)
46
+
47
+ # Group each section's functions by name, with the config content and description
48
+ groups = {}
49
+ sectionGroups = []
50
+ for section, ixSection in sections:
51
+ sectionJSON = arrayGet(sectionJSONs, ixSection)
52
+ libraryPart = if(sectionJSON != null, jsonParse(sectionJSON))
53
+ libraryPart = if(libraryPart != null, schemaValidate(baredocTypes, 'BaredocLibrary', libraryPart))
54
+ if libraryPart == null:
55
+ markdownPrint( \
56
+ '**Error:** Failed to fetch library documentation resource "' + \
57
+ markdownEscape(objectGet(section, 'url')) + '"' \
58
+ )
59
+ return
60
+ endif
61
+
62
+ # Group the section's functions
63
+ sectionGroupSet = {}
64
+ for function_ in objectGet(libraryPart, 'functions'):
65
+ groupName = objectGet(function_, 'group')
66
+ groupEntry = objectGet(groups, groupName)
67
+ if groupEntry == null:
68
+ groupEntry = {'functions': []}
69
+ objectSet(groups, groupName, groupEntry)
70
+ endif
71
+ arrayPush(objectGet(groupEntry, 'functions'), function_)
72
+ objectSet(sectionGroupSet, groupName, true)
73
+ endfor
74
+ arrayPush(sectionGroups, {'title': objectGet(section, 'title'), 'groupNames': arraySort(objectKeys(sectionGroupSet))})
75
+
76
+ # Attach the section's group content and description from the config
77
+ for group_ in objectGet(section, 'groups', []):
78
+ groupEntry = objectGet(groups, objectGet(group_, 'name'))
79
+ if groupEntry != null:
80
+ objectSet(groupEntry, 'content', objectGet(group_, 'content'))
81
+ objectSet(groupEntry, 'description', objectGet(group_, 'description'))
82
+ endif
83
+ endfor
84
+ endfor
85
+
86
+ # Sort each group's functions by name
87
+ for groupName in objectKeys(groups):
88
+ arraySort(objectGet(objectGet(groups, groupName), 'functions'), baredocFunctionCompare)
89
+ endfor
90
+
91
+ # Function requested by name? Redirect to its group page anchor
92
+ if name != null:
93
+ for groupName in objectKeys(groups):
94
+ for function_ in objectGet(objectGet(groups, groupName), 'functions'):
95
+ if objectGet(function_, 'name') == name:
96
+ windowSetLocation(argsURL(baredocArguments, {'group': groupName, 'name': null}, false, name))
97
+ return
98
+ endif
99
+ endfor
100
+ endfor
101
+ markdownPrint('', '**Error:** Unknown function "' + markdownEscape(name) + '"')
102
+ return
103
+ endif
104
+
105
+ # Render the requested page
106
+ if group != null:
107
+ baredocGroupPage(config, args, groups, group)
108
+ elif single:
109
+ baredocSinglePage(config, args, sectionGroups, groups)
110
+ else:
111
+ baredocIndexPage(config, args, sectionGroups, groups)
112
+ endif
113
+ endfunction
114
+
115
+
116
+ # The BareScript library documentation application arguments
117
+ baredocArguments = argsValidate([ \
118
+ {'name': 'doc', 'type': 'bool', 'default': false}, \
119
+ {'name': 'group'}, \
120
+ {'name': 'name'}, \
121
+ {'name': 'publish', 'type': 'bool', 'default': false}, \
122
+ {'name': 'single', 'type': 'bool', 'default': false} \
123
+ ])
124
+
125
+
126
+ # Helper to compare library function objects by name
127
+ function baredocFunctionCompare(f1, f2):
128
+ f1Name = objectGet(f1, 'name')
129
+ f2Name = objectGet(f2, 'name')
130
+ return if(f1Name < f2Name, -1, if(f1Name == f2Name, 0, 1))
131
+ endfunction
132
+
133
+
134
+ # Helper to render the title and top-level content
135
+ async function baredocPageHeader(config):
136
+ title = objectGet(config, 'title')
137
+ documentSetTitle(title)
138
+ markdownPrint('# ' + markdownEscape(title))
139
+ topContent = objectGet(config, 'content')
140
+ if topContent != null:
141
+ topText = systemFetch(topContent)
142
+ markdownPrint('', if(topText != null, topText, '**Error:** Failed to load "' + markdownEscape(topContent) + '"'))
143
+ endif
144
+ endfunction
145
+
146
+
147
+ # Render the section group index tables (single uses in-page anchors, multi-page uses group pages)
148
+ function baredocGroupTable(sectionGroups, groups, single):
149
+ for section in sectionGroups:
150
+ markdownPrint('', '## ' + markdownEscape(objectGet(section, 'title')), '')
151
+ markdownPrint('| | |', '| --- | --- |')
152
+ for groupName in objectGet(section, 'groupNames'):
153
+ groupLink = if(single, \
154
+ argsLink(baredocArguments, groupName, null, false, groupName), \
155
+ argsLink(baredocArguments, groupName, {'group': groupName}, false, argsTopHeaderId))
156
+ description = objectGet(objectGet(groups, groupName), 'description')
157
+ markdownPrint('| ' + groupLink + ' | ' + if(description != null, description, '') + ' |')
158
+ endfor
159
+ endfor
160
+ endfunction
161
+
162
+
163
+ # Render a library documentation index page
164
+ async function baredocIndexPage(config, args, sectionGroups, groups):
165
+ # Render the title and top-level content
166
+ baredocPageHeader(config)
167
+
168
+ # Render the single page toggle
169
+ if !objectGet(args, 'publish'):
170
+ markdownPrint('', argsLink(baredocArguments, 'Single Page', {'single': true}))
171
+ endif
172
+
173
+ # Render the section group index tables
174
+ baredocGroupTable(sectionGroups, groups, false)
175
+ endfunction
176
+
177
+
178
+ # Render the single-page library documentation
179
+ async function baredocSinglePage(config, args, sectionGroups, groups):
180
+ # Render the title and top-level content
181
+ baredocPageHeader(config)
182
+
183
+ # Render the multi page toggle
184
+ if !objectGet(args, 'publish'):
185
+ markdownPrint('', argsLink(baredocArguments, 'Multi Page', {'single': false}))
186
+ endif
187
+
188
+ # Render the section group index tables
189
+ baredocGroupTable(sectionGroups, groups, true)
190
+
191
+ # Batch-fetch all group content, keyed by group name
192
+ contentNames = []
193
+ urls = []
194
+ for groupName in objectKeys(groups):
195
+ url = objectGet(objectGet(groups, groupName), 'content')
196
+ if url != null:
197
+ arrayPush(contentNames, groupName)
198
+ arrayPush(urls, url)
199
+ endif
200
+ endfor
201
+ texts = systemFetch(urls)
202
+ groupContent = {}
203
+ for groupName, ixName in contentNames:
204
+ text = arrayGet(texts, ixName)
205
+ objectSet(groupContent, groupName, if(text != null, text, '**Error:** Failed to load "' + markdownEscape(arrayGet(urls, ixName)) + '"'))
206
+ endfor
207
+
208
+ # Render each group, separated by a horizontal rule
209
+ for section in sectionGroups:
210
+ for groupName in objectGet(section, 'groupNames'):
211
+ markdownPrint('', '---', '')
212
+ baredocGroup(args, objectGet(groupContent, groupName), groups, groupName, '##')
213
+ endfor
214
+ endfor
215
+ endfunction
216
+
217
+
218
+ # Render a library documentation group page
219
+ async function baredocGroupPage(config, args, groups, groupName):
220
+ title = objectGet(config, 'title')
221
+
222
+ # Set the document title
223
+ documentSetTitle(title + ' - ' + groupName)
224
+
225
+ # Group exist?
226
+ if !objectHas(groups, groupName):
227
+ markdownPrint('', '**Error:** Unknown group "' + markdownEscape(groupName) + '"')
228
+ return
229
+ endif
230
+
231
+ # Fetch the group content
232
+ url = objectGet(objectGet(groups, groupName), 'content')
233
+ groupContent = null
234
+ if url != null:
235
+ text = systemFetch(url)
236
+ groupContent = if(text != null, text, '**Error:** Failed to load "' + markdownEscape(url) + '"')
237
+ endif
238
+
239
+ # Render the index link and the group
240
+ markdownPrint(argsLink(baredocArguments, 'Index', {'group': null}), '')
241
+ baredocGroup(args, groupContent, groups, groupName, '#')
242
+ endfunction
243
+
244
+
245
+ # Render a documentation group's content, function index, and function documentation
246
+ function baredocGroup(args, groupContent, groups, groupName, baseHeader):
247
+ publish = objectGet(args, 'publish')
248
+ single = objectGet(args, 'single')
249
+ groupEntry = objectGet(groups, groupName)
250
+
251
+ # Render the group header
252
+ markdownPrint(baseHeader + ' ' + markdownEscape(groupName))
253
+ if single && !publish:
254
+ markdownPrint('', argsLink(baredocArguments, 'Back to top', null, false, argsTopHeaderId))
255
+ endif
256
+
257
+ # Render the group content (the fetched content or load error, else the description)
258
+ content = if(groupContent != null, groupContent, objectGet(groupEntry, 'description'))
259
+ if content != null:
260
+ markdownPrint('', content)
261
+ endif
262
+
263
+ # Render the group function index
264
+ groupFunctions = objectGet(groupEntry, 'functions')
265
+ markdownPrint('', baseHeader + '# Function Index', '')
266
+ for function_ in groupFunctions:
267
+ functionName = objectGet(function_, 'name')
268
+ markdownPrint('- ' + argsLink(baredocArguments, functionName, null, false, functionName))
269
+ endfor
270
+
271
+ # Render the group function documentation
272
+ for function_ in groupFunctions:
273
+ # Render the function header
274
+ markdownPrint( \
275
+ '', \
276
+ '---', \
277
+ '', \
278
+ baseHeader + '# ' + markdownEscape(objectGet(function_, 'name')), \
279
+ '', \
280
+ objectGet(function_, 'doc') \
281
+ )
282
+
283
+ # Render the functions's argument documentation
284
+ markdownPrint('', baseHeader + '## Arguments')
285
+ arguments = objectGet(function_, 'args')
286
+ if arguments != null:
287
+ for argument in arguments:
288
+ markdownPrint('', '**' + markdownEscape(objectGet(argument, 'name')) + ' -**', objectGet(argument, 'doc'))
289
+ endfor
290
+ else:
291
+ markdownPrint('', 'None')
292
+ endif
293
+
294
+ # Render the function's return documentation
295
+ markdownPrint('', baseHeader + '## Returns')
296
+ returnDoc = objectGet(function_, 'return')
297
+ markdownPrint('', if(returnDoc != null, returnDoc, 'Nothing'))
298
+ endfor
299
+ endfunction
300
+
301
+
302
+ # The library documentation schema
303
+ baredocTypes = schemaParse( \
304
+ 'group "baredoc.bare"', \
305
+ '', \
306
+ '', \
307
+ '# The baredoc documentation application configuration', \
308
+ 'struct BaredocConfig', \
309
+ '', \
310
+ ' # The documentation title', \
311
+ ' string title', \
312
+ '', \
313
+ ' # The optional top-level Markdown content resource URL', \
314
+ ' optional string content', \
315
+ '', \
316
+ ' # The documentation sections', \
317
+ ' BaredocSection[] sections', \
318
+ '', \
319
+ '', \
320
+ '# A documentation section', \
321
+ 'struct BaredocSection', \
322
+ '', \
323
+ ' # The section title', \
324
+ ' string title', \
325
+ '', \
326
+ " # The section's library documentation JSON resource URL", \
327
+ ' string url', \
328
+ '', \
329
+ ' # Optional content and descriptions for the groups (groups are defined by the library functions)', \
330
+ ' optional BaredocGroup[] groups', \
331
+ '', \
332
+ '', \
333
+ "# A library function group's content and description (the group is defined by the library functions)", \
334
+ 'struct BaredocGroup', \
335
+ '', \
336
+ ' # The group name (matches a library function group)', \
337
+ ' string name', \
338
+ '', \
339
+ ' # The optional group Markdown content resource URL (defaults to the description)', \
340
+ ' optional string content', \
341
+ '', \
342
+ ' # The optional brief group description Markdown for the index page', \
343
+ ' optional string description', \
344
+ '', \
345
+ '', \
346
+ '# A library documentation model', \
347
+ 'struct BaredocLibrary', \
348
+ '', \
349
+ ' # The library functions', \
350
+ ' BaredocFunction[] functions', \
351
+ '', \
352
+ '', \
353
+ '# A library function', \
354
+ 'struct BaredocFunction', \
355
+ '', \
356
+ ' # The function name', \
357
+ ' string name', \
358
+ '', \
359
+ ' # The function group (e.g. "Math")', \
360
+ ' string group', \
361
+ '', \
362
+ " # The function's documentation Markdown lines", \
363
+ ' string[] doc', \
364
+ '', \
365
+ ' # The function arguments', \
366
+ ' optional BaredocFunctionArgument[] args', \
367
+ '', \
368
+ " # The function return's documentation Markdown lines", \
369
+ ' optional string[] return', \
370
+ '', \
371
+ ' # If true, ignore the function', \
372
+ ' optional bool ignore', \
373
+ '', \
374
+ '', \
375
+ '# A function argument', \
376
+ 'struct BaredocFunctionArgument', \
377
+ '', \
378
+ ' # The argument name', \
379
+ ' string name', \
380
+ '', \
381
+ " # The argument's documentation Markdown lines", \
382
+ ' string[] doc' \
383
+ )