Skip to content

Commit

Permalink
Merge pull request TEIC#528 from TEIC/issue_511_markdown_images
Browse files Browse the repository at this point in the history
First pass at issue TEIC#511: graphics to markdown images.
  • Loading branch information
sydb authored Nov 1, 2021
2 parents dbb661d + d5faf63 commit 2324a60
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 47 deletions.
4 changes: 2 additions & 2 deletions Test/expected-results/mdtest2.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ An external link as ref and as ptr: .
# Tables

Tables may have cells that span multiple columns and rows.
ImageDescriptionCamera directionSVG, JPEG, GIF or PNG formatAll pictures were taken on Jun 27, 2007 Mountain flowers. northSunset over a secondary ridge.north-eastGlacier lake at 2100m altitude.eastSpans HorizontallyHeader 3Spans HorizontallySpans VerticallyabcdeSpans bothfggijSpans Horizontallyklmno
ImageDescriptionCamera directionSVG, JPEG, GIF or PNG formatAll pictures were taken on Jun 27, 2007 ![graphic](nature1.jpg "graphic")Mountain flowers. north![graphic](nature2.jpg "graphic")Sunset over a secondary ridge.north-east![graphic](nature3.jpg "graphic")Glacier lake at 2100m altitude.eastSpans HorizontallyHeader 3Spans HorizontallySpans VerticallyabcdeSpans bothfggijSpans Horizontallyklmno
# Lists

Various sorts of list are legal within paragraphs, and you can reference items in lists...
Expand Down Expand Up @@ -141,7 +141,7 @@ banana


# Pictures
width="2.5in" width=".5in" scale=".5"width="1in"width="1in" style="border:solid green 2pt"height="1in"height="1in" width="2in"height="2in" width="1in"width="10%"height="10%" width="10%"
![graphic](portrait.jpg "graphic")width="2.5in" ![graphic](portrait.jpg "graphic"){: width="2.5in"}width=".5in" ![graphic](portrait.jpg "graphic"){: width="0.5in"}scale=".5"![graphic](portrait.jpg "graphic")width="1in"![graphic](portrait.jpg "graphic"){: width="1in"}width="1in" style="border:solid green 2pt"![graphic](portrait.jpg "graphic"){: width="1in"}height="1in"![graphic](portrait.jpg "graphic"){: height="1in"}height="1in" width="2in"![graphic](portrait.jpg "graphic"){: height="1in" width="2in"}height="2in" width="1in"![graphic](portrait.jpg "graphic"){: height="2in" width="1in"}width="10%"![graphic](portrait.jpg "graphic"){: width="10%"}height="10%" width="10%"![graphic](portrait.jpg "graphic"){: height="10%" width="10%"}
# MS catalogue
where is itrepository nameidentifier
# Extended prose: MARLEY'S GHOST
Expand Down
4 changes: 2 additions & 2 deletions Test/mdtest2.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ An external link as ref and as ptr: .
# Tables

Tables may have cells that span multiple columns and rows.
ImageDescriptionCamera directionSVG, JPEG, GIF or PNG formatAll pictures were taken on Jun 27, 2007 Mountain flowers. northSunset over a secondary ridge.north-eastGlacier lake at 2100m altitude.eastSpans HorizontallyHeader 3Spans HorizontallySpans VerticallyabcdeSpans bothfggijSpans Horizontallyklmno
ImageDescriptionCamera directionSVG, JPEG, GIF or PNG formatAll pictures were taken on Jun 27, 2007 ![graphic](nature1.jpg "graphic")Mountain flowers. north![graphic](nature2.jpg "graphic")Sunset over a secondary ridge.north-east![graphic](nature3.jpg "graphic")Glacier lake at 2100m altitude.eastSpans HorizontallyHeader 3Spans HorizontallySpans VerticallyabcdeSpans bothfggijSpans Horizontallyklmno
# Lists

Various sorts of list are legal within paragraphs, and you can reference items in lists...
Expand Down Expand Up @@ -141,7 +141,7 @@ banana


