k3s/cmd/mungedocs
Eric Tune 1ce3081e55 Do not delete text that fails preformat-balance
If preformat lines are unbalanced, do not delete all the lines from there to
end of file.  That might be the only copy of edits made by the user.

Do not print entire file contents for munge errors affecting entire file.
2016-01-11 10:44:10 -08:00
..
testdata examples munger allows any file extension. 2015-12-07 14:18:42 -08:00
README.md Rewrite how the munger works 2015-07-30 20:41:30 -04:00
analytics.go Rewrite how the munger works 2015-07-30 20:41:30 -04:00
analytics_test.go Rewrite how the munger works 2015-07-30 20:41:30 -04:00
example_syncer.go examples munger allows any file extension. 2015-12-07 14:18:42 -08:00
example_syncer_test.go examples munger allows any file extension. 2015-12-07 14:18:42 -08:00
headers.go Add a whitespace munger 2015-07-30 20:41:30 -04:00
headers_test.go Add a whitespace munger 2015-07-30 20:41:30 -04:00
kubectl_dash_f.go Add a whitespace munger 2015-07-30 20:41:30 -04:00
kubectl_dash_f_test.go Add a whitespace munger 2015-07-30 20:41:30 -04:00
links.go mungedocs: fix ignored errors in link checker 2016-01-05 12:58:30 -08:00
links_test.go point mugnedocs at new organization 2015-08-12 16:37:43 -07:00
mungedocs.go Do not delete text that fails preformat-balance 2016-01-11 10:44:10 -08:00
preformatted.go Do not delete text that fails preformat-balance 2016-01-11 10:44:10 -08:00
preformatted_test.go Do not delete text that fails preformat-balance 2016-01-11 10:44:10 -08:00
toc.go Rewrite how the munger works 2015-07-30 20:41:30 -04:00
toc_test.go Rewrite how the munger works 2015-07-30 20:41:30 -04:00
unversioned_warning.go Munger now checks the release branch to verify if a file exist there before 2015-12-21 10:40:15 -08:00
unversioned_warning_test.go Munger now checks the release branch to verify if a file exist there before 2015-12-21 10:40:15 -08:00
util.go Rewrite how the munger works 2015-07-30 20:41:30 -04:00
util_test.go Rewrite how the munger works 2015-07-30 20:41:30 -04:00
whitespace.go Add a whitespace munger 2015-07-30 20:41:30 -04:00
whitespace_test.go Add a whitespace munger 2015-07-30 20:41:30 -04:00

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