Skip to content

Instantly share code, notes, and snippets.

View pietroppeter's full-sized avatar
🐳
chasing the whale

Pietro Peterlongo pietroppeter

🐳
chasing the whale
View GitHub Profile
# minib (a mini nimib)
import strformat, macros
import tempfile
proc dup*(oldfd: FileHandle): FileHandle {.importc, header: "unistd.h".}
proc dup2*(oldfd: FileHandle, newfd: FileHandle): cint {.importc, header: "unistd.h".}
macro toStr*(body: untyped): string =
(body.toStrLit)
import markdown
import std / strutils
echo markdown("""
```nim
echo "hello"
```*
""".replace('*', ' '), config=initGfmConfig())
#[
<pre><code class="language-nim">echo &quot;hello&quot;