Skip to content

Commit

Permalink
v5.2.2 richer checklist items
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinPacker committed Dec 31, 2024
1 parent c9ddd39 commit 2de0313
Show file tree
Hide file tree
Showing 9 changed files with 1,197 additions and 1,088 deletions.
27 changes: 26 additions & 1 deletion docs/user-guide.html
Original file line number Diff line number Diff line change
Expand Up @@ -1620,6 +1620,11 @@ <h2 id="change-log">Change Log<a class="headerlink" href="#change-log" title="Pe
</thead>
<tbody>
<tr>
<td align="left">5.2.2</td>
<td align="right">31&nbsp;December&nbsp;2024</td>
<td align="left"><a href="#checklist-related-helper-routines">Checklist</a> items can be richer&comma; for example using <code>&lt;span&gt;</code> elements.</td>
</tr>
<tr>
<td align="left">5.2.1</td>
<td align="right">23&nbsp;November&nbsp;2024</td>
<td align="left"><a href="#checklist-related-helper-routines">Checklist</a> items can be optionally coloured red or green&comma; according to status.</td>
Expand Down Expand Up @@ -4900,7 +4905,8 @@ <h6 id="output_10">Output<a class="headerlink" href="#output_10" title="Permanen
<ul>
<li>The created shape</li>
</ul>
<p><a id="checklist-related-helper-routines"></a></p>
<p><a id="checklistrelated-helper-routines"></a>
<a id="checklist-related-helper-routines"></a></p>
<h4 id="checklist-related-helper-routines">Checklist-Related Helper routines<a class="headerlink" href="#checklist-related-helper-routines" title="Permanent link"></a></h4>
<p>There are a number of functions that can help you make checklists, including pulling in a CSV file with status in.
These checklists can have ticked, crossed, or empty boxes - depending on the input data.</p>
Expand Down Expand Up @@ -4989,6 +4995,25 @@ <h6 id="output_13">Output<a class="headerlink" href="#output_13" title="Permanen
]
</pre></div>

