bare-script 4.1.5__tar.gz → 4.1.9__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.1.5/src/bare_script.egg-info → bare_script-4.1.9}/PKG-INFO +1 -1
  2. {bare_script-4.1.5 → bare_script-4.1.9}/setup.cfg +1 -1
  3. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/include/markdownHighlight.bare +68 -60
  4. {bare_script-4.1.5 → bare_script-4.1.9/src/bare_script.egg-info}/PKG-INFO +1 -1
  5. {bare_script-4.1.5 → bare_script-4.1.9}/LICENSE +0 -0
  6. {bare_script-4.1.5 → bare_script-4.1.9}/README.md +0 -0
  7. {bare_script-4.1.5 → bare_script-4.1.9}/pyproject.toml +0 -0
  8. {bare_script-4.1.5 → bare_script-4.1.9}/setup.py +0 -0
  9. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/__init__.py +0 -0
  10. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/__main__.py +0 -0
  11. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/bare.py +0 -0
  12. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/include/__init__.py +0 -0
  13. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/include/args.bare +0 -0
  14. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/include/baredoc.bare +0 -0
  15. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/include/baredocCLI.bare +0 -0
  16. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/include/data.bare +0 -0
  17. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/include/dataLineChart.bare +0 -0
  18. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/include/dataTable.bare +0 -0
  19. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/include/dataUtil.bare +0 -0
  20. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/include/diff.bare +0 -0
  21. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/include/draw.bare +0 -0
  22. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/include/elementModel.bare +0 -0
  23. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/include/forms.bare +0 -0
  24. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/include/markdown.bare +0 -0
  25. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/include/markdownElements.bare +0 -0
  26. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/include/markdownParser.bare +0 -0
  27. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/include/markdownUp.bare +0 -0
  28. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/include/pager.bare +0 -0
  29. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/include/qrcode.bare +0 -0
  30. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/include/schemaDoc.bare +0 -0
  31. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/include/unittest.bare +0 -0
  32. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/include/unittestMock.bare +0 -0
  33. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/library.py +0 -0
  34. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/model.py +0 -0
  35. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/options.py +0 -0
  36. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/parser.py +0 -0
  37. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/runtime.py +0 -0
  38. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/runtime_c.c +0 -0
  39. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script/value.py +0 -0
  40. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script.egg-info/SOURCES.txt +0 -0
  41. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script.egg-info/dependency_links.txt +0 -0
  42. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script.egg-info/entry_points.txt +0 -0
  43. {bare_script-4.1.5 → bare_script-4.1.9}/src/bare_script.egg-info/requires.txt +0 -0
  44. {bare_script-4.1.5 → bare_script-4.1.9}/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.1.5
3
+ Version: 4.1.9
4
4
  Summary: bare-script
5
5
  Home-page: https://github.com/craigahobbs/bare-script
6
6
  Author: Craig A. Hobbs
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = bare-script
3
- version = 4.1.5
3
+ version = 4.1.9
4
4
  url = https://github.com/craigahobbs/bare-script
5
5
  author = Craig A. Hobbs
6
6
  author_email = craigahobbs@gmail.com
@@ -165,90 +165,98 @@ function markdownHighlightElements(highlightRegex, lines, options):
165
165
  # Join the text lines
166
166
  text = arrayJoin(lines, '\n') + '\n'
167
167
 
168
- # The copy link elements
168
+ # The copy button element
169
169
  preAttr = null
170
+ codeAttr = null
170
171
  copyElements = null
171
172
  if options && objectGet(options, 'copyLinks'):
172
173
  # Increment the copy links ID index
173
174
  copyLinksIndex = objectGet(options, 'copyLinksIndex', 1)
174
175
  objectSet(options, 'copyLinksIndex', copyLinksIndex + 1)
175
176
 
176
- # Generate the code block ID and elements
177
+ # Generate the code block ID and copy button element
177
178
  preID = '__markdown_copy_' + copyLinksIndex
178
- preAttr = {'id': preID, 'style': 'margin-top: 0.25em'}
179
+ preAttr = {'id': preID, 'style': 'display: flex;'}
180
+ codeAttr = {'style': 'flex: 1; min-width: 0; overflow-x: auto;'}
179
181
  copyElements = { \
180
- 'html': 'p', \
182
+ 'svg': 'svg', \
181
183
  'attr': { \
182
- 'style': 'cursor: pointer; font-size: 0.85em; text-align: right; user-select: none;' \
184
+ 'width': '20', \
185
+ 'height': '20', \
186
+ 'viewBox': '0 0 24 24', \
187
+ 'style': 'align-self: flex-start; flex-shrink: 0; cursor: pointer; user-select: none;', \
188
+ 'onclick': "window.navigator.clipboard.writeText(document.getElementById('" + preID + "').innerText);" \
183
189
  }, \
184
190
  'elem': { \
185
- 'html': 'a', \
191
+ 'svg': 'path', \
186
192
  'attr': { \
187
- 'onclick': "window.navigator.clipboard.writeText(document.getElementById('" + preID + "').innerText);" \
188
- }, \
189
- 'elem': {'text': 'Copy'} \
193
+ 'fill': 'var(--barescript-color-border)', \
194
+ 'd': 'M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z' \
195
+ } \
190
196
  } \
191
197
  }
192
198
  endif
193
199
 
194
- # No language specified or unknown language?
200
+ # Determine the code element children
195
201
  if !highlightRegex:
