Skip to content

Commit

Permalink
v0.6.2 Calendar Headings
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinPacker committed Mar 19, 2022
1 parent 5f30b1b commit ec2f543
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 42 deletions.
62 changes: 42 additions & 20 deletions user-guide.html
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@
<h1 id="markdown-preprocessor-user-guide">Markdown Preprocessor User Guide<a class="headerlink" href="#markdown-preprocessor-user-guide" title="Permanent link"></a></h1>
<p>This document describes the mdpre Markdown preprocessor.</p>
<p>In this document we&rsquo;ll refer to it as &ldquo;mdpre&rdquo;, pronounced &ldquo;em dee pree&rdquo;.</p>
<p>This document was converted to HTML at 20&colon;05 on 17 March&comma; 2022.</p>
<p>This document was converted to HTML at 17&colon;02 on 19 March&comma; 2022.</p>
<h3 id="table-of-contents">Table Of Contents<a class="headerlink" href="#table-of-contents" title="Permanent link"></a></h3>
<ul>
<li><a href="#why-a-preprocessor">Why A Preprocessor?</a></li>
Expand Down Expand Up @@ -1482,17 +1482,26 @@ <h3 id="creating-a-calendar-month-table-with-cal">Creating A Calendar Month Tabl
<table>
<thead>
<tr>
<th align="center"><strong>Mo</strong></th>
<th align="center"><strong>Tu</strong></th>
<th align="center"><strong>We</strong></th>
<th align="center"><strong>Th</strong></th>
<th align="center"><strong>Fr</strong></th>
<th align="center"><strong>Sa</strong></th>
<th align="center"><strong>Su</strong></th>
<th align="center"></th>
<th align="center"></th>
<th align="center"></th>
<th align="center">November 2021</th>
<th align="center"></th>
<th align="center"></th>
<th align="center"></th>
</tr>
</thead>
<tbody>
<tr>
<td align="center"><strong>Mo</strong></td>
<td align="center"><strong>Tu</strong></td>
<td align="center"><strong>We</strong></td>
<td align="center"><strong>Th</strong></td>
<td align="center"><strong>Fr</strong></td>
<td align="center"><strong>Sa</strong></td>
<td align="center"><strong>Su</strong></td>
</tr>
<tr>
<td align="center"><br/></td>
<td align="center"><br/></td>
<td align="center">1<br/></td>
Expand Down Expand Up @@ -1539,18 +1548,22 @@ <h3 id="creating-a-calendar-month-table-with-cal">Creating A Calendar Month Tabl
</tr>
</tbody>
</table>
<p>This example (from November 2021) is the simplest case. You can enhance such a table in a number of ways.</p>
<p>This example is the simplest case. You can enhance such a table in a number of ways.</p>
<p>But here&rsquo;s the syntax to generate the above table:</p>
<pre><code>=cal 2021 12
<pre><code>=cal 2021 11
=endcal
</code></pre>
<p>The <code>=endcal</code> line is necessary because it enables more commands within the <code>=cal</code> / <code>=endcal</code> bracket.</p>
<p>You can control the height of the cells - in terms of the number of lines by specifying a third parameter:</p>
<pre><code>=cal 2021 12 3
<pre><code>=cal 2021 11 3
=endcal
</code></pre>
<p>In this example each cell is 3 lines high. The default is for each cell to be 2 lines high.</p>
<p><strong>Note:</strong> By repeated use of <code>=cal</code> and <code>=endcal</code> you can add multiple months to a document (for example a md2pptx-processed slide).</p>
<p><strong>Notes:</strong></p>
<ol>
<li>By repeated use of <code>=cal</code> and <code>=endcal</code> you can add multiple months to a document (for example a md2pptx-processed slide).</li>
<li>The rendering above isn&rsquo;t faithful because mdpre (at least in combination with md2pptx) creates a table where the month name spans the entire width of the table and the columns are evenly sized.</li>
</ol>
<p>Here is an example of a calendar that uses all the capabilities (described below):</p>
<pre><code>=cal 2021 12 3
=caldays blue 14-17
Expand All @@ -1568,17 +1581,26 @@ <h3 id="creating-a-calendar-month-table-with-cal">Creating A Calendar Month Tabl
<table>
<thead>
<tr>
<th align="center"><strong>Mo</strong></th>
<th align="center"><strong>Tu</strong></th>
<th align="center"><strong>We</strong></th>
<th align="center"><strong>Th</strong></th>
<th align="center"><strong>Fr</strong></th>
<th align="center"><strong>Sa</strong></th>
<th align="center"><strong>Su</strong></th>
<th align="center">December 2021</th>
<th align="center"></th>
<th align="center"></th>
<th align="center"></th>
<th align="center"></th>
<th align="center"></th>
<th align="center"></th>
</tr>
</thead>
<tbody>
<tr>
<td align="center"><strong>Mo</strong></td>
<td align="center"><strong>Tu</strong></td>
<td align="center"><strong>We</strong></td>
<td align="center"><strong>Th</strong></td>
<td align="center"><strong>Fr</strong></td>
<td align="center"><strong>Sa</strong></td>
<td align="center"><strong>Su</strong></td>
</tr>
<tr>
<td align="center"><br/><br/></td>
<td align="center"><br/><br/></td>
<td align="center">1<br/><br/></td>
Expand Down Expand Up @@ -1634,7 +1656,7 @@ <h3 id="creating-a-calendar-month-table-with-cal">Creating A Calendar Month Tabl
<p>An unrelated bullet</p>
</li>
</ul>
<p>although in md2pptx the bullets would be coloured appropriately.</p>
<p>although in md2pptx the bullets would be coloured appropriately - and mdpre actually centres the month.</p>
<h4 id="controlling-how-day-numbers-are-displayed-with-caldays">Controlling How Day Numbers Are Displayed With <code>=caldays</code><a class="headerlink" href="#controlling-how-day-numbers-are-displayed-with-caldays" title="Permanent link"></a></h4>
<p>You can style days in the calendar with CSS using the <code>class</code> attribute. For example:</p>
<div class="highlight"><pre>=caldays blue 14 15 16 17
Expand Down
16 changes: 8 additions & 8 deletions user-guide.log
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

