forked from kubernetes/kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The basic idea is that in the main mungedocs we run the entirefile and create an annotated set of lines about that file. All mungers then act on a struct mungeLines instead of on a bytes array. Making use of the metadata where appropriete. Helper functions exist to make updating a 'macro block' extremely easy.
- Loading branch information
Showing
22 changed files
with
753 additions
and
507 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# 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](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/cmd/mungedocs/README.md?pixel)]() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.