From 2579bda3d81c16b60d955f0117053be23ed1c90f Mon Sep 17 00:00:00 2001 From: zztkm Date: Tue, 26 Jul 2022 01:55:59 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20file=20=E3=82=92=E6=A4=9C=E7=B4=A2?= =?UTF-8?q?=E3=81=99=E3=82=8B=E6=A9=9F=E8=83=BD=E3=81=AE=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vss.v | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/vss.v b/vss.v index 8132a3c..b8cfd26 100644 --- a/vss.v +++ b/vss.v @@ -2,23 +2,37 @@ module main import os import cli - import markdown fn main() { - mut app := cli.Command { - name: "vss" - version: "0.0.0" - description: "static site generator" + mut app := cli.Command{ + name: 'vss' + version: '0.0.0' + description: 'static site generator' execute: fn (cmd cli.Command) ? { + paths := get_paths("docs") + for path in paths { + println(path) + } return } } - text := '# Markdown Rocks!' - output := markdown.to_html(text) - println(output) //

Markdown Rocks!

+ text := '# Markdown Rocks!' + output := markdown.to_html(text) + println(output) //

Markdown Rocks!

+ + app.setup() + app.parse(os.args) } -// work の検証をやる -https://modules.vlang.io/os.html#walk \ No newline at end of file +fn normalise_paths(paths []string) []string { + mut res := paths.map(it.replace(os.path_separator, '/')) + res.sort() + return res +} + +fn get_paths(path string) []string { + mds := os.walk_ext(path, '.md') + return mds +}