bare-script 4.2.2__tar.gz → 4.2.3__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 (44) hide show
  1. {bare_script-4.2.2/src/bare_script.egg-info → bare_script-4.2.3}/PKG-INFO +6 -5
  2. {bare_script-4.2.2 → bare_script-4.2.3}/README.md +5 -4
  3. {bare_script-4.2.2 → bare_script-4.2.3}/setup.cfg +1 -1
  4. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/include/dataTable.bare +35 -20
  5. {bare_script-4.2.2 → bare_script-4.2.3/src/bare_script.egg-info}/PKG-INFO +6 -5
  6. {bare_script-4.2.2 → bare_script-4.2.3}/LICENSE +0 -0
  7. {bare_script-4.2.2 → bare_script-4.2.3}/pyproject.toml +0 -0
  8. {bare_script-4.2.2 → bare_script-4.2.3}/setup.py +0 -0
  9. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/__init__.py +0 -0
  10. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/__main__.py +0 -0
  11. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/bare.py +0 -0
  12. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/include/__init__.py +0 -0
  13. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/include/args.bare +0 -0
  14. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/include/baredoc.bare +0 -0
  15. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/include/baredocCLI.bare +0 -0
  16. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/include/data.bare +0 -0
  17. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/include/dataLineChart.bare +0 -0
  18. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/include/dataUtil.bare +0 -0
  19. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/include/diff.bare +0 -0
  20. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/include/draw.bare +0 -0
  21. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/include/elementModel.bare +0 -0
  22. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/include/forms.bare +0 -0
  23. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/include/markdown.bare +0 -0
  24. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/include/markdownElements.bare +0 -0
  25. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/include/markdownHighlight.bare +0 -0
  26. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/include/markdownParser.bare +0 -0
  27. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/include/markdownUp.bare +0 -0
  28. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/include/pager.bare +0 -0
  29. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/include/qrcode.bare +0 -0
  30. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/include/schemaDoc.bare +0 -0
  31. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/include/unittest.bare +0 -0
  32. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/include/unittestMock.bare +0 -0
  33. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/library.py +0 -0
  34. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/model.py +0 -0
  35. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/options.py +0 -0
  36. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/parser.py +0 -0
  37. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/runtime.py +0 -0
  38. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/runtime_c.c +0 -0
  39. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script/value.py +0 -0
  40. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script.egg-info/SOURCES.txt +0 -0
  41. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script.egg-info/dependency_links.txt +0 -0
  42. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script.egg-info/entry_points.txt +0 -0
  43. {bare_script-4.2.2 → bare_script-4.2.3}/src/bare_script.egg-info/requires.txt +0 -0
  44. {bare_script-4.2.2 → bare_script-4.2.3}/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.2
3
+ Version: 4.2.3
4
4
  Summary: bare-script
5
5
  Home-page: https://github.com/craigahobbs/bare-script
6
6
  Author: Craig A. Hobbs
@@ -219,17 +219,18 @@ cp SKILL.md .claude/skills/bare-script/SKILL.md
219
219
  Use `~/.claude/skills/bare-script/SKILL.md` instead to make it available across all projects. For
220
220
  other assistants, include the file's contents in your system prompt or rules file.
221
221
 
222
- Once installed, you can prompt the assistant with tasks like:
222
+ Once installed, prompt the assistant with a task like:
223
223
 
224
- > Build a MarkdownUp application that plays tic-tac-toe against the user, with a reset button
225
- > and a running win/loss/draw tally rendered as a bar chart.
224
+ ```
225
+ claude "Build a MarkdownUp application that plays tic-tac-toe against the user, with a reset button and a running win/loss/draw tally rendered as a bar chart. Save it as ticTacToe.md"
226
+ ```
226
227
 
227
228
  To run the resulting MarkdownUp application locally, install the