mdpre Markdown Preprocessor v0.6+ (17 March, 2022)
==================================================
mdpre Markdown Preprocessor v0.6.2 (19 March, 2022)
===================================================
- opened <stdout> for writing
Def mdpre_date = 17 March, 2022
Def mdpre_level = 0.6+
Def mdpre_date = 19 March, 2022
Def mdpre_level = 0.6.2
Def userid = martinpacker
Def time = 20&colon;05
Def date = 17 March&comma; 2022
Def time = 17&colon;02
Def date = 19 March&comma; 2022
Def TOC = Table Of Contents
Markdown Preprocessor User Guide
Table Of Contents - spec '2 * Table Of Contents'
Expand Down Expand Up @@ -56,7 +56,7 @@ Column Alignment - spec 'l l l'
Column Width - spec ' 2 4 1'
CSV Start
CSV Stop
--------------------------------------------------
---------------------------------------------------
- Processing completed.
--------------------------------------------------
---------------------------------------------------

21 changes: 13 additions & 8 deletions user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ This document describes the mdpre Markdown preprocessor.

In this document we'll refer to it as "mdpre", pronounced "em dee pree".

This document was converted to HTML at 20&colon;05 on 17 March&comma; 2022.
This document was converted to HTML at 17&colon;02 on 19 March&comma; 2022.

### Table Of Contents

Expand Down Expand Up @@ -469,31 +469,35 @@ Here the third column is specified as double the width of the others.

You can generate a Markdown table that shows all the days in a month. For example:

|**Mo**|**Tu**|**We**|**Th**|**Fr**|**Sa**|**Su**|
||||November 2021||||
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|**Mo**|**Tu**|**We**|**Th**|**Fr**|**Sa**|**Su**|
|<br/>|<br/>|1<br/>|2<br/>|3<br/>|4<br/>|5<br/>|
|6<br/>|7<br/>|8<br/>|9<br/>|10<br/>|11<br/>|12<br/>|
|13<br/>|14<br/>|15<br/>|16<br/>|17<br/>|18<br/>|19<br/>|
|20<br/>|21<br/>|22<br/>|23<br/>|24<br/>|25<br/>|26<br/>|
|27<br/>|28<br/>|29<br/>|30<br/>|31<br/>|

This example (from November 2021) is the simplest case. You can enhance such a table in a number of ways.
This example is the simplest case. You can enhance such a table in a number of ways.

But here's the syntax to generate the above table:

=cal 2021 12
=cal 2021 11
=endcal

The `=endcal` line is necessary because it enables more commands within the `=cal` / `=endcal` bracket.

