k3s/cmd/mungedocs
Clayton Coleman 4636af5b87
mungedocs should not assume upstream remote
The standard Git convention is "origin", not "upstream", so make it
flexible in the scripts for those who are set up differently.
2016-04-27 21:33:09 -04:00
..
testdata examples munger allows any file extension. 2015-12-07 14:18:42 -08:00
README.md
analytics.go
analytics_test.go
example_syncer.go Update guestbook examples; replace RC concepts with Deployment 2016-03-30 14:16:52 -07: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 WordPress example major update. 2016-03-25 11:40:35 -07:00
kubectl_dash_f_test.go Add a whitespace munger 2015-07-30 20:41:30 -04:00
links.go Detect & fix backwards markdown links (of the form (foo)[bar]) 2016-02-26 13:24:21 -08:00
links_test.go point mugnedocs at new organization 2015-08-12 16:37:43 -07:00
mungedocs.go mungedocs should not assume upstream remote 2016-04-27 21:33:09 -04: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
toc_test.go
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 Update the latestReleaseBranch to release-1.2 in the munger. 2016-03-08 18:59:28 -08:00
util.go
util_test.go
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