Iâm loving all the little utility libraries coming out (and appreciate the write ups on how things are done). Iâm curious why you chose to use ffi for this one in particular as it would seem to be quite straightforward to do it all in native Smalltalk (not to down play your integration in any way of course). Was performance a big thing? Or was it simply relying on others to keep it up to date? Tim Sent from my iPhone
On 1 Jan 2020, at 10:40, Pierce Ng <pierce@samadhiweb.com> wrote:
Hi all,
I've published Phoedown, an FFI to hoedown, the standards compliant, fast, secure Markdown processing library written in C.
- https://github.com/PierceNg/Phoedown - https://github.com/hoedown/hoedown
A simple example:
| md | md := (FileSystem memory / 'somefile.md') writeStreamDo: [ :ws | ws nextPutAll: ' ```smalltalk Transcript show: ''Happy New Year!''; cr ``` ' ]; contents. HdHtmlRenderer new setMarkdownExtension: HdMarkdownExtensions FencedCode; setMarkdownExtension: HdMarkdownExtensions NoIntraEmphasis; render: md
This is the output:
<pre><code class="language-smalltalk">Transcript show: 'Happy New Year!'; cr </code></pre>
Pierce