You can control the height of the cells - in terms of the number of lines by specifying a third parameter:

=cal 2021 12 3
=cal 2021 11 3
=endcal

In this example each cell is 3 lines high. The default is for each cell to be 2 lines high.

**Note:** By repeated use of `=cal` and `=endcal` you can add multiple months to a document (for example a md2pptx-processed slide).
**Notes:**

1. By repeated use of `=cal` and `=endcal` you can add multiple months to a document (for example a md2pptx-processed slide).
2. The rendering above isn't faithful because mdpre (at least in combination with md2pptx) creates a table where the month name spans the entire width of the table and the columns are evenly sized.

Here is an example of a calendar that uses all the capabilities (described below):

Expand All @@ -511,8 +515,9 @@ Here is an example of a calendar that uses all the capabilities (described below

It produces something like this:

|**Mo**|**Tu**|**We**|**Th**|**Fr**|**Sa**|**Su**|
|December 2021|||||||
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|**Mo**|**Tu**|**We**|**Th**|**Fr**|**Sa**|**Su**|
|<br/><br/>|<br/><br/>|1<br/><br/>|2<br/><br/>|3<br/><br/>|4<br/>X<br/>|5<br/><br/>|
|6<br/><br/>|7<br/><br/>|8<br/><br/>|9<br/><br/>|10<br/><br/>|11<br/><br/>|12<br/><br/>|
|13<br/><br/>|<span class='blue'>14</span><br/><br/>|<span class='blue'>15</span><br/><br/>|<span class='blue'>16</span><br/><br/>|<span class='blue'>17</span><br/>A<br/>|<span class='orange'>18</span><br/><span class="green">B</span><br/>|19<br/><br/>|
Expand All @@ -525,7 +530,7 @@ It produces something like this:

* An unrelated bullet

although in md2pptx the bullets would be coloured appropriately.
although in md2pptx the bullets would be coloured appropriately - and mdpre actually centres the month.

#### Controlling How Day Numbers Are Displayed With `=caldays`

Expand Down
16 changes: 10 additions & 6 deletions user-guide.mdp
Original file line number Diff line number Diff line change
Expand Up @@ -458,33 +458,37 @@ Here the third column is specified as double the width of the others.

You can generate a Markdown table that shows all the days in a month. For example:

|**Mo**|**Tu**|**We**|**Th**|**Fr**|**Sa**|**Su**|
||||November 2021||||
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|**Mo**|**Tu**|**We**|**Th**|**Fr**|**Sa**|**Su**|
|<br/>|<br/>|1<br/>|2<br/>|3<br/>|4<br/>|5<br/>|
|6<br/>|7<br/>|8<br/>|9<br/>|10<br/>|11<br/>|12<br/>|
|13<br/>|14<br/>|15<br/>|16<br/>|17<br/>|18<br/>|19<br/>|
|20<br/>|21<br/>|22<br/>|23<br/>|24<br/>|25<br/>|26<br/>|
|27<br/>|28<br/>|29<br/>|30<br/>|31<br/>|

This example (from November 2021) is the simplest case. \
This example is the simplest case. \
You can enhance such a table in a number of ways.

But here's the syntax to generate the above table:

=cal 2021 12
=cal 2021 11
=endcal

The `=endcal` line is necessary because it enables more commands within the `=cal` / `=endcal` bracket.

You can control the height of the cells - in terms of the number of lines by specifying a third parameter:

=cal 2021 12 3
=cal 2021 11 3
=endcal

In this example each cell is 3 lines high. \
The default is for each cell to be 2 lines high.

**Note:** By repeated use of `=cal` and `=endcal` you can add multiple months to a document (for example a md2pptx-processed slide).
**Notes:**

1. By repeated use of `=cal` and `=endcal` you can add multiple months to a document (for example a md2pptx-processed slide).
2. The rendering above isn't faithful because mdpre (at least in combination with md2pptx) creates a table where the month name spans the entire width of the table and the columns are evenly sized.

Here is an example of a calendar that uses all the capabilities (described below):

Expand Down Expand Up @@ -514,7 +518,7 @@ It produces something like this:

* An unrelated bullet

although in md2pptx the bullets would be coloured appropriately.
although in md2pptx the bullets would be coloured appropriately - and mdpre actually centres the month.

#### Controlling How Day Numbers Are Displayed With `=caldays`

Expand Down

0 comments on commit ec2f543

Please sign in to comment.