loop through headers differently to have an order and updated README
This commit is contained in:
parent
abe168fa7c
commit
0539436231
@ -9,3 +9,8 @@ This seems intended by the creators of the language.
|
||||
- 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.
|
||||
|
6
main.go
6
main.go
@ -78,7 +78,9 @@ func main() {
|
||||
|
||||
header_level_count := count_levels(headings)
|
||||
|
||||
for key, value := range header_level_count {
|
||||
fmt.Printf("Header %d occurs %d times.\n", key, value)
|
||||
for i := 0; i <= 6; i++ {
|
||||
if header_level_count[i] != 0 {
|
||||
fmt.Printf("Header %d occurs %d times.\n", i, header_level_count[i])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user