bare-script 3.8.10 → 3.8.11

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.
@@ -90,14 +90,31 @@ async function baredocMain(url, title, menuLinks, groupURLs):
90
90
  return
91
91
  endif
92
92
 
93
+ # Fetch the group content URLs
94
+ groupContent = {}
95
+ if groupURLs != null:
96
+ # Fetch the content URLs
97
+ groupURLArray = []
98
+ groupNames = arraySort(objectKeys(groupURLs))
99
+ for groupName in groupNames:
100
+ arrayPush(groupURLArray, objectGet(groupURLs, groupName))
101
+ endfor
102
+ groupContentArray = systemFetch(groupURLArray)
103
+
104
+ # Assign the group contents
105
+ for groupName, ixGroupName in groupNames:
106
+ objectSet(groupContent, groupName, arrayGet(groupContentArray, ixGroupName))
107
+ endfor
108
+ endif
109
+
93
110
  # Render the page
94
111
  title = if(title != null && !objectHas(args, 'url'), title, url)
95
112
  if group != null:
96
- baredocGroupPage(args, title, groupURLs, groups, group)
113
+ baredocGroupPage(args, title, groupURLs, groupContent, groups, group)
97
114
  elif single:
98
- baredocSinglePage(args, title, menuLinks, groupURLs, groups)
115
+ baredocSinglePage(args, title, menuLinks, groupURLs, groupContent, groups)
99
116
  else:
100
- baredocIndexPage(args, title, menuLinks, groupURLs, groups)
117
+ baredocIndexPage(args, title, menuLinks, groupURLs, groupContent, groups)
101
118
  endif
102
119
  endfunction
103
120
 
@@ -122,7 +139,7 @@ endfunction
122
139
 
123
140
 
124
141
  # Render a library documentation index page
125
- async function baredocIndexPage(args, title, menuLinks, groupURLs, groups):
142
+ function baredocIndexPage(args, title, menuLinks, groupURLs, groupContent, groups):
126
143
  publish = objectGet(args, 'publish')
127
144
 
128
145
  # Render the menu and title
@@ -139,9 +156,9 @@ async function baredocIndexPage(args, title, menuLinks, groupURLs, groups):
139
156
  markdownPrint('# ' + markdownEscape(title))
140
157
 
141
158
  # Render the index Markdown, if any
142
- if groupURLs != null && objectHas(groupURLs, ''):
159
+ if objectHas(groupContent, ''):
143
160
  rootURL = objectGet(groupURLs, '')
144
- rootMarkdown = systemFetch(rootURL)
161
+ rootMarkdown = objectGet(groupContent, '')
145
162
  markdownPrint('', if(rootMarkdown != null, rootMarkdown, '**Error:** Failed to load "' + markdownEscape(rootURL) + '"'))
146
163
  endif
147
164
 
@@ -159,7 +176,7 @@ endfunction
159
176
 
160
177
 
161
178
  # Render the single-page library documentation
162
- async function baredocSinglePage(args, title, menuLinks, groupURLs, groups):
179
+ function baredocSinglePage(args, title, menuLinks, groupURLs, groupContent, groups):
163
180
  publish = objectGet(args, 'publish')
164
181
 
165
182
  # Render the menu and title
@@ -176,9 +193,9 @@ async function baredocSinglePage(args, title, menuLinks, groupURLs, groups):
176
193
  markdownPrint('# ' + markdownEscape(title))
177
194
 
178
195
  # Render the index Markdown, if any
179
- if groupURLs != null && objectHas(groupURLs, ''):
196
+ if objectHas(groupContent, ''):
180
197
  rootURL = objectGet(groupURLs, '')
181
- rootMarkdown = systemFetch(rootURL)
198
+ rootMarkdown = objectGet(groupContent, '')
182
199
  markdownPrint('', if(rootMarkdown != null, rootMarkdown, '**Error:** Failed to load "' + markdownEscape(rootURL) + '"'))
183
200
  endif
184
201
 
@@ -196,13 +213,13 @@ async function baredocSinglePage(args, title, menuLinks, groupURLs, groups):
196
213
  # Render the library function index
197
214
  for groupName in arraySort(objectKeys(groups)):
198
215
  markdownPrint('', '---', '')
199
- baredocGroupPage(args, title, groupURLs, groups, groupName)
216
+ baredocGroupPage(args, title, groupURLs, groupContent, groups, groupName)
200
217
  endfor
201
218
  endfunction
202
219
 
203
220
 
204
221
  # Render a library documentation group page
205
- async function baredocGroupPage(args, title, groupURLs, groups, groupName):
222
+ function baredocGroupPage(args, title, groupURLs, groupContent, groups, groupName):
206
223
  publish = objectGet(args, 'publish')
207
224
  single = objectGet(args, 'single')
208
225
  baseHeader = if(single, '##', '#')
@@ -227,11 +244,10 @@ async function baredocGroupPage(args, title, groupURLs, groups, groupName):
227
244
  markdownPrint('', argsLink(baredocArguments, 'Back to top', null, false, '_top'))
228
245
  endif
229
246
 
230
-
231
247
  # Render the group Markdown, if any
232
- if groupURLs != null && objectHas(groupURLs, groupName):
248
+ if objectHas(groupContent, groupName):
233
249
  groupURL = objectGet(groupURLs, groupName)
234
- groupMarkdown = systemFetch(groupURL)
250
+ groupMarkdown = objectGet(groupContent, groupName)
235
251
  markdownPrint('', if(groupMarkdown != null, groupMarkdown, '**Error:** Failed to load "' + markdownEscape(groupURL) + '"'))
236
252
  endif
237
253
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "bare-script",
4
- "version": "3.8.10",
4
+ "version": "3.8.11",
5
5
  "description": "BareScript; a lightweight scripting and expression language",
6
6
  "keywords": [
7
7
  "expression",