228
229
  [markdown-up](https://pypi.org/project/markdown-up/) viewer and point it at the Markdown file:
229
230
 
230
231
  ```
231
232
  pip install markdown-up
232
- markdown-up yourApp.md
233
+ markdown-up ticTacToe.md
233
234
  ```
234
235
 
235
236
  The BareScript library is also documented as single-page Markdown, which can be fetched directly
@@ -194,17 +194,18 @@ cp SKILL.md .claude/skills/bare-script/SKILL.md
194
194
  Use `~/.claude/skills/bare-script/SKILL.md` instead to make it available across all projects. For
195
195
  other assistants, include the file's contents in your system prompt or rules file.
196
196
 
197
- Once installed, you can prompt the assistant with tasks like:
197
+ Once installed, prompt the assistant with a task like:
198
198
 
199
- > Build a MarkdownUp application that plays tic-tac-toe against the user, with a reset button
200
- > and a running win/loss/draw tally rendered as a bar chart.
199
+ ```
200
+ claude "Build a MarkdownUp application that plays tic-tac-toe against the user, with a reset button and a running win/loss/draw tally rendered as a bar chart. Save it as ticTacToe.md"
201
+ ```
201
202
 
202
203
  To run the resulting MarkdownUp application locally, install the
203
204
  [markdown-up](https://pypi.org/project/markdown-up/) viewer and point it at the Markdown file:
204
205
 
205
206
  ```
206
207
  pip install markdown-up
207
- markdown-up yourApp.md
208
+ markdown-up ticTacToe.md
208
209
  ```
209
210
 
210
211
  The BareScript library is also documented as single-page Markdown, which can be fetched directly
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = bare-script
3
- version = 4.2.2
3
+ version = 4.2.3
4
4
  url = https://github.com/craigahobbs/bare-script
5
5
  author = Craig A. Hobbs
6
6
  author_email = craigahobbs@gmail.com
@@ -87,19 +87,26 @@ endfunction
87
87
  # $arg model: The [data table model](model.html#var.vName='DataTable')
88
88
  # $return: The array of Markdown table line strings
89
89
  function dataTableMarkdown(data, model):
90
- # Determine the table fields
90
+ # Determine the table fields - categories first, then the value fields
91
91
  fields = []
92
92
  modelFields = if(model != null, objectGet(model, 'fields'))
93
93
  modelCategories = if(model != null, objectGet(model, 'categories'))
94
- if modelFields != null || modelCategories != null:
95
- if modelCategories != null:
96
- arrayExtend(fields, modelCategories)
97
- endif
98
- if modelFields != null:
99
- arrayExtend(fields, modelFields)
100
- endif
101
- elif arrayLength(data) > 0:
102
- arrayExtend(fields, objectKeys(arrayGet(data, 0)))
94
+ if modelCategories != null:
95
+ arrayExtend(fields, modelCategories)
96
+ endif
97
+ if modelFields != null:
98
+ arrayExtend(fields, modelFields)
99
+ else:
100
+ # Compute the data's fields (union of all row keys), excluding category fields
101
+ fieldNames = {}
102
+ for row in data:
103
+ for field in objectKeys(row):
104
+ if modelCategories == null || arrayIndexOf(modelCategories, field) == -1:
105
+ objectSet(fieldNames, field, null)
106
+ endif
107
+ endfor
108
+ endfor
109
+ arrayExtend(fields, objectKeys(fieldNames))
103
110
  endif
104
111
  if !arrayLength(fields):
105
112
  return null
@@ -118,7 +125,6 @@ function dataTableMarkdown(data, model):
118
125
  endfor
119
126
 
120
127
  # Compute the formatted field value strings and widths
121
- hasDatetimeFormat = precisionDatetime != null
122
128
  dataFormat = []
123
129
  for row in data:
124
130
  rowFormat = {}
@@ -127,10 +133,8 @@ function dataTableMarkdown(data, model):
127
133
  # Format the value (newline regex only on string/other types - numbers and datetimes can't contain newlines)
128
134
  value = objectGet(row, field)
129
135
  valueType = systemType(value)
130
- if valueType == 'number':
131
- valueFormat = numberToFixed(value, precisionNumber, precisionTrim)
132
- elif valueType == 'datetime':
133
- valueFormat = datetimeISOFormat(value, hasDatetimeFormat)
136
+ if valueType == 'number' || valueType == 'datetime':
137
+ valueFormat = dataUtilFormatValue(value, precisionNumber, precisionDatetime, precisionTrim)
134
138
  else:
135
139
  valueFormat = if(valueType == 'string', stringTrim(value), stringNew(value))
136
140
  valueFormat = regexReplace(dataTableMarkdownRegexMultipleNewline, valueFormat, '<br><br>')
@@ -148,7 +152,7 @@ function dataTableMarkdown(data, model):
148
152
  endfor
149
153
  endfor
150
154
 
151
- # Precompute per-field rendering metadata: [field, width, align, header]
155
+ # Precompute per-field rendering metadata: [field, width, align, header, isCategory]
152
156
  fieldMeta = []
153
157
  for field in fields:
154
158
  format = if(formats != null, objectGet(formats, field))
@@ -156,7 +160,8 @@ function dataTableMarkdown(data, model):
156
160
  field, \
157
161
  objectGet(widths, field), \
158
162
  if(format != null, objectGet(format, 'align')), \
159
- if(format != null, objectGet(format, 'header', field), field) \
163
+ if(format != null, objectGet(format, 'header', field), field), \
164
+ modelCategories != null && arrayIndexOf(modelCategories, field) != -1 \
160
165
  ])
