utils

package
v0.0.0-...-23cc373 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscoverFiles

func DiscoverFiles(rootDir string) (error, []string)

DiscoverFiles discovers all markdown files which are within a directory and its subdirectories recursively, if successfull, it returns err!=nil and a list of paths relative to rootDir

func GenerateUrls

func GenerateUrls(router *gin.Engine, rootDir string, files []string) error

GenerateUrls takes the router and generates appropriate urls for the found markdown files if err!=nil it returns the encountered error. The markdown files are assumed to be safe code.

func ProcessFile

func ProcessFile(path string) (error, []byte)

ProcessFile reads the file from the path and converts the markdown content into html, if successfull it returns error=nil and the markdown html as an array of bytes

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL