Files
kubernetes/cmd/mungedocs
Mike Danese 1934fc73e8 mungedocs: fix ignored errors in link checker
Before this change the link checker would ignore errors in a file if
the last link in a file was correct. The last link would wipe out the
error variable and set it to nil. Furthermore, it replaced errored
links with the empty string.

If we find an error that we can't correct, append the error message to
an an errs slice and leave the string as is.

Signed-off-by: Mike Danese <mikedanese@google.com>
2016-01-05 12:58:30 -08:00
..
2015-07-30 20:41:30 -04:00
2015-07-30 20:41:30 -04:00
2015-07-30 20:41:30 -04:00
2015-07-30 20:41:30 -04:00
2015-07-30 20:41:30 -04:00
2015-07-30 20:41:30 -04:00
2015-07-30 20:41:30 -04:00
2015-07-30 20:41:30 -04:00
2015-07-30 20:41:30 -04:00
2015-07-30 20:41:30 -04:00
2015-07-30 20:41:30 -04:00
2015-07-30 20:41:30 -04:00
2015-07-30 20:41:30 -04:00

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 preformmatted 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