161
166
  endfor
162
167
 
@@ -186,14 +191,24 @@ function dataTableMarkdown(data, model):
186
191
  arrayPush(lines, headerFields)
187
192
  arrayPush(lines, headerSeparator)
188
193
 
189
- # Output each row
190
- for row in dataFormat:
194
+ # Output each row, blanking duplicate leading category cell values
195
+ for row, ixRow in dataFormat:
196
+ rowRaw = arrayGet(data, ixRow)
197
+ rowPrevRaw = if(ixRow > 0, arrayGet(data, ixRow - 1))
198
+ skip = rowPrevRaw != null
191
199
  parts = []
192
200
  for meta in fieldMeta:
193
201
  field = arrayGet(meta, 0)
194
202
  width = arrayGet(meta, 1)
195
203
  align = arrayGet(meta, 2)
196
- arrayPush(parts, dataTableMarkdownField(objectGet(row, field), width, align, ' '))
204
+
205
+ # Skip this value? (blank a category cell matching the previous row)
206
+ if skip:
207
+ isCategory = arrayGet(meta, 4)
208
+ skip = isCategory && systemCompare(objectGet(rowRaw, field), objectGet(rowPrevRaw, field)) == 0
209
+ endif
210
+
211
+ arrayPush(parts, dataTableMarkdownField(if(skip, '', objectGet(row, field)), width, align, ' '))
197
212
  endfor
198
213
  arrayPush(lines, '| ' + arrayJoin(parts, ' | ') + ' |')
199
214
  endfor
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bare-script
3
- Version: 4.2.2
3
+ Version: 4.2.3
4
4
  Summary: bare-script
5
5
  Home-page: https://github.com/craigahobbs/bare-script
6
6
  Author: Craig A. Hobbs
@@ -219,17 +219,18 @@ cp SKILL.md .claude/skills/bare-script/SKILL.md
219
219
  Use `~/.claude/skills/bare-script/SKILL.md` instead to make it available across all projects. For
220
220
  other assistants, include the file's contents in your system prompt or rules file.
221
221
 
222
- Once installed, you can prompt the assistant with tasks like:
222
+ Once installed, prompt the assistant with a task like:
223
223
 
224
- > Build a MarkdownUp application that plays tic-tac-toe against the user, with a reset button
225
- > and a running win/loss/draw tally rendered as a bar chart.
224
+ ```
225
+ claude "Build a MarkdownUp application that plays tic-tac-toe against the user, with a reset button and a running win/loss/draw tally rendered as a bar chart. Save it as ticTacToe.md"
226
+ ```
226
227
 
227
228
  To run the resulting MarkdownUp application locally, install the
228
229
  [markdown-up](https://pypi.org/project/markdown-up/) viewer and point it at the Markdown file:
229
230
 
230
231
  ```
231
232
  pip install markdown-up
232
- markdown-up yourApp.md
233
+ markdown-up ticTacToe.md
233
234
  ```
234
235
 
235
236
  The BareScript library is also documented as single-page Markdown, which can be fetched directly
File without changes
File without changes
File without changes