# Pictures
width="2.5in" width=".5in" scale=".5"width="1in"width="1in" style="border:solid green 2pt"height="1in"height="1in" width="2in"height="2in" width="1in"width="10%"height="10%" width="10%"
![graphic](portrait.jpg "graphic")width="2.5in" ![graphic](portrait.jpg "graphic"){: width="2.5in"}width=".5in" ![graphic](portrait.jpg "graphic"){: width="0.5in"}scale=".5"![graphic](portrait.jpg "graphic")width="1in"![graphic](portrait.jpg "graphic"){: width="1in"}width="1in" style="border:solid green 2pt"![graphic](portrait.jpg "graphic"){: width="1in"}height="1in"![graphic](portrait.jpg "graphic"){: height="1in"}height="1in" width="2in"![graphic](portrait.jpg "graphic"){: height="1in" width="2in"}height="2in" width="1in"![graphic](portrait.jpg "graphic"){: height="2in" width="1in"}width="10%"![graphic](portrait.jpg "graphic"){: width="10%"}height="10%" width="10%"![graphic](portrait.jpg "graphic"){: height="10%" width="10%"}
# MS catalogue
where is itrepository nameidentifier
# Extended prose: MARLEY'S GHOST
Expand Down
20 changes: 10 additions & 10 deletions Test2/expected-results/generalP5.fo
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,7 @@
</table-row>
<table-row>
<table-cell padding="2pt" text-align="left">
<block>width="2.5in" </block>
<block>portrait with a width of 2.5in</block>
</table-cell>
<table-cell padding="2pt" text-align="left">
<block>
Expand All @@ -1275,7 +1275,7 @@
</table-row>
<table-row>
<table-cell padding="2pt" text-align="left">
<block>width=".5in" </block>
<block>portrait with a width of 0.5in</block>
</table-cell>
<table-cell padding="2pt" text-align="left">
<block>
Expand All @@ -1287,7 +1287,7 @@
</table-row>
<table-row>
<table-cell padding="2pt" text-align="left">
<block>scale=".5"</block>
<block>portrait with a scale of .5</block>
</table-cell>
<table-cell padding="2pt" text-align="left">
<block>
Expand All @@ -1297,7 +1297,7 @@
</table-row>
<table-row>
<table-cell padding="2pt" text-align="left">
<block>width="1in"</block>
<block>portrait with a width of 1in</block>
</table-cell>
<table-cell padding="2pt" text-align="left">
<block>
Expand All @@ -1309,7 +1309,7 @@
</table-row>
<table-row>
<table-cell padding="2pt" text-align="left">
<block>width="1in" style="border:solid green 2pt"</block>
<block>portrait with a width of 1in and solid green 2pt border</block>
</table-cell>
<table-cell padding="2pt" text-align="left">
<block>
Expand All @@ -1321,7 +1321,7 @@
</table-row>
<table-row>
<table-cell padding="2pt" text-align="left">
<block>height="1in"</block>
<block>portrait with a height of 1in</block>
</table-cell>
<table-cell padding="2pt" text-align="left">
<block>
Expand All @@ -1333,7 +1333,7 @@
</table-row>
<table-row>
<table-cell padding="2pt" text-align="left">
<block>height="1in" width="2in"</block>
<block>portrait with a height of 1in and a width of 2in</block>
</table-cell>
<table-cell padding="2pt" text-align="left">
<block>
Expand All @@ -1346,7 +1346,7 @@
</table-row>
<table-row>
<table-cell padding="2pt" text-align="left">
<block>height="2in" width="1in"</block>
<block>portrait with a height of 2in and a width of 1in</block>
</table-cell>
<table-cell padding="2pt" text-align="left">
<block>
Expand All @@ -1359,7 +1359,7 @@
</table-row>
<table-row>
<table-cell padding="2pt" text-align="left">
<block>width="10%"</block>
<block>portrait with a width of 10%</block>
</table-cell>
<table-cell padding="2pt" text-align="left">
<block>
Expand All @@ -1371,7 +1371,7 @@
</table-row>
<table-row>
<table-cell padding="2pt" text-align="left">
<block>height="10%" width="10%"</block>
<block>portrait with both height &amp; width set to 10%</block>
</table-cell>
<table-cell padding="2pt" text-align="left">
<block>
Expand Down
4 changes: 2 additions & 2 deletions Test2/expected-results/generalP5.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ An external link as ref and as ptr: .
# Tables

