Skip to content

Commit be443a6

Browse files
committed
use openparser/yaml
Signed-off-by: George Lemon <georgelemon@protonmail.com>
1 parent 8339481 commit be443a6

5 files changed

Lines changed: 15 additions & 6 deletions

File tree

.github/tim-look.png

-63 KB
Binary file not shown.

.github/timengine.png

-65.2 KB
Binary file not shown.

.gitignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,19 @@
44
nimcache/
55
nimblecache/
66
htmldocs/
7+
tests/*
8+
!tests/*.nim
79
/pkginfo.json
810
/tests/app/storage/*
911
/example/storage/ast/*
1012
/example/storage/html/*
1113
/bindings/tim/src/bin/*
1214
/init.sh
1315
/CMakeLists.txt
14-
denim_build/
16+
denim_build/
17+
/press
18+
src/tim/loaders/
19+
tests/snippets
20+
src/tim/experiments
21+
bindings
22+
!example/templates

src/tim/meta/config.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ when not defined napibuild:
7575
skipFields: @["type", "compilation", "browser_sync"]
7676
))
7777
else:
78-
toJson(c)
79-
dump(json.fromJson(str))
78+
json.toJson(c)
79+
yaml.dump(json.fromJson(str))
8080

8181
proc `$`*(c: TimConfig): string =
8282
json.toJson(c)

src/tim/meta/initializer.nim

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import pkg/kapsis/interactive/prompts
77

88
import pkg/[watchout, semver, checksums/sha1]
99
import pkg/openparser/yaml
10+
1011
import ../engine/parser
1112
import ./config
1213

@@ -623,9 +624,9 @@ proc precompile*(engine: TimEngine) =
623624
var themeManifest: ThemeManifest
624625
if fileExists(yamlConfigPath):
625626
try:
626-
themeManifest = fromYAML(readFile(yamlConfigPath), ThemeManifest)
627-
except YAMLException:
628-
displayError("Failed to parse theme manifest: " & yamlConfigPath)
627+
themeManifest = parseYaml(readFile(yamlConfigPath), ThemeManifest)
628+
except OpenParserYamlError as e:
629+
displayError("Failed to parse theme manifest: " & yamlConfigPath & "\nError: " & e.msg)
629630
elif fileExists(jsonConfigPath):
630631
try:
631632
themeManifest = fromJson(readFile(jsonConfigPath), ThemeManifest)

0 commit comments

Comments
 (0)