all repos — hastyscribe @ 7bf9a351511cbb39a05d107306b5ab68636401d8

A professional markdown compiler.

HastyScribe is now compatible with Nim v0.10.2.
h3rald h3rald@h3rald.com
Fri, 02 Jan 2015 21:26:41 +0100
commit

7bf9a351511cbb39a05d107306b5ab68636401d8

parent

3c489041b2c4222e70df6af0f542fa6545d7212a

M README.mdREADME.md

@@ -37,7 +37,7 @@ _HastyScribe_ is best suited to produce self-contained documents such as essays, meeting notes, project status documents, and articles.

### What language is _HastyScribe_ implemented in? -HastyScribe is implemented in [Nimrod][nimrod], a very expressive language that compiles to C and is able to generate small, standalone and self-contained executable files. +HastyScribe is implemented in [Nim][nim], a very expressive language that compiles to C and is able to generate small, standalone and self-contained executable files. ### How do I build _HastyScribe_ from source?

@@ -58,9 +58,9 @@ Tip: If you are on Windows, you can compile Discount using [MinGW](http://www.mingw.org/).

Once you have a **libmarkdown.a** static library for your platform: -1. Download and install [Nimrod][nimrod]. +1. Download and install [Nim][nim]. 2. Clone the HastyScribe [repository](https://github.com/h3rald/hastyscribe). 3. Put your **libmarkdown.a** file in the **vendor** directory. -4. Run **nimrod c hastyscribe.nim** +4. Run **nim c hastyscribe.nim** -[nimrod]: http://nimrod-code.org/ +[nim]: http://nim-lang.org/
M doc/HastyScribe_UserGuide.htmdoc/HastyScribe_UserGuide.htm

@@ -234,19 +234,19 @@ <h2 id="Getting.Started">Getting Started<a href="#document-top" title="Go to top"></a></h2>

<h3 id="Downloading.Pre-built.Binaries">Downloading Pre-built Binaries<a href="#document-top" title="Go to top"></a></h3> -<p>The easiest way to get HastyScribe is by downloading one of the prebuilt binaries from the <a href="https://github.com/h3rald/hastyscribe/releases/download/v1.0.8">Github Release Page</a>:</p> +<p>The easiest way to get HastyScribe is by downloading one of the prebuilt binaries from the <a href="https://github.com/h3rald/hastyscribe/releases/download/v1.0.9">Github Release Page</a>:</p> <ul> -<li><a href="https://github.com/h3rald/hastyscribe/releases/download/v1.0.8/hastyscribe_v1.0.8_macosx_x86.zip">HastyScribe for Mac OS X (x86)</a> &ndash; Compiled on OS X Mavericks (LLVM CLANG 6.0)</li> -<li><a href="https://github.com/h3rald/hastyscribe/releases/download/v1.0.8/hastyscribe_v1.0.8_windows_x86.zip">HastyScribe for Windows (x86)</a> &ndash; Cross-compiled on OS X Mavericks (MinGW GCC 4.8.0)</li> -<li><a href="https://github.com/h3rald/hastyscribe/releases/download/v1.0.8/hastyscribe_v1.0.8_linux_x86.zip">HastyScribe for Linux (x86)</a> &ndash; Cross-compiled on OS X Mavericks (GNU GCC 4.8.1)</li> -<li><a href="https://github.com/h3rald/hastyscribe/releases/download/v1.0.8/hastyscribe_v1.0.8_linux_arm.zip">HastyScribe for Linux (ARM)</a> &ndash; Cross-compiled on OS X Mavericks (GNU GCC 4.8.2)</li> +<li><a href="https://github.com/h3rald/hastyscribe/releases/download/v1.0.9/hastyscribe_v1.0.9_macosx_x86.zip">HastyScribe for Mac OS X (x86)</a> &ndash; Compiled on OS X Mavericks (LLVM CLANG 6.0)</li> +<li><a href="https://github.com/h3rald/hastyscribe/releases/download/v1.0.9/hastyscribe_v1.0.9_windows_x86.zip">HastyScribe for Windows (x86)</a> &ndash; Cross-compiled on OS X Mavericks (MinGW GCC 4.8.0)</li> +<li><a href="https://github.com/h3rald/hastyscribe/releases/download/v1.0.9/hastyscribe_v1.0.9_linux_x86.zip">HastyScribe for Linux (x86)</a> &ndash; Cross-compiled on OS X Mavericks (GNU GCC 4.8.1)</li> +<li><a href="https://github.com/h3rald/hastyscribe/releases/download/v1.0.9/hastyscribe_v1.0.9_linux_arm.zip">HastyScribe for Linux (ARM)</a> &ndash; Cross-compiled on OS X Mavericks (GNU GCC 4.8.2)</li> </ul> <h3 id="Installing.using.Nimble">Installing using Nimble<a href="#document-top" title="Go to top"></a></h3> -<p>If you already have <a href="http://nimrod-code.org/">Nimrod</a> installed on your computer, you can simply run</p> +<p>If you already have <a href="http://nim-lang.org/">Nim</a> installed on your computer, you can simply run</p> <p><span class="cmd">nimble install hastyscribe</span></p>

@@ -275,10 +275,10 @@

<p>Once you have a <span class="file">libmarkdown.a</span> static library for your platform:</p> <ol> -<li>Download and install <a href="http://nimrod-code.org/">Nimrod</a>.</li> +<li>Download and install <a href="http://nim-lang.org/">Nim</a>.</li> <li>Clone the HastyScribe <a href="https://github.com/h3rald/hastyscribe">repository</a>.</li> <li>Put your <span class="file">libmarkdown.a</span> file in the <span class="dir">vendor</span> directory.</li> -<li>Run <span class="cmd">nimrod c hastyscribe.nim</span></li> +<li>Run <span class="cmd">nim c hastyscribe.nim</span></li> </ol>

@@ -1104,13 +1104,13 @@

<p>Special thanks to:</p> <ul> -<li>Andreas Rumpf, creator of the amazing <a href="http://nimrod-code.org/">Nimrod</a> programming language, used to implement HastyScribe.</li> +<li>Andreas Rumpf, creator of the amazing <a href="http://nim-lang.org/">Nim</a> programming language, used to implement HastyScribe.</li> <li>Ethan Lai, developer of the handy <a href="http://koala-app.com/">Koala</a> app, used to compile all the LESS code into CSS.</li> </ul> </div> <div id="footer"> - <p><span class="copy"></span> Fabio Cevasco &ndash; December 26, 2014</p> + <p><span class="copy"></span> Fabio Cevasco &ndash; January 2, 2015</p> <p><span>Powered by</span> <a href="https://h3rald.com/hastyscribe"><span class="hastyscribe"></span></a></p> </div> </body>
M doc/HastyScribe_UserGuide.mddoc/HastyScribe_UserGuide.md

@@ -77,14 +77,14 @@ ### Downloading Pre-built Binaries

The easiest way to get {{hs}} is by downloading one of the prebuilt binaries from the [Github Release Page][release]: - * [HastyScribe for Mac OS X (x86)]({{release}}/hastyscribe_v1.0.8_macosx_x86.zip) -- Compiled on OS X Mavericks (LLVM CLANG 6.0) - * [HastyScribe for Windows (x86)]({{release}}/hastyscribe_v1.0.8_windows_x86.zip) -- Cross-compiled on OS X Mavericks (MinGW GCC 4.8.0) - * [HastyScribe for Linux (x86)]({{release}}/hastyscribe_v1.0.8_linux_x86.zip) -- Cross-compiled on OS X Mavericks (GNU GCC 4.8.1) - * [HastyScribe for Linux (ARM)]({{release}}/hastyscribe_v1.0.8_linux_arm.zip) -- Cross-compiled on OS X Mavericks (GNU GCC 4.8.2) + * [HastyScribe for Mac OS X (x86)]({{release}}/hastyscribe_v1.0.9_macosx_x86.zip) -- Compiled on OS X Mavericks (LLVM CLANG 6.0) + * [HastyScribe for Windows (x86)]({{release}}/hastyscribe_v1.0.9_windows_x86.zip) -- Cross-compiled on OS X Mavericks (MinGW GCC 4.8.0) + * [HastyScribe for Linux (x86)]({{release}}/hastyscribe_v1.0.9_linux_x86.zip) -- Cross-compiled on OS X Mavericks (GNU GCC 4.8.1) + * [HastyScribe for Linux (ARM)]({{release}}/hastyscribe_v1.0.9_linux_arm.zip) -- Cross-compiled on OS X Mavericks (GNU GCC 4.8.2) ### Installing using Nimble -If you already have [Nimrod][nimrod] installed on your computer, you can simply run +If you already have [Nim][nim] installed on your computer, you can simply run [nimble install hastyscribe](class:cmd)

@@ -111,10 +111,10 @@ > If you are on Windows, you can compile Discount using [MinGW](http://www.mingw.org/).

Once you have a [libmarkdown.a](class:file) static library for your platform: -1. Download and install [Nimrod][nimrod]. +1. Download and install [Nim][nim]. 2. Clone the HastyScribe [repository](https://github.com/h3rald/hastyscribe). 3. Put your [libmarkdown.a](class:file) file in the [vendor](class:dir) directory. -4. Run [nimrod c hastyscribe.nim](class:cmd) +4. Run [nim c hastyscribe.nim](class:cmd) ## Usage

@@ -725,11 +725,11 @@ * The neat [Source Sans Pro](https://store1.adobe.com/cfusion/store/html/index.cfm?event=displayFontPackage&code=1959) and [Source Code Pro](http://store1.adobe.com/cfusion/store/html/index.cfm?event=displayFontPackage&code=1960) font, used for all standard text.

Special thanks to: -* Andreas Rumpf, creator of the amazing [Nimrod][nimrod] programming language, used to implement {{hs}}. +* Andreas Rumpf, creator of the amazing [Nim][nim] programming language, used to implement {{hs}}. * Ethan Lai, developer of the handy [Koala](http://koala-app.com/) app, used to compile all the LESS code into CSS. -[nimrod]: http://nimrod-code.org/ +[nim]: http://nim-lang.org/ [df]: https://daringfireball.net/projects/markdown/ [discount]: http://www.pell.portland.or.us/~orc/Code/discount/ [pandoc]: http://johnmacfarlane.net/pandoc/

@@ -738,4 +738,4 @@ [fa]:http://fortawesome.github.io/Font-Awesome/

[fa-icons]:http://fortawesome.github.io/Font-Awesome/icons/ [pme]:http://michelf.com/projects/php-markdown/extra/ [sudtipos]:http://www.sudtipos.com/ -[release]:{{release -> https://github.com/h3rald/hastyscribe/releases/download/v1.0.8}} +[release]:{{release -> https://github.com/h3rald/hastyscribe/releases/download/v1.0.9}}
M hastyscribe.nimhastyscribe.nim

@@ -28,7 +28,7 @@

# Procedures -proc parse_date*(date: string, timeinfo: var TTimeInfo): bool = +proc parse_date*(date: string, timeinfo: var TimeInfo): bool = var parts = date.split('-').map(proc(i:string): int = try: i.parseInt

@@ -38,9 +38,9 @@ )

if parts.len < 3: return false try: - timeinfo = TTimeInfo(year: parts[0], month: TMonth(parts[1]-1), monthday: parts[2]) + timeinfo = TimeInfo(year: parts[0], month: Month(parts[1]-1), monthday: parts[2]) # Fix invalid dates (e.g. Feb 31st -> Mar 3rd) - timeinfo = getLocalTime(timeinfo.TimeInfoToTime); + timeinfo = getLocalTime(timeinfo.timeInfoToTime); return true except: return false

@@ -126,7 +126,7 @@ # Snippet Usage:

# {{test}} proc parse_snippets*(document): string = - var snippets:TTable[string, string] = initTable[string, string]() + var snippets:Table[string, string] = initTable[string, string]() let peg_def = peg""" definition <- '{{' \s* {id} \s* '->' {@} '}}' id <- [a-zA-Z0-9_-]+

@@ -194,7 +194,7 @@ headings = ""

toc = "" # Date parsing and validation - var timeinfo: TTimeInfo = getLocalTime(getTime()) + var timeinfo: TimeInfo = getLocalTime(getTime()) if parse_date(metadata.date, timeinfo) == false: discard parse_date(getDateStr(), timeinfo)
M hastyscribe.nimblehastyscribe.nimble

@@ -1,6 +1,6 @@

[Package] name = "hastyscribe" -version = "1.0.8" +version = "1.0.9" author = "Fabio Cevasco" description = "Self-contained markdown compiler generating self-contained HTML documents" license = "MIT"

@@ -43,4 +43,4 @@ vendor/libmarkdown_linux_arm.a

""" [Deps] -Requires: "nimrod >= 0.9.6" +Requires: "nimrod >= 0.10.2"
M markdown.nimmarkdown.nim

@@ -7,7 +7,7 @@

# line builder for markdown() # {.push importc, cdecl.} -proc mkd_in*(a2: TFile; a3: mkd_flag_t): ptr MMIOT +proc mkd_in*(a2: File; a3: mkd_flag_t): ptr MMIOT # assemble input from a file proc mkd_string*(a2: cstring; a3: cint; a4: mkd_flag_t): ptr MMIOT

@@ -15,7 +15,7 @@ # assemble input from a buffer

# line builder for github flavoured markdown # -proc gfm_in*(a2: TFile; a3: mkd_flag_t): ptr MMIOT +proc gfm_in*(a2: File; a3: mkd_flag_t): ptr MMIOT # assemble input from a file proc gfm_string*(a2: cstring; a3: cint; a4: mkd_flag_t): ptr MMIOT

@@ -33,15 +33,15 @@ proc mkd_cleanup*(a2: ptr MMIOT)

# markup functions # -proc mkd_dump*(a2: ptr MMIOT; a3: TFile; a4: cint; a5: cstring): cint -proc markdown*(a2: ptr MMIOT; a3: TFile; a4: mkd_flag_t): cint +proc mkd_dump*(a2: ptr MMIOT; a3: File; a4: cint; a5: cstring): cint +proc markdown*(a2: ptr MMIOT; a3: File; a4: mkd_flag_t): cint proc mkd_line*(a2: cstring; a3: cint; a4: cstringArray; a5: mkd_flag_t): cint type mkd_sta_function_t* = proc (a2: cint; a3: pointer): cint proc mkd_string_to_anchor*(a2: cstring; a3: cint; a4: mkd_sta_function_t; a5: pointer; a6: cint) -proc mkd_xhtmlpage*(a2: ptr MMIOT; a3: cint; a4: TFile): cint +proc mkd_xhtmlpage*(a2: ptr MMIOT; a3: cint; a4: File): cint # header block access #

@@ -58,14 +58,14 @@ proc mkd_xml*(a2: cstring; a3: cint; a4: cstringArray): cint

# write-to-file functions # -proc mkd_generatehtml*(a2: ptr MMIOT; a3: TFile): cint -proc mkd_generatetoc*(a2: ptr MMIOT; a3: TFile): cint -proc mkd_generatexml*(a2: cstring; a3: cint; a4: TFile): cint -proc mkd_generatecss*(a2: ptr MMIOT; a3: TFile): cint +proc mkd_generatehtml*(a2: ptr MMIOT; a3: File): cint +proc mkd_generatetoc*(a2: ptr MMIOT; a3: File): cint +proc mkd_generatexml*(a2: cstring; a3: cint; a4: File): cint +proc mkd_generatecss*(a2: ptr MMIOT; a3: File): cint const mkd_style* = mkd_generatecss -proc mkd_generateline*(a2: cstring; a3: cint; a4: TFile; a5: mkd_flag_t): cint +proc mkd_generateline*(a2: cstring; a3: cint; a4: File; a5: mkd_flag_t): cint const mkd_text* = mkd_generateline

@@ -85,8 +85,8 @@ #

var markdown_version*: ptr char -proc mkd_mmiot_flags*(a2: TFile; a3: ptr MMIOT; a4: cint) -proc mkd_flags_are*(a2: TFile; a3: mkd_flag_t; a4: cint) +proc mkd_mmiot_flags*(a2: File; a3: ptr MMIOT; a4: cint) +proc mkd_flags_are*(a2: File; a3: mkd_flag_t; a4: cint) proc mkd_ref_prefix*(a2: ptr MMIOT; a3: cstring) # special flags for markdown() and mkd_text() #

@@ -123,7 +123,7 @@ MKD_EMBED* = MKD_NOLINKS or MKD_NOIMAGE or MKD_TAGTEXT

# special flags for mkd_in() and mkd_string() -type TMDMetaData* = object of TObject +type TMDMetaData* = object of RootObj title*: string author*: string date*: string
M nakefile.nimnakefile.nim

@@ -2,7 +2,7 @@ import nake

from version import v const - compile = "nimrod c -d:release" + compile = "nim c -d:release" linux_x86 = "--cpu:i386 --os:linux" linux_arm = "--cpu:arm --os:linux" windows_x86 = "--cpu:i386 --os:windows"
M version.nimversion.nim

@@ -1,1 +1,1 @@

-let v* = "1.0.8" +let v* = "1.0.9"