Implemented proper conversion of links to local markdown files into html links

This commit is contained in:
Daniel Fichtinger 2024-11-24 17:47:08 -05:00
parent 46e4f483f6
commit 7915a4bb09
7 changed files with 92 additions and 28 deletions

View file

@ -9,11 +9,11 @@ import (
"github.com/ficcdaf/zona/internal/util"
)
// validateFile checks whether a given path
// is a valid file && matches an expected extension
func validateFile(path, ext string) bool {
return (util.CheckExtension(path, ext) == nil) && (util.PathIsValid(path, true))
}
// // validateFile checks whether a given path
// // is a valid file && matches an expected extension
// func validateFile(path, ext string) bool {
// return (util.CheckExtension(path, ext) == nil) && (util.PathIsValid(path, true))
// }
func main() {
mdPath := flag.String("file", "", "Path to the markdown file.")
@ -41,11 +41,6 @@ func main() {
}
}
// if !validateFile(*mdPath, ".md") {
// fmt.Println("File validation failed!")
// os.Exit(1)
// }
// convert.ConvertFile(*mdPath, "test/test.html")
err := util.Traverse(*mdPath, "foobar")
if err != nil {
fmt.Printf("Error: %s\n", err.Error())