-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathREADME.htm
More file actions
128 lines (128 loc) · 6.07 KB
/
README.htm
File metadata and controls
128 lines (128 loc) · 6.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<style type="text/css">
code{
font-family: "Consolas", monospace;
}
pre{
border: 1px solid #ddd;
border-left: 3px solid #f36d33;
overflow: auto;
padding: 1em 1.5em;
display: block;
}
Blockquote{
border-left: 3px solid #d0d0d0;
padding-left: 0.5em;
margin-left:1em;
}
Blockquote p{
margin: 0;
}
table{
border:1px solid;
border-collapse:collapse;
}
th{ padding:5px;
border:1px solid;
}
td{
padding:5px;
border:1px solid;
}
</style>
<h1>Markdown Processor and MarkDownToHTML.exe utility<a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/License-Apache%202.0-yellowgreen.svg" alt="License"/></a></h1>
<p>A Markdown Processor Library for Delphi, to process/convert markdown files to HTML.</p>
<p>A Useful utility: <strong>MarkDownToHTML.exe</strong> to transform any markdown file to HTML</p>
<p><strong>Latest Version 1.3.0 - 21 Aug 2025</strong></p>
<p><img src="/images/SupportingDelphi.jpg" alt="Support Delphi"/></p>
<p>This library is compatible from Delphi XE3 version to latest.</p>
<p><a href="https://www.embarcadero.com/">www.embarcadero.com</a> - <a href="https://learndelphi.org/">learndelphi.org</a></p>
<hr />
<h2>Using the MarkDownToHTML.exe utility</h2>
<p>With MarkDownToHTML.exe you can transform a markdown file to HTML using different markdown dialects or StyleSheet.</p>
<p><a href="https://github.com/EtheaDev/MarkdownProcessor/releases/latest/download/MarkDownToHTML.exe">Download the utility</a>.</p>
<p>run <strong>MarkDownToHTML.exe help processfile</strong> for a complete help.</p>
<p>Look into Cmd\MarkdownToHTML\Test\MarkDownToHTML_Test.cmd for examples</p>
<hr />
<h2>Basic Informations for Delphi users</h2>
<p>This is a Pascal (Delphi) library that processes markdown to HTML.
At present the following dialects of markdown are supported:</p>
<ul>
<li>The Daring Fireball dialect
(see <a href="https://daringfireball.net/projects/markdown/">https://daringfireball.net/projects/markdown/</a>)</li>
<li>Almost complete support for CommonMark dialect
(translated from <a href="http://commonmark.org/">http://commonmark.org/</a>)</li>
<li>Enhanced TxtMark dialect
(translated from <a href="https://github.com/rjeschke/txtmark">https://github.com/rjeschke/txtmark</a>)</li>
</ul>
<h3>Using the Library with Delphi</h3>
<p>Declare a variable of the class TMarkdownProcessor:</p>
<pre><code class="Pascal"> var
md : TMarkdownProcessor;
</code></pre>
<p>Create a TMarkdownProcessor (MarkdownProcessor.pas) of the dialect you want:</p>
<pre><code class="Pascal"> md := TMarkdownProcessor.createDialect(mdDaringFireball)
</code></pre>
<p>Decide whether you want to allow active content</p>
<pre><code class="Pascal"> md.AllowUnSafe := true;
</code></pre>
<p>Note: you should only set this to true if you <em>need</em> to - active content can be a significant safety/security issue.</p>
<p>Generate HTML fragments from Markdown content:</p>
<pre><code class="Pascal"> html := md.process(markdown);
</code></pre>
<p>Note that the HTML returned is an HTML fragment, not a full HTML page.</p>
<p>Do not forget to dispose of the object after the use:</p>
<pre><code class="Pascal"> md.free
</code></pre>
<p>Large rework was made for adding support for tables, math formulas, etc.</p>
<h2>Delphi projects Examples</h2>
<p>This library is used in two projects:</p>
<ul>
<li><a href="https://github.com/EtheaDev/MarkdownShellExtensions">MarkdownShellExtensions</a></li>
</ul>
<p>A collection of tools for markdown files, to edit and view content, with an advanced Editor:</p>
<p><img src="./images/MDTextEditorLight.png" alt="Markdown Text Editor"/></p>
<ul>
<li><a href="https://github.com/EtheaDev/MarkdownHelpViewer">MarkdownHelpViewer</a></li>
</ul>
<p>An integrated help system based on files in Markdown format (and also html), for Delphi applications:</p>
<p><img src="./images/ContentPage.png" alt="Markdown HelpViewer"/></p>
<h2>Release Notes</h2>
<p>21 Aug 2025: ver. 1.3.0</p>
<ul>
<li>Added support for Delphi 13</li>
<li>Added command line utility MarkDownToHTML.exe</li>
</ul>
<p>08 Apr 2025: ver. 1.2.0</p>
<ul>
<li>Fixed const parameters</li>
</ul>
<p>16 Dec 2024: ver. 1.1.0</p>
<ul>
<li>Updated Demo for FireMonkey</li>
</ul>
<p>22 Oct 2023: ver. 1.0.0</p>
<ul>
<li>Project forked from FPC-markdown by Miguel A. Risco-Castillo</li>
<li>Removed unused Dialect mdAsciiDoc</li>
<li>changed position of enumerated dialect mdCommonMark for backward compatibility with Delphi-Markdown</li>
</ul>
<h2>License</h2>
<p>Copyright (c) Ethea S.r.l.</p>
<p>Licensed under the Apache License, Version 2.0 (the “License”);</p>
<p>you may not use this file except in compliance with the License.</p>
<p>You may obtain a copy of the License at</p>
<p><a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a></p>
<p>Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.</p>
<h2>Contributors</h2>
<p><strong>MarkdownProcessor</strong> implementation is a fork of FPC-markdown by <strong>Miguel A. Risco-Castillo</strong>
<a href="https://github.com/mriscoc/fpc-markdown">FPC-markdown</a></p>
<p>FPC-markdown implementation is a fork of <strong>Grahame Grieve</strong> pascal port
<a href="https://github.com/grahamegrieve/delphi-markdown">Delphi-markdown</a></p>
<hr />
<p><strong>MarkDownToHTML.exe</strong> is a CLI based on the project:</p>
<p><strong>Italian Delphi Day 2020: <em>Una CLI che i tuoi utenti ameranno</em></strong></p>
<p>by <em>Marco Breveglieri</em></p>
<p><a href="https://www.breveglieri.it/eventi/2020-06-11-delphiday-creare-client-cli/">Go to Slides and Demos page…</a></p>
<p>It also uses <strong>CommandLineParser</strong></p>
<p><a href="https://github.com/VSoftTechnologies/VSoft.CommandLineParser">VSoft.CommandLineParser</a></p>
<p>by <em>Vincent Parret</em>, licensed under the Apache License, Version 2.0 (the “License”);</p>