196
- return [ \
197
- copyElements, \
198
- {'html': 'pre', 'attr': preAttr, 'elem': {'html': 'code', 'elem': {'text': text}}} \
199
- ]
200
- endif
201
-
202
- # Match the highlight spans
203
- spans = []
204
- ixSearch = 0
205
- for mHighlight in regexMatchAll(highlightRegex, text):
206
- matchGroups = objectGet(mHighlight, 'groups')
207
- highlightText = objectGet(matchGroups, '0')
208
- highlightIndex = objectGet(mHighlight, 'index')
209
-
210
- # Add the pre-text span
211
- if ixSearch < highlightIndex:
212
- arrayPush(spans, {'text': stringSlice(text, ixSearch, highlightIndex)})
213
- endif
202
+ # No language specified or unknown language
203
+ codeChildren = {'text': text}
204
+ else:
205
+ # Match the highlight spans
206
+ codeChildren = []
207
+ ixSearch = 0
208
+ for mHighlight in regexMatchAll(highlightRegex, text):
209
+ matchGroups = objectGet(mHighlight, 'groups')
210
+ highlightText = objectGet(matchGroups, '0')
211
+ highlightIndex = objectGet(mHighlight, 'index')
212
+
213
+ # Add the pre-text span
214
+ if ixSearch < highlightIndex:
215
+ arrayPush(codeChildren, {'text': stringSlice(text, ixSearch, highlightIndex)})
216
+ endif
214
217
 
215
- # Determine the highlight style from which named group matched
216
- if objectGet(matchGroups, 'builtin'):
217
- attrStyle = 'color: var(--barescript-color-highlight-builtin);'
218
- elif objectGet(matchGroups, 'comment'):
219
- attrStyle = 'color: var(--barescript-color-highlight-comment);'
220
- elif objectGet(matchGroups, 'keyword'):
221
- attrStyle = 'color: var(--barescript-color-highlight-keyword);'
222
- elif objectGet(matchGroups, 'literal'):
223
- attrStyle = 'color: var(--barescript-color-highlight-literal);'
224
- elif objectGet(matchGroups, 'preprocessor'):
225
- attrStyle = 'color: var(--barescript-color-highlight-preprocessor);'
226
- elif objectGet(matchGroups, 'string'):
227
- attrStyle = 'color: var(--barescript-color-highlight-string);'
228
- elif objectGet(matchGroups, 'tag'):
229
- attrStyle = 'color: var(--barescript-color-highlight-tag);'
230
- endif
218
+ # Determine the highlight style from which named group matched
219
+ if objectGet(matchGroups, 'builtin'):
220
+ attrStyle = 'color: var(--barescript-color-highlight-builtin);'
221
+ elif objectGet(matchGroups, 'comment'):
222
+ attrStyle = 'color: var(--barescript-color-highlight-comment);'
223
+ elif objectGet(matchGroups, 'keyword'):
224
+ attrStyle = 'color: var(--barescript-color-highlight-keyword);'
225
+ elif objectGet(matchGroups, 'literal'):
226
+ attrStyle = 'color: var(--barescript-color-highlight-literal);'
227
+ elif objectGet(matchGroups, 'preprocessor'):
228
+ attrStyle = 'color: var(--barescript-color-highlight-preprocessor);'
229
+ elif objectGet(matchGroups, 'string'):
230
+ attrStyle = 'color: var(--barescript-color-highlight-string);'
231
+ elif objectGet(matchGroups, 'tag'):
232
+ attrStyle = 'color: var(--barescript-color-highlight-tag);'
233
+ endif
231
234
 
232
- # Add the highlight span
233
- arrayPush(spans, { \
234
- 'html': 'span', \
235
- 'attr': {'style': attrStyle}, \
236
- 'elem': {'text': highlightText} \
237
- })
235
+ # Add the highlight span
236
+ arrayPush(codeChildren, { \
237
+ 'html': 'span', \
238
+ 'attr': {'style': attrStyle}, \
239
+ 'elem': {'text': highlightText} \
240
+ })
238
241
 
239
- ixSearch = highlightIndex + stringLength(highlightText)
240
- endfor
242
+ ixSearch = highlightIndex + stringLength(highlightText)
243
+ endfor
241
244
 
242
- # Add the final un-matched text
243
- if ixSearch < stringLength(text):
244
- arrayPush(spans, {'text': stringSlice(text, ixSearch)})
245
+ # Add the final un-matched text
246
+ if ixSearch < stringLength(text):
247
+ arrayPush(codeChildren, {'text': stringSlice(text, ixSearch)})
248
+ endif
245
249
  endif
246
250
 
247
- # Create the code block elements
248
- return [ \
249
- copyElements, \
250
- {'html': 'pre', 'attr': preAttr, 'elem': {'html': 'code', 'elem': spans}} \
251
- ]
251
+ # Create the code block element, including the copy button when present
252
+ if !copyElements:
253
+ return {'html': 'pre', 'attr': preAttr, 'elem': {'html': 'code', 'elem': codeChildren}}
254
+ endif
255
+ return { \
256
+ 'html': 'pre', \
257
+ 'attr': preAttr, \
258
+ 'elem': [{'html': 'code', 'attr': codeAttr, 'elem': codeChildren}, copyElements] \
259
+ }
252
260
  endfunction
253
261
 
254
262
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bare-script
3
- Version: 4.1.5
3
+ Version: 4.1.9
4
4
  Summary: bare-script
5
5
  Home-page: https://github.com/craigahobbs/bare-script
6
6
  Author: Craig A. Hobbs
File without changes
File without changes
File without changes
File without changes