k3s/cmd/mungedocs
Christoph Blecker 1049ec8594
Fix link tests in mungedocs
2017-06-05 22:37:20 -07:00
..
testdata Fix link tests in mungedocs 2017-06-05 22:37:20 -07:00
BUILD autogenerated 2017-04-14 10:40:57 -07:00
README.md Fix typos and linted_packages sorting 2016-10-31 18:31:08 +01:00
analytics.go
analytics_test.go
example_syncer.go
example_syncer_test.go
headers.go
headers_test.go
kubectl_dash_f.go
kubectl_dash_f_test.go
links.go
links_test.go Fix link tests in mungedocs 2017-06-05 22:37:20 -07:00
mungedocs.go Update the latestReleaseBranch to release-1.5 in the munger. 2016-11-05 19:56:24 -07:00
preformatted.go
preformatted_test.go
toc.go
toc_test.go
util.go
util_test.go
whitespace.go
whitespace_test.go

README.md

Documentation Mungers

Basically this is like lint/gofmt for md docs.

It basically does the following:

  • iterate over all files in the given doc root.
  • for each file split it into a slice (mungeLines) of lines (mungeLine)
  • a mungeline has metadata about each line typically determined by a 'fast' regex.
    • metadata contains things like 'is inside a preformatted block'
    • contains a markdown header
    • has a link to another file
    • etc..
    • if you have a really slow regex with a lot of backtracking you might want to write a fast one to limit how often you run the slow one.
  • each munger is then called in turn
    • they are given the mungeLines
    • they create an entirely new set of mungeLines with their modifications
    • the new set is returned
  • the new set is then fed into the next munger.
  • in the end we might commit the end mungeLines to the file or not (--verify)

Analytics