GenGo

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 06fea7a78f4a51a30fc5421a47a3515560a7c1fc
parent 7d4316ff226987fd92794ba434795fa77c097470
Author: Tyler Clark <tyler.clark@foxide.xyz>
Date:   Thu, 23 Apr 2026 21:32:13 -0400

Adding ability to ignore invalid file types, and bumping version num

This patch will check for file extensions and ignore ones that aren't '.md'.
In the future, we will also check for at least '.org' as well.
This version also bumps the version number to 0.3

Diffstat:
Mmain.go | 16+++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/main.go b/main.go @@ -23,11 +23,11 @@ import ( "fmt" // For formatting some outputs "os" // File system and arguments "os/exec" // For running OS operations - "path" // For removing file extensions + "path" // For removing and detecting file extensions ) /* Version Number */ -const version = "0.0.2: Shoddy" +const version = "0.0.3: Progress" /* This is a test function to try to copy a directory */ @@ -84,8 +84,18 @@ func RemoveExt(filename string) string { /* need to be maintained over time as pandoc changes. The function will then put the output string */ /* Into the corresponding file */ -/* TODO: Add functionality to ignore non valid file types and entire directories */ +/* DONE: Add functionality to ignore non valid file types */ +/* TODO: Add functionality to ignore entire directories */ func ConvertFile(filepath, filename, destination string) error { + + /* Skipping invalid file types */ + /* Add support for .org files later */ + validFile := path.Ext(filename) + if validFile != ".md" { + fmt.Println("Skipping file:", filename) + return nil + } + fmt.Println("Converting following file to HTML:", filename) oFile := RemoveExt(filename) cmd := exec.Command("pandoc", "-s", "--template", "template.html", filepath + "/" + filename)