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