<p>In this example the checklist items are plain text.
They can be more complex than that, perhaps with some words bolded or wrapped in a <code>&lt;span&gt;</code> element.
To do this simply ensure the first element of each item has the appropriate markup.
For example:
<div class="highlight"><pre>[
[&#39;Retrieved data&#39;, True, 1],
[&#39;Built databases&#39;, False, 1],
[&#39;Analysis&#39;, None, 1],
[&#39;Architectural Introduction&#39;, None, 2],
[&#39;CPU&#39;, None, 2],
[&#39;Memory and I/O&#39;, None, 2],
[&#39;WLM&#39;, None, 2],
[&#39;Parallel Sysplex&#39;, None, 2],
[&#39;&lt;span class=&quot;optional&quot;&gt;DDF&lt;/span&gt;&#39;, None, 2],
[&#39;Batch&#39;, None, 2],
[&#39;Workshop&#39;, None, 1],
[&#39;&lt;span class=&quot;Important&quot;&gt;Executive Summary&lt;/span&gt;&#39;, None]
]
</pre></div></p>
<p><a id="runpythondochecklistchecks"></a></p>
<h5 id="runpythondochecklistchecks">RunPython.doChecklistChecks<a class="headerlink" href="#runpythondochecklistchecks" title="Permanent link"></a></h5>
<p>This function adds check marks to the checklist items and, optionally, colours them to reflect their state.</p>
Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide.log
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ mdpre Markdown Preprocessor v0.6.9 (17 September, 2024)
Def mdpre_date = 17 September, 2024
Def mdpre_level = 0.6.9
Def userid = martinpacker
Def time = 13&colon;52
Def date = 23 November&comma; 2024
Def time = 15&colon;36
Def date = 31 December&comma; 2025
Def TOC = Table Of Contents
Def md = Markdown
Def pp = Powerpoint
Expand Down
23 changes: 23 additions & 0 deletions docs/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ To quote from the python-pptx license statement:

|Level|Date|What|
|:-|-:|:-|
|5.2.2|31&nbsp;December&nbsp;2024|[Checklist](#checklist-related-helper-routines) items can be richer&comma; for example using `<span>` elements.|
|5.2.1|23&nbsp;November&nbsp;2024|[Checklist](#checklist-related-helper-routines) items can be optionally coloured red or green&comma; according to status.|
|5.2|18&nbsp;November&nbsp;2024|Fixed symbol resolution in footers. Tweaked [`RunPython.ensureTextbox`](#runpythonensuretextbox). Added [`RunPython.removeBullet`](#runpythonremovebullet)&comma; [`RunPython.removeBullets`](#runpythonremovebullets)&comma; and [`RunPython.removeSelectedBullets`](#runpythonremoveselectedbullets). [Checklist](#checklist-related-helper-routines) items can be indented.|
|5.1|26&nbsp;August&nbsp;2024|Fixed failed `html` import for [Numeric Character References](#numeric-character-references).<br/>Added Python functions for [checklist creation](#checklist-related-helper-routines).|
Expand Down Expand Up @@ -3929,6 +3930,7 @@ This function draws a shape from a set of vertices, optionally filling it and ad

* The created shape

<a id="checklistrelated-helper-routines"></a>
<a id="checklist-related-helper-routines"></a>
#### Checklist-Related Helper routines

Expand Down Expand Up @@ -4033,6 +4035,27 @@ Here is an example of a checklist array:
]
```

In this example the checklist items are plain text.
They can be more complex than that, perhaps with some words bolded or wrapped in a `<span>` element.
To do this simply ensure the first element of each item has the appropriate markup.
For example:
```
[
['Retrieved data', True, 1],
['Built databases', False, 1],
['Analysis', None, 1],
['Architectural Introduction', None, 2],
['CPU', None, 2],
['Memory and I/O', None, 2],
['WLM', None, 2],
['Parallel Sysplex', None, 2],
['<span class="optional">DDF</span>', None, 2],
['Batch', None, 2],
['Workshop', None, 1],
['<span class="Important">Executive Summary</span>', None]
]
```

<a id="runpythondochecklistchecks"></a>
##### RunPython.doChecklistChecks

Expand Down
23 changes: 23 additions & 0 deletions docs/user-guide.mdp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ To quote from the python-pptx license statement:
=colalign l r l
=csv
Level,Date,What
5.2.2,31&nbsp;December&nbsp;2024,[Checklist](#checklist-related-helper-routines) items can be richer&comma; for example using `<span>` elements.
5.2.1,23&nbsp;November&nbsp;2024,[Checklist](#checklist-related-helper-routines) items can be optionally coloured red or green&comma; according to status.
5.2,18&nbsp;November&nbsp;2024,Fixed symbol resolution in footers. Tweaked [`RunPython.ensureTextbox`](#runpythonensuretextbox). Added [`RunPython.removeBullet`](#runpythonremovebullet)&comma; [`RunPython.removeBullets`](#runpythonremovebullets)&comma; and [`RunPython.removeSelectedBullets`](#runpythonremoveselectedbullets). [Checklist](#checklist-related-helper-routines) items can be indented.
5.1,26&nbsp;August&nbsp;2024,Fixed failed `html` import for [Numeric Character References](#numeric-character-references).<br/>Added Python functions for [checklist creation](#checklist-related-helper-routines).
Expand Down Expand Up @@ -4005,6 +4006,7 @@ This function draws a shape from a set of vertices, optionally filling it and ad

* The created shape

<a id="checklistrelated-helper-routines"></a>
<a id="checklist-related-helper-routines"></a>
#### Checklist-Related Helper routines

Expand Down Expand Up @@ -4109,6 +4111,27 @@ Here is an example of a checklist array:
]
```

In this example the checklist items are plain text.
They can be more complex than that, perhaps with some words bolded or wrapped in a `<span>` element.
To do this simply ensure the first element of each item has the appropriate markup.
For example:
```
[
['Retrieved data', True, 1],
['Built databases', False, 1],
['Analysis', None, 1],
['Architectural Introduction', None, 2],
['CPU', None, 2],
['Memory and I/O', None, 2],
['WLM', None, 2],
['Parallel Sysplex', None, 2],
['<span class="optional">DDF</span>', None, 2],
['Batch', None, 2],
['Workshop', None, 1],
['<span class="Important">Executive Summary</span>', None]
]
```

<a id="runpythondochecklistchecks"></a>
##### RunPython.doChecklistChecks

Expand Down
43 changes: 43 additions & 0 deletions globals.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
"""
globals.py
"""

import re

from processingOptions import ProcessingOptions

global processingOptions
processingOptions = ProcessingOptions()

global spanClassRegex
spanClassRegex = re.compile("<span( )*class=")

global spanStyleRegex
spanStyleRegex = re.compile("<span( )*style=")

######################################################################################
# #
# Prime for style. metadata #
# #
######################################################################################

# Background colour class correspondence
global bgcolors
bgcolors = {}

# Foreground colour class correspondence
global fgcolors
fgcolors = {}

# Emphases class correspondence
global emphases
emphases = {}

# Font size class correspondence
global fontsizes
fontsizes = {}



Loading

0 comments on commit 2de0313

Please sign in to comment.