diff --git a/src/tim/app/astCmd.nim b/src/tim/app/astCmd.nim index 98e4e86..840d760 100644 --- a/src/tim/app/astCmd.nim +++ b/src/tim/app/astCmd.nim @@ -1,3 +1,9 @@ +# A super fast template engine for cool kids +# +# (c) 2024 George Lemon | LGPL-v3 License +# Made by Humans from OpenPeeps +# https://github.com/openpeeps/tim + import std/os import pkg/flatty import pkg/kapsis/[cli, runtime] diff --git a/src/tim/app/jitCmd.nim b/src/tim/app/jitCmd.nim index dc9b46a..5fee592 100644 --- a/src/tim/app/jitCmd.nim +++ b/src/tim/app/jitCmd.nim @@ -1,10 +1,16 @@ +# A super fast template engine for cool kids +# +# (c) 2024 George Lemon | LGPL-v3 License +# Made by Humans from OpenPeeps +# https://github.com/openpeeps/tim + import std/[osproc, os] import pkg/flatty import pkg/kapsis/[runtime, cli] import ../engine/[parser, ast] import ../engine/compilers/nimc -import ../server/vm +import ../server/dynloader proc binCommand*(v: Values) = ## Execute Just-in-Time compilation of the specifie diff --git a/src/tim/app/liveCmd.nim b/src/tim/app/liveCmd.nim index cdd7027..bef3a0a 100644 --- a/src/tim/app/liveCmd.nim +++ b/src/tim/app/liveCmd.nim @@ -1,3 +1,9 @@ +# A super fast template engine for cool kids +# +# (c) 2024 George Lemon | LGPL-v3 License +# Made by Humans from OpenPeeps +# https://github.com/openpeeps/tim + import std/[os, strutils] import pkg/nyml import pkg/kapsis/[cli, runtime] diff --git a/src/tim/app/reprCmd.nim b/src/tim/app/reprCmd.nim index 91f1596..d291ee4 100644 --- a/src/tim/app/reprCmd.nim +++ b/src/tim/app/reprCmd.nim @@ -1,3 +1,9 @@ +# A super fast template engine for cool kids +# +# (c) 2024 George Lemon | LGPL-v3 License +# Made by Humans from OpenPeeps +# https://github.com/openpeeps/tim + import std/[os, strutils] import pkg/flatty import pkg/kapsis/[cli, runtime] diff --git a/src/tim/app/srcCmd.nim b/src/tim/app/srcCmd.nim index 41a1596..821b157 100644 --- a/src/tim/app/srcCmd.nim +++ b/src/tim/app/srcCmd.nim @@ -1,3 +1,9 @@ +# A super fast template engine for cool kids +# +# (c) 2024 George Lemon | LGPL-v3 License +# Made by Humans from OpenPeeps +# https://github.com/openpeeps/tim + import std/[os, strutils] import pkg/kapsis/[cli, runtime] import ../engine/parser @@ -41,37 +47,4 @@ proc srcCommand*(v: Values) = for err in p.logger.errors: display(err) displayInfo p.logger.filePath - quit(1) - - -# import std/critbits - -# type -# ViewHandle* = proc(): string -# LayoutHandle* = proc(viewHtml: string): string -# ViewsTree* = CritBitTree[ViewHandle] -# LayoutsTree* = CritBitTree[LayoutHandle] - -# proc getIndex(): string = -# result = "view html" - -# var views = ViewsTree() -# views["index"] = getIndex - -# proc getBaseLayout(viewHtml: string): string = -# result = "start layout" -# add result, viewHtml -# add result, "end layout" - -# var layouts = LayoutsTree() -# layouts["base"] = getBaseLayout - -# template render*(viewName: string, layoutName = "base"): untyped = -# if likely(views.hasKey(viewName)): -# let viewHtml = views[viewName]() -# if likely(layouts.hasKey(layoutName)): -# layouts[layoutName](viewHtml) -# else: "" -# else: "" - -# echo render("index") \ No newline at end of file + quit(1) \ No newline at end of file diff --git a/src/tim/server/app.nim b/src/tim/server/app.nim index eb5d097..7cc7b85 100644 --- a/src/tim/server/app.nim +++ b/src/tim/server/app.nim @@ -1,3 +1,9 @@ +# A super fast template engine for cool kids +# +# (c) 2024 George Lemon | LGPL-v3 License +# Made by Humans from OpenPeeps +# https://github.com/openpeeps/tim + import std/[os, strutils, sequtils, json, critbits] import pkg/[zmq, watchout, jsony] import pkg/kapsis/[cli] @@ -208,4 +214,4 @@ proc run*(engine: var TimEngine, config: TimConfig) = discard existsOrCreateDir(config.output / "layouts") discard existsOrCreateDir(config.output / "partials") display("Tim Engine is running Source-to-Source") - engine.precompile(config, newJObject()) \ No newline at end of file + engine.precompile(config, newJObject()) diff --git a/src/tim/server/config.nim b/src/tim/server/config.nim index 2401e56..110e3a0 100644 --- a/src/tim/server/config.nim +++ b/src/tim/server/config.nim @@ -1,3 +1,9 @@ +# A super fast template engine for cool kids +# +# (c) 2024 George Lemon | LGPL-v3 License +# Made by Humans from OpenPeeps +# https://github.com/openpeeps/tim + from std/net import Port, `$` export `$` diff --git a/src/tim/server/vm.nim b/src/tim/server/dynloader.nim similarity index 91% rename from src/tim/server/vm.nim rename to src/tim/server/dynloader.nim index 1b08c57..bc8fe39 100644 --- a/src/tim/server/vm.nim +++ b/src/tim/server/dynloader.nim @@ -1,10 +1,9 @@ # A super fast template engine for cool kids # -# (c) 2023 George Lemon | LGPL License +# (c) 2024 George Lemon | LGPL-v3 License # Made by Humans from OpenPeeps # https://github.com/openpeeps/tim -## This module implements a high-performance Just-in-Time import std/[tables, dynlib, json] type DynamicTemplate = object @@ -17,7 +16,7 @@ type when defined macosx: const ext = ".dylib" -elif windows: +elif defined windows: const ext = ".dll" else: const ext = ".so"