Skip to content

Commit 7c7a552

Browse files
committed
Add an example "Using Plotance as a Tool"
1 parent 81183b2 commit 7c7a552

File tree

6 files changed

+4920
-9
lines changed

6 files changed

+4920
-9
lines changed

src/common.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ pre {
121121
word-break: break-all;
122122
}
123123

124-
ul {
124+
ul, ol {
125125
padding: 0 0 0 2em;
126126
}
127127

src/examples.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ a > img {
88
border-color: var(--example-box-border-color);
99
}
1010

11-
main ul {
11+
ul.files {
1212
padding: 0;
1313

1414
> li {

src/examples.html

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ <h1>Examples</h1>
2222

2323
<section>
2424
<h2>Hello!</h2>
25-
<ul>
25+
<ul class="files">
2626
<li><a href="./examples/hello/hello.pptx"><img src="./examples/hello/hello.svg" alt="hello.pptx"/></a></li>
2727
<li><a href="./examples/hello/hello.md">hello.md</a></li>
2828
<li><a href="./examples/hello/hello.csv">hello.csv</a></li>
@@ -31,7 +31,7 @@ <h2>Hello!</h2>
3131

3232
<section>
3333
<h2>Variables and Template file</h2>
34-
<ul>
34+
<ul class="files">
3535
<li><a href="./examples/pageviews/pageviews.pptx"><img src="./examples/pageviews/pageviews.svg" alt="pageviews.pptx"/></a></li>
3636
<li><a href="./examples/pageviews/pageviews.md">pageviews.md</a></li>
3737
<li><a href="./examples/pageviews/access_2025-01.csv.gz">access_2025-01.csv.gz</a></li>
@@ -47,7 +47,7 @@ <h2>Variables and Template file</h2>
4747

4848
<section>
4949
<h2>Grid Layout</h2>
50-
<ul>
50+
<ul class="files">
5151
<li><a href="./examples/grid/grid.pptx"><img src="./examples/grid/grid.svg" alt="grid.pptx"/></a></li>
5252
<li><a href="./examples/grid/grid.md">grid.md</a></li>
5353
<li><a href="./examples/grid/grid1.csv">grid1.csv</a></li>
@@ -58,15 +58,15 @@ <h2>Grid Layout</h2>
5858
<section>
5959
<h2>Sections</h2>
6060

61-
<ul>
61+
<ul class="files">
6262
<li><a href="./examples/title_and_sections/title_and_sections.pptx"><img src="./examples/title_and_sections/title_and_sections/slide1.svg" alt="title_and_sections.pptx"/> <img src="./examples/title_and_sections/title_and_sections/slide2.svg" alt=""/> <img src="./examples/title_and_sections/title_and_sections/slide3.svg" alt=""/> <img src="./examples/title_and_sections/title_and_sections/slide4.svg" alt=""/></a></li>
6363
<li><a href="./examples/title_and_sections/title_and_sections.md">title_and_sections.md</a></li>
6464
</ul>
6565
</section>
6666

6767
<section>
6868
<h2>Charts</h2>
69-
<ul>
69+
<ul class="files">
7070
<li><a href="./examples/chart_types/chart_types.pptx"><img src="./examples/chart_types/chart_types.svg" alt="chart_types.pptx"/></a></li>
7171
<li><a href="./examples/chart_types/chart_types.md">chart_types.md</a></li>
7272
<li><a href="./examples/chart_types/bar.csv">bar.csv</a></li>
@@ -80,7 +80,7 @@ <h2>Charts</h2>
8080

8181
<section>
8282
<h2>Text Styles</h2>
83-
<ul>
83+
<ul class="files">
8484
<li><a href="./examples/text_styles/text_styles.pptx"><img src="./examples/text_styles/text_styles/slide1.svg" alt="text_styles.pptx"/> <img src="./examples/text_styles/text_styles/slide2.svg" alt=""/></a></li>
8585
<li><a href="./examples/text_styles/text_styles.md">text_styles.md</a></li>
8686
<li><a href="./examples/text_styles/image.jpg">image.jpg</a></li>
@@ -89,12 +89,52 @@ <h2>Text Styles</h2>
8989

9090
<section>
9191
<h2>Data Table</h2>
92-
<ul>
92+
<ul class="files">
9393
<li><a href="./examples/table/table.pptx"><img src="./examples/table/table.svg" alt="table.pptx"/></a></li>
9494
<li><a href="./examples/table/table.md">table.md</a></li>
9595
<li><a href="./examples/table/table.csv">table.csv</a></li>
9696
</ul>
9797
</section>
98+
99+
<section>
100+
<h2>Using Plotance as a Tool</h2>
101+
102+
103+
<p>Plotance can be used as a tool for generating .pptx files in Bash/PowerShell scripts. This example generates a catalog of Azure service icons. Due to license restrictions for Azure icons, we do not provide the resulting file.</p>
104+
105+
<p>The PowerShell script <code>Generate-AzureIconsSlides.ps1</code> performs the following steps:</p>
106+
107+
<ol>
108+
<li>Downloads the ZIP archive of icons and extracts the files.</li>
109+
<li>Downloads the Plotance executable.</li>
110+
<li>Generates the Markdown file.</li>
111+
<li>Converts the Markdown file to the presentation file.</li>
112+
</ol>
113+
114+
<p>On windows, you may need to adjust the execution policy to run PowerShell scripts:</p>
115+
116+
<x-blockcode class="example-box">
117+
<x-l><span class="code-comment"># Save the current execution policy for the current shell session.</span></x-l>
118+
<x-l><span class="code-key">$oldExecutionPolicy</span> = <span class="code-identifier">Get-ExecutionPolicy</span> <span class="code-keyword">-Scope</span> Process</x-l>
119+
<x-l></x-l>
120+
<x-l><span class="code-comment"># Set the policy to "RemoteSigned", allowing local scripts and signed downloaded scripts to run.</span></x-l>
121+
<x-l><span class="code-identifier">Set-ExecutionPolicy</span> RemoteSigned <span class="code-keyword">-Scope</span> Process</x-l>
122+
<x-l></x-l>
123+
<x-l><span class="code-comment"># Unblock the script to allow execution.</span></x-l>
124+
<x-l><span class="code-identifier">Unblock-File</span> Generate-AzureIconsSlides.ps1</x-l>
125+
<x-l></x-l>
126+
<x-l><span class="code-comment"># Execute the script.</span></x-l>
127+
<x-l><span class="code-identifier">.\Generate-AzureIconsSlides.ps1</span></x-l>
128+
<x-l></x-l>
129+
<x-l><span class="code-comment"># Restore the original execution policy.</span></x-l>
130+
<x-l><span class="code-identifier">Set-ExecutionPolicy</span> <span class="code-key">$oldExecutionPolicy</span> <span class="code-keyword">-Scope</span> Process</x-l>
131+
</x-blockcode>
132+
133+
<ul class="files">
134+
<li><img src="./examples/azure_icons/azure_icons.svg" alt=""/></li>
135+
<li><a href="./examples/azure_icons/Generate-AzureIconsSlides.ps1">Generate-AzureIconsSlides.ps1</a></li>
136+
</ul>
137+
</section>
98138
</main>
99139

100140
<script type="application/yaml">

0 commit comments

Comments
 (0)