Skip to content

Commit

Permalink
Update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dim0x69 committed Oct 25, 2024
1 parent 8987b07 commit 5ba072c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func getMarkdownFilePaths(fileFlag string) []string {
return mdFiles
}

// Defaults for ConfigBlock are set in findHeadingWalker
type ConfigBlock struct {
OnError string // Valid OnError values are 'ignore' and 'fail'. Default is 'ignore'
SheBang bool
Expand Down
6 changes: 1 addition & 5 deletions parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,10 @@ func loadCommands(markdownFile string, commands map[string]CommandBlock) error {
The search strategy is as follows. We start at the beginning of the document, parse the Markdown file into an AST and walk the tree:
1 We search for a heading. (findHeadingWalker)
2 If we find a heading, we walk all siblings of the heading and call praseCodeBlock for all FencedCodeBlock nodes.
2 If we find a heading, we walk all siblings of the heading and call parseCodeBlock for all FencedCodeBlock nodes and parseConfigBlock for all FencedCodeBlock nodes with the language 'mdx'.
praseCodeBlock extacts the code from the code block, updates the currentCommandBlock and appends the code block to the currentCommandBlock.CodeBlocks.
3 Goto 1.
*/

// TODO: load all commands

source, err := os.ReadFile(markdownFile)
if err != nil {
return err
Expand Down Expand Up @@ -202,7 +199,6 @@ func loadCommands(markdownFile string, commands map[string]CommandBlock) error {
// Reset the config block. Defaults are defined here.
// parseConfigBlock will update the currentConfigBlock if a config block is found.
// parseCodeBlock will use the currentConfigBlock to update the ConfigBlock of the CodeBlock.

currentConfigBlock = ConfigBlock{OnError: "ignore"}

if _, exists := commands[currentCommandBlock.Name]; exists {
Expand Down

0 comments on commit 5ba072c

Please sign in to comment.