Skip to content

Commit

Permalink
v5.3.1 More Annotations And Table Shadows
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinPacker committed Feb 16, 2025
1 parent 699bb64 commit 98aefb0
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 16 deletions.
12 changes: 7 additions & 5 deletions docs/user-guide.html
Original file line number Diff line number Diff line change
Expand Up @@ -1635,9 +1635,9 @@ <h2 id="change-log">Change Log<a class="headerlink" href="#change-log" title="Pe
</thead>
<tbody>
<tr>
<td align="left">5.3+</td>
<td align="right">15&nbsp;February&nbsp;2025</td>
<td align="left">Added a double-headed arrow&comma; double lines&comma; and line widths to <a href="#annotations-related-helper-routines">Annotations</a>. Added optional drop shadows for tables with <a href="#controlling-whether-tables-have-drop-shadows-tableshadow"><code>tableShadow</code></a>.</td>
<td align="left">5.3.1</td>
<td align="right">16&nbsp;February&nbsp;2025</td>
<td align="left">Added a double-headed arrow&comma; an oval&comma; double lines&comma; and line widths to <a href="#annotations-related-helper-routines">Annotations</a>. Added optional drop shadows for tables with <a href="#controlling-whether-tables-have-drop-shadows-tableshadow"><code>tableShadow</code></a>.</td>
</tr>
<tr>
<td align="left">5.3</td>
Expand Down Expand Up @@ -5110,6 +5110,7 @@ <h4 id="annotations-related-helper-routines">Annotations-Related Helper routines
<ul>
<li>Lines, with or without line ending arrow heads</li>
<li>Rectangles, with or without rounded corners, with or without text</li>
<li>Ovals, with or without text</li>
<li>Images</li>
</ul>
<p>The foreground colour can be set for each annotation.
Expand Down Expand Up @@ -5145,12 +5146,13 @@ <h4 id="annotations-related-helper-routines">Annotations-Related Helper routines
<p>An optional line colour can be specified as the sixth item. For example <code>#FF0000</code> or <code>ACCENT 1</code>.</p>
</li>
<li>
<p>For a rectangle the fifth item is one of <code>[]</code>, <code>[-]</code>, <code>[=]</code>, <code>()</code>, <code>(-)</code>, or <code>(=)</code>:</p>
<p>For a rectangle or oval the fifth item is one of <code>[]</code>, <code>[-]</code>, <code>[=]</code>, <code>()</code>, <code>(-)</code>, <code>(=)</code>, <code>o</code>, or <code>O</code>:</p>
<ul>
<li><code>[]</code>, <code>[-]</code>, and <code>[=]</code> denote a rectangle without rounded corners. The first two denote the border line is single, the third double.</li>
<li><code>()</code>, <code>(-)</code>, and <code>(=)</code> denote a rectangle with rounded corners. The first two denote the border line is single, the third double.</li>
<li><code>o</code> and <code>O</code> denote an oval. The first denotes the line is single, the second double.</li>
</ul>
<p>If there is a non-empty sixth item it is text to be centred in the rectangle.
<p>If there is a non-empty sixth item it is text to be centred in the shape.
If there is a non-empty seventh item it is the foreground colour.
If there is a non-empty eighth item it is the background colour.</p>
</li>
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 = 14&colon;55
Def date = 15 February&comma; 2025
Def time = 11&colon;24
Def date = 16 February&comma; 2025
Def TOC = Table Of Contents
Def md = Markdown
Def pp = Powerpoint
Expand Down
8 changes: 5 additions & 3 deletions docs/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ To quote from the python-pptx license statement:

