forked from 2600hz/kazoo
-
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.
* docs_target: add target and script to validate mkdocs remove /*...*/ comments in doc/ * docs_target: fail build when yml has errors * docs_target: test command result * docs_target: add missing backtick * docs_target: ensure use of python2 * docs_target: add python deps needed * docs_target: add python deps * docs_target: make sure pip is upgraded
- Loading branch information
1 parent
0d4f182
commit cad1160
Showing
10 changed files
with
61 additions
and
26 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
/* | ||
Section: Kazoo | ||
Title: Dialyzer | ||
*/ | ||
|
||
# Using Dialyzer on Kazoo | ||
|
||
|
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 |
---|---|---|
@@ -1,7 +1,3 @@ | ||
/* | ||
Section: Kazoo | ||
Title: Releases | ||
*/ | ||
|
||
# How to use Erlang releases with Kazoo | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
/* | ||
Section: Pivot | ||
Title: Pivot KazooCon 2014 Demo | ||
Language: en-US | ||
*/ | ||
|
||
# Infrastructure by Pastie.org | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
/* | ||
Section: Kazoo | ||
Title: Caller ID Formatting | ||
*/ | ||
|
||
# Caller ID Formatting | ||
|
||
|
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 |
---|---|---|
@@ -1,9 +1,3 @@ | ||
/* | ||
Section: Reference | ||
Title: Rating and Limits | ||
Language: en-US | ||
Version: 3.22 | ||
*/ | ||
|
||
# Rating and Limits | ||
|
||
|
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,46 @@ | ||
#!/usr/bin/env python2 | ||
from __future__ import print_function | ||
|
||
import yaml, os.path, sys | ||
|
||
# from https://stackoverflow.com/questions/5574702/how-to-print-to-stderr-in-python | ||
def eprint(*args, **kwargs): | ||
print(*args, file=sys.stderr, **kwargs) | ||
|
||
def parse_page_dict(errors_detected, kv): | ||
(header, pages) = kv | ||
if pages is None: | ||
eprint("section ", header, " is incomplete") | ||
return True | ||
else: | ||
return parse_page(errors_detected, pages) | ||
|
||
def parse_page_string(errors_detected, page): | ||
if "index.md" != page and (not os.path.isfile(page)): | ||
eprint("page ", page, " is not valid") | ||
return True | ||
else: | ||
return errors_detected | ||
|
||
def parse_page(errors_detected, page): | ||
"parse a page for existence" | ||
if isinstance(page, dict): | ||
return reduce(parse_page_dict, page.items(), errors_detected) | ||
elif isinstance(page, list): | ||
return reduce(parse_page, page, errors_detected) | ||
elif isinstance(page, str): | ||
return parse_page_string(errors_detected, page) | ||
else: | ||
return errors_detected | ||
|
||
stream = open("doc/mkdocs/mkdocs.yml", 'r') | ||
mkdocs = yaml.load_all(stream) | ||
errors_detected = False | ||
|
||
for doc in mkdocs: | ||
for k,v in doc.items(): | ||
if "pages" == k: | ||
errors_detected = parse_page(False, v) | ||
|
||
if errors_detected: | ||
sys.exit(1) |