~kungtotte/dtt

f2aa3241167242ee372e2f8ef3095d90def6e241 — Thomas Landin a month ago 76f8b58
Swap nim-markdown for slimdown for --gc:arc

nim-markdown from soasme had lots of issues with ARC and like docopt
it's easier to pick another markdown library than fix those errors.

Eventually I might switch back if it's updated for ARC.

Also cleaned out old dependencies and changed a func to a proc due to
how slimdown handles things. Will look to see if I can adapt that about
slimdown since it shouldn't really have side-effects.
4 files changed, 8 insertions(+), 6 deletions(-)

M dtt.nimble
A nim.cfg
M src/dtt.nim
M src/utils.nim
M dtt.nimble => dtt.nimble +1 -2
@@ 14,8 14,7 @@ binDir        = "bin"

requires "nim >= 1.0.4"
requires "argparse"
requires "https://github.com/soasme/nim-markdown >= 0.8"
requires "https://github.com/docopt/docopt.nim >= 0.6"
requires "slimdown"
requires "https://github.com/soasme/nim-mustache >= 0.2"

task make_doc, "Generate man page(s)":

A nim.cfg => nim.cfg +3 -0
@@ 0,0 1,3 @@
--path="$home/.nimble/pkgs/argparse-#master/src/"
--path="$home/.nimble/pkgs/mustache-0.2.1/src/"
--excludePath="/opt/nimble/pkgs/"

M src/dtt.nim => src/dtt.nim +1 -1
@@ 1,7 1,7 @@
import os, strutils, strformat
import unicode, algorithm
import tables

import docopt
import mustache
import argparse


M src/utils.nim => src/utils.nim +3 -3
@@ 2,7 2,7 @@ import os, strutils, strformat
import strscans
import unicode, tables, times

import markdown
import slimdown
import mustache

const


@@ 35,8 35,8 @@ proc needsUpdate*(source, dest: string): bool =
proc loadTemplate*(name: string = "page", dir: string = "templates"): string =
  return readFile(dir / name & ".mustache")

func renderTemplate*(context: Context, md: string, tmpl: string): string =
  context["content"] = markdown(md)
proc renderTemplate*(context: Context, md: string, tmpl: string): string =
  context["content"] = slimdown.md(md)
  result = tmpl.render(context)

func formatPaddedDate(year, month, day: int): string =