Skip to content

Commit

Permalink
Some other enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelBoucey committed Aug 20, 2023
1 parent 277c0d0 commit e72a18d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,23 @@ help:
build:
@echo
${BUILD}
${MV}
@echo && dumber -v || echo

clean:
rm -f test/*numbered-sections*

distclean: clean
rm -f ${HOME}/go/bin/dumber
rm -f dumber ${HOME}/go/bin/dumber

install: build
${MV}
@echo && dumber -v || echo

watch:
@which CompileDaemon > /dev/null 2>&1 || (echo "CompileDaemon is required to watch (https://github.com/githubnemo/CompileDaemon)."; exit 1)
CompileDaemon -build "${BUILD}" -command "${MV}"

.PHONY: test
test: build
test: install
test/run
@echo

4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ func main() {
}

func toToCEntry(r *regexp.Regexp, l string) string {
ms := r.FindStringSubmatch(l)
return (strings.Repeat(" ", len(ms[1])-1) + "- [" + ms[2] + "](#" + strings.ToLower(strings.ReplaceAll(ms[2], ".", "")+"-"+strings.ReplaceAll(ms[3], " ", "-")) + ") " + ms[3])
m := r.FindStringSubmatch(l)
return (strings.Repeat(" ", len(m[1])-1) + "- [" + m[2] + "](#" + strings.ToLower(strings.ReplaceAll(m[2], ".", "")+"-"+strings.ReplaceAll(m[3], " ", "-")) + ") " + m[3])
}

func addSectionChunk(s *string, hc int, cht int, ht int) {
Expand Down

0 comments on commit e72a18d

Please sign in to comment.