diff --git a/README.md b/README.md index c154c7a..e255911 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,6 @@ This seems intended by the creators of the language. #### TODO -- print header tree - delph deeper into different Markdown implementations (like CommonMark) - add support for "Setext-style headers" - -#### logic ideas - -For a tree structure you will probably need parent/child relationships.\ -You might need to create a parent and a child field in the header struct. +- maybe remove pound signs infront of headers diff --git a/tree.go b/tree.go index 67bd79b..d615551 100644 --- a/tree.go +++ b/tree.go @@ -93,15 +93,13 @@ func get_child_indices(header_index int, headings []heading) []int { func tree(index int, prefix string, headings []heading) { children := get_child_indices(index, headings) - //fmt.Printf("children: %v\n", children) for index, child_index := range children { - //fmt.Printf("child_index: %d\n", child_index) if index == (len(children) - 1) { - fmt.Println(prefix+"`--", headings[child_index].text) + fmt.Printf("%s %s (%d)\n", prefix+"`--", headings[child_index].text, headings[child_index].line) tree(child_index, prefix+" ", headings) } else { - fmt.Println(prefix+"|--", headings[child_index].text) + fmt.Printf("%s %s (%d)\n", prefix+"|--", headings[child_index].text, headings[child_index].line) tree(child_index, prefix+"| ", headings) } }