|Level|Date|What|
|:-|-:|:-|
|5.3+|15&nbsp;February&nbsp;2025|Added a double-headed arrow&comma; double lines&comma; and line widths to [Annotations](#annotations-related-helper-routines). Added optional drop shadows for tables with [`tableShadow`](#controlling-whether-tables-have-drop-shadows-tableshadow).|
|5.3.1|16&nbsp;February&nbsp;2025|Added a double-headed arrow&comma; an oval&comma; double lines&comma; and line widths to [Annotations](#annotations-related-helper-routines). Added optional drop shadows for tables with [`tableShadow`](#controlling-whether-tables-have-drop-shadows-tableshadow).|
|5.3|11&nbsp;February&nbsp;2025|Added [Annotations](#annotations-related-helper-routines) to [`run-python`](#running-inline-python).|
|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.|
Expand Down Expand Up @@ -4153,6 +4153,7 @@ A number of annotation types are supported:

* Lines, with or without line ending arrow heads
* Rectangles, with or without rounded corners, with or without text
* Ovals, with or without text
* Images

The foreground colour can be set for each annotation.
Expand Down Expand Up @@ -4191,11 +4192,12 @@ The remainder of the list / line depends on the type of the annotation:

An optional line colour can be specified as the sixth item. For example `#FF0000` or `ACCENT 1`.

* For a rectangle the fifth item is one of `[]`, `[-]`, `[=]`, `()`, `(-)`, or `(=)`:
* For a rectangle or oval the fifth item is one of `[]`, `[-]`, `[=]`, `()`, `(-)`, `(=)`, `o`, or `O`:
* `[]`, `[-]`, and `[=]` denote a rectangle without rounded corners. The first two denote the border line is single, the third double.
* `()`, `(-)`, and `(=)` denote a rectangle with rounded corners. The first two denote the border line is single, the third double.
* `o` and `O` denote an oval. The first denotes the line is single, the second double.

If there is a non-empty sixth item it is text to be centred in the rectangle.
If there is a non-empty sixth item it is text to be centred in the shape.
If there is a non-empty seventh item it is the foreground colour.
If there is a non-empty eighth item it is the background colour.

Expand Down
8 changes: 5 additions & 3 deletions docs/user-guide.mdp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ To quote from the python-pptx license statement:
=colalign l r l
=csv
Level,Date,What
5.3+,15&nbsp;February&nbsp;2025,Added a double-headed arrow&comma; double lines&comma; and line widths to [Annotations](#annotations-related-helper-routines). Added optional drop shadows for tables with [`tableShadow`](#controlling-whether-tables-have-drop-shadows-tableshadow).
5.3.1,16&nbsp;February&nbsp;2025,Added a double-headed arrow&comma; an oval&comma; double lines&comma; and line widths to [Annotations](#annotations-related-helper-routines). Added optional drop shadows for tables with [`tableShadow`](#controlling-whether-tables-have-drop-shadows-tableshadow).
5.3,11&nbsp;February&nbsp;2025,Added [Annotations](#annotations-related-helper-routines) to [`run-python`](#running-inline-python).
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.
Expand Down Expand Up @@ -4220,6 +4220,7 @@ A number of annotation types are supported:

* Lines, with or without line ending arrow heads
* Rectangles, with or without rounded corners, with or without text
* Ovals, with or without text
* Images

The foreground colour can be set for each annotation.
Expand Down Expand Up @@ -4258,11 +4259,12 @@ The remainder of the list / line depends on the type of the annotation:

An optional line colour can be specified as the sixth item. For example `#FF0000` or `ACCENT 1`.

* For a rectangle the fifth item is one of `[]`, `[-]`, `[=]`, `()`, `(-)`, or `(=)`:
* For a rectangle or oval the fifth item is one of `[]`, `[-]`, `[=]`, `()`, `(-)`, `(=)`, `o`, or `O`:
* `[]`, `[-]`, and `[=]` denote a rectangle without rounded corners. The first two denote the border line is single, the third double.
* `()`, `(-)`, and `(=)` denote a rectangle with rounded corners. The first two denote the border line is single, the third double.
* `o` and `O` denote an oval. The first denotes the line is single, the second double.

If there is a non-empty sixth item it is text to be centred in the rectangle.
If there is a non-empty sixth item it is text to be centred in the shape.
If there is a non-empty seventh item it is the foreground colour.
If there is a non-empty eighth item it is the background colour.

Expand Down
4 changes: 2 additions & 2 deletions md2pptx
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ except:
have_graphviz = False


md2pptx_level = "5.3+"
md2pptx_date = "15 February, 2025"
md2pptx_level = "5.3.1"
md2pptx_date = "16 February, 2025"

namespaceURL = {
"mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
Expand Down
13 changes: 12 additions & 1 deletion runPython.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,22 +421,33 @@ def doAnnotations(slide, annotationList, lineWidth = None, shapeWidth = None):
elif text[0] == "!":
filename = text[1:]
slide.shapes.add_picture(filename, x, y, w, h)

elif text in [
"[]",
"()",
"[-]",
"(-)",
"[=]",
"(=)",
"o",
"O",
]:
if text in [
"[]",
"[-]",
"[=]",
]:
b = slide.shapes.add_shape(MSO_SHAPE.RECTANGLE, x, y, w, h)

elif text in [
"o",
"O",
]:
b = slide.shapes.add_shape(MSO_SHAPE.OVAL, x, y, w, h)

else:
b = slide.shapes.add_shape(MSO_SHAPE.ROUNDED_RECTANGLE, x, y, w, h)

if len(annotation) > 5:
b.text = annotation[5]
f = b.text_frame
Expand All @@ -460,7 +471,7 @@ def doAnnotations(slide, annotationList, lineWidth = None, shapeWidth = None):
if shapeWidth is not None:
b.line.width = Pt(float(shapeWidth))

if "=" in text:
if ("=" in text) | (text == "O"):
be = b._element
ln= b.get_or_add_ln()
ln.set("cmpd", "dbl")
Expand Down

0 comments on commit 98aefb0

Please sign in to comment.