Tables may have cells that span multiple columns and rows.
ImageDescriptionCamera directionSVG, JPEG, GIF or PNG formatAll pictures were taken on Jun 27, 2007 Mountain flowers. northSunset over a secondary ridge.north-eastGlacier lake at 2100m altitude.eastSpans HorizontallyHeader 3Spans HorizontallySpans VerticallyabcdeSpans bothfggijSpans Horizontallyklmno
ImageDescriptionCamera directionSVG, JPEG, GIF or PNG formatAll pictures were taken on Jun 27, 2007 ![graphic](./../Images/nature1.jpg "graphic")Mountain flowers. north![graphic](./../Images/nature2.jpg "graphic")Sunset over a secondary ridge.north-east![graphic](./../Images/nature3.jpg "graphic")Glacier lake at 2100m altitude.eastSpans HorizontallyHeader 3Spans HorizontallySpans VerticallyabcdeSpans bothfggijSpans Horizontallyklmno
# Lists

Various sorts of list are legal within paragraphs, and you can reference items in lists...
Expand Down Expand Up @@ -141,7 +141,7 @@ banana


# Pictures
width="2.5in" This description is here just to test desc child of graphic.width=".5in" scale=".5"width="1in"width="1in" style="border:solid green 2pt"height="1in"height="1in" width="2in"height="2in" width="1in"width="10%"height="10%" width="10%"
![graphic](./../Images/portrait.jpg "graphic")portrait with a width of 2.5in![This description is here just to test desc child of graphic.](./../Images/portrait.jpg "This description is here just to test desc child of graphic."){: width="2.5in"}portrait with a width of 0.5in![graphic](./../Images/portrait.jpg "graphic"){: width="0.5in"}portrait with a scale of .5![graphic](./../Images/portrait.jpg "graphic")portrait with a width of 1in![graphic](./../Images/portrait.jpg "graphic"){: width="1in"}portrait with a width of 1in and solid green 2pt border![graphic](./../Images/portrait.jpg "graphic"){: width="1in"}portrait with a height of 1in![graphic](./../Images/portrait.jpg "graphic"){: height="1in"}portrait with a height of 1in and a width of 2in![graphic](./../Images/portrait.jpg "graphic"){: height="1in" width="2in"}portrait with a height of 2in and a width of 1in![graphic](./../Images/portrait.jpg "graphic"){: height="2in" width="1in"}portrait with a width of 10%![graphic](./../Images/portrait.jpg "graphic"){: width="10%"}portrait with both height & width set to 10%![graphic](./../Images/portrait.jpg "graphic"){: height="10%" width="10%"}
# MS catalogue
where is itrepository nameidentifier
# Extended prose: MARLEY'S GHOST
Expand Down
20 changes: 10 additions & 10 deletions Test2/expected-results/generalP5DocxDocument.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3455,7 +3455,7 @@
</w:pPr>
<w:r>
<w:rPr/>
<w:t xml:space="preserve">width="2.5in" </w:t>
<w:t xml:space="preserve">portrait with a width of 2.5in</w:t>
</w:r>
</w:p>
</w:tc>
Expand Down Expand Up @@ -3528,7 +3528,7 @@
</w:pPr>
<w:r>
<w:rPr/>
<w:t xml:space="preserve">width=".5in" </w:t>
<w:t xml:space="preserve">portrait with a width of 0.5in</w:t>
</w:r>
</w:p>
</w:tc>
Expand Down Expand Up @@ -3601,7 +3601,7 @@
</w:pPr>
<w:r>
<w:rPr/>
<w:t xml:space="preserve">scale=".5"</w:t>
<w:t xml:space="preserve">portrait with a scale of .5</w:t>
</w:r>
</w:p>
</w:tc>
Expand Down Expand Up @@ -3674,7 +3674,7 @@
</w:pPr>
<w:r>
<w:rPr/>
<w:t xml:space="preserve">width="1in"</w:t>
<w:t xml:space="preserve">portrait with a width of 1in</w:t>
</w:r>
</w:p>
</w:tc>
Expand Down Expand Up @@ -3747,7 +3747,7 @@
</w:pPr>
<w:r>
<w:rPr/>
<w:t xml:space="preserve">width="1in" style="border:solid green 2pt"</w:t>
<w:t xml:space="preserve">portrait with a width of 1in and solid green 2pt border</w:t>
</w:r>
</w:p>
</w:tc>
Expand Down Expand Up @@ -3820,7 +3820,7 @@
</w:pPr>
<w:r>
<w:rPr/>
<w:t xml:space="preserve">height="1in"</w:t>
<w:t xml:space="preserve">portrait with a height of 1in</w:t>
</w:r>
</w:p>
</w:tc>
Expand Down Expand Up @@ -3893,7 +3893,7 @@
</w:pPr>
<w:r>
<w:rPr/>
<w:t xml:space="preserve">height="1in" width="2in"</w:t>
<w:t xml:space="preserve">portrait with a height of 1in and a width of 2in</w:t>
</w:r>
</w:p>
</w:tc>
Expand Down Expand Up @@ -3966,7 +3966,7 @@
</w:pPr>
<w:r>
<w:rPr/>
<w:t xml:space="preserve">height="2in" width="1in"</w:t>
<w:t xml:space="preserve">portrait with a height of 2in and a width of 1in</w:t>
</w:r>
</w:p>
</w:tc>
Expand Down Expand Up @@ -4039,7 +4039,7 @@
</w:pPr>
<w:r>
<w:rPr/>
<w:t xml:space="preserve">width="10%"</w:t>
<w:t xml:space="preserve">portrait with a width of 10%</w:t>
</w:r>
</w:p>
</w:tc>
Expand Down Expand Up @@ -4112,7 +4112,7 @@
</w:pPr>
<w:r>
<w:rPr/>
<w:t xml:space="preserve">height="10%" width="10%"</w:t>
<w:t xml:space="preserve">portrait with both height &amp; width set to 10%</w:t>
</w:r>
</w:p>
</w:tc>
Expand Down
20 changes: 10 additions & 10 deletions Test2/expected-results/generalP5OdtContent.xml
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@
</table:table-row>
<table:table-row>
<table:table-cell>
<text:p>width="2.5in" </text:p>
<text:p>portrait with a width of 2.5in</text:p>
</table:table-cell>
<table:table-cell>
<text:p>
Expand All @@ -693,7 +693,7 @@
</table:table-row>
<table:table-row>
<table:table-cell>
<text:p>width=".5in" </text:p>
<text:p>portrait with a width of 0.5in</text:p>
</table:table-cell>
<table:table-cell>
<text:p>
Expand All @@ -714,7 +714,7 @@
</table:table-row>
<table:table-row>
<table:table-cell>
<text:p>scale=".5"</text:p>
<text:p>portrait with a scale of .5</text:p>
</table:table-cell>
<table:table-cell>
<text:p>
Expand All @@ -735,7 +735,7 @@
</table:table-row>
<table:table-row>
<table:table-cell>
<text:p>width="1in"</text:p>
<text:p>portrait with a width of 1in</text:p>
</table:table-cell>
<table:table-cell>
<text:p>
Expand All @@ -756,7 +756,7 @@
</table:table-row>
<table:table-row>
<table:table-cell>
<text:p>width="1in" style="border:solid green 2pt"</text:p>
<text:p>portrait with a width of 1in and solid green 2pt border</text:p>
</table:table-cell>
<table:table-cell>
<text:p>
Expand All @@ -777,7 +777,7 @@
</table:table-row>
<table:table-row>
<table:table-cell>
<text:p>height="1in"</text:p>
<text:p>portrait with a height of 1in</text:p>
</table:table-cell>
<table:table-cell>
<text:p>
Expand All @@ -798,7 +798,7 @@
</table:table-row>
<table:table-row>
<table:table-cell>
<text:p>height="1in" width="2in"</text:p>
<text:p>portrait with a height of 1in and a width of 2in</text:p>
</table:table-cell>
<table:table-cell>
<text:p>
Expand All @@ -819,7 +819,7 @@
</table:table-row>
<table:table-row>
<table:table-cell>
<text:p>height="2in" width="1in"</text:p>
<text:p>portrait with a height of 2in and a width of 1in</text:p>
</table:table-cell>
<table:table-cell>
<text:p>
Expand All @@ -840,7 +840,7 @@
</table:table-row>
<table:table-row>
<table:table-cell>
<text:p>width="10%"</text:p>
<text:p>portrait with a width of 10%</text:p>
</table:table-cell>
<table:table-cell>
<text:p>
Expand All @@ -861,7 +861,7 @@
</table:table-row>
<table:table-row>
<table:table-cell>
<text:p>height="10%" width="10%"</text:p>
<text:p>portrait with both height &amp; width set to 10%</text:p>
</table:table-cell>
<table:table-cell>
<text:p>
Expand Down
21 changes: 10 additions & 11 deletions Test2/inputFiles/generalP5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -488,64 +488,63 @@
</cell>
</row>
<row>
<cell>width="2.5in" </cell>
<cell>portrait with a width of 2.5in</cell>
<cell>
<graphic width="2.5in" url="./../Images/portrait.jpg">
<desc>This description is here just to test <gi>desc</gi> child of <gi>graphic</gi>.</desc>
</graphic>
</cell>
</row>
<row>
<cell>width=".5in" </cell>
<cell>portrait with a width of 0.5in</cell>
<cell>
<graphic width="0.5in" url="./../Images/portrait.jpg"/>
</cell>
</row>
<row>
<cell>scale=".5"</cell>
<cell>portrait with a scale of .5</cell>
<cell>
<graphic url="./../Images/portrait.jpg" scale=".5"/>
</cell>
</row>
<row>
<cell>width="1in"</cell>
<cell>portrait with a width of 1in</cell>
<cell>
<graphic url="./../Images/portrait.jpg" width="1in"/>
</cell>
</row>
<row>
<cell>width="1in" style="border:solid green
2pt"</cell>
<cell>portrait with a width of 1in and solid green 2pt border</cell>
<cell>
<graphic url="./../Images/portrait.jpg" style="border:solid green 2pt" width="1in"/>
</cell>
</row>
<row>
<cell>height="1in"</cell>
<cell>portrait with a height of 1in</cell>
<cell>
<graphic url="./../Images/portrait.jpg" height="1in"/>
</cell>
</row>
<row>
<cell>height="1in" width="2in"</cell>
<cell>portrait with a height of 1in and a width of 2in</cell>
<cell>
<graphic url="./../Images/portrait.jpg" height="1in" width="2in"/>
</cell>
</row>
<row>
<cell>height="2in" width="1in"</cell>
<cell>portrait with a height of 2in and a width of 1in</cell>
<cell>
<graphic url="./../Images/portrait.jpg" height="2in" width="1in"/>
</cell>
</row>
<row>
<cell>width="10%"</cell>
<cell>portrait with a width of 10%</cell>
<cell>
<graphic url="./../Images/portrait.jpg" width="10%"/>
</cell>
</row>
<row>
<cell>height="10%" width="10%"</cell>
<cell>portrait with both height &amp; width set to 10%</cell>
<cell>
<graphic url="./../Images/portrait.jpg" height="10%" width="10%"/>
</cell>
Expand Down
Loading

0 comments on commit 2324a60

Please sign in to comment.