diff --git a/docgen.sh b/docgen.sh index cd661329..13cd6fec 100755 --- a/docgen.sh +++ b/docgen.sh @@ -1,12 +1,35 @@ #!/bin/bash # Generate docs.md # requires pydoc-markdown 4.5.0 +readme_config=$(cat <<'EOF' +{ + "processors": [ + { + "type": "filter" + }, + { + "type": "pydocmd" + } + ], + "renderer": { + "type": "markdown", + "header_level_by_type": { + "Module": 1, + "Class": 3, + "Method": 3, + "Function": 3, + "Data": 3 + } + } +} +EOF +) + toc_config=$(cat <<'EOF' { "processors": [ { - "type": "filter", - "expression":"not name ==\"info\" and default()" + "type": "filter" }, { "type": "pydocmd" @@ -27,12 +50,12 @@ toc_config=$(cat <<'EOF' EOF ) -config=$(cat <<'EOF' +parser_config=$(cat <<'EOF' { "processors": [ { "type": "filter", - "expression":"not name ==\"info\" and default()" + "expression": "not name == \"info\" and not name.startswith(\"_\") and default()" }, { "type": "pydocmd" @@ -54,7 +77,7 @@ EOF cd jc echo Building docs for: package -pydoc-markdown -m jc "${config}" > ../docs/readme.md +pydoc-markdown -m jc "${readme_config}" > ../docs/readme.md echo Building docs for: lib pydoc-markdown -m jc.lib "${toc_config}" > ../docs/lib.md @@ -86,7 +109,7 @@ do echo "Building docs for: ${parser_name}" echo "[Home](https://kellyjonbrazil.github.io/jc/)" > ../docs/parsers/"${parser_name}".md - pydoc-markdown -m jc.parsers."${parser_name}" "${config}" >> ../docs/parsers/"${parser_name}".md + pydoc-markdown -m jc.parsers."${parser_name}" "${parser_config}" >> ../docs/parsers/"${parser_name}".md echo "### Parser Information" >> ../docs/parsers/"${parser_name}".md echo "Compatibility: ${compatible}" >> ../docs/parsers/"${parser_name}".md echo >> ../docs/parsers/"${parser_name}".md diff --git a/docs/parsers/ifconfig.md b/docs/parsers/ifconfig.md index 8bd01420..b742d594 100644 --- a/docs/parsers/ifconfig.md +++ b/docs/parsers/ifconfig.md @@ -191,100 +191,6 @@ Examples: } ] - - -### \_IfconfigParser Objects - -```python -class _IfconfigParser(object) -``` - -ifconfig parser module written by threeheadedknight@protonmail.com - - - -### \_\_init\_\_ - -```python -def __init__(console_output) -``` - -:param console_output: - - - -### list\_interfaces - -```python -def list_interfaces() -``` - -:return: - - - -### count\_interfaces - -```python -def count_interfaces() -``` - -:return: - - - -### filter\_interfaces - -```python -def filter_interfaces(**kwargs) -``` - -:param kwargs: -:return: - - - -### get\_interface - -```python -def get_interface(name) -``` - -:param name: -:return: - - - -### get\_interfaces - -```python -def get_interfaces() -``` - -:return: - - - -### is\_available - -```python -def is_available(name) -``` - -:param name: -:return: - - - -### parser - -```python -def parser(source_data) -``` - -:param source_data: -:return: - ### parse diff --git a/docs/parsers/traceroute.md b/docs/parsers/traceroute.md index 25657190..1ab094fb 100644 --- a/docs/parsers/traceroute.md +++ b/docs/parsers/traceroute.md @@ -125,54 +125,6 @@ Examples: ] } - - -### \_\_version\_\_ - -Copyright (C) 2015 Luis Benitez - -Parses the output of a traceroute execution into an AST (Abstract Syntax Tree). - -The MIT License (MIT) - -Copyright (c) 2014 Luis Benitez - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - - - -### \_Hop Objects - -```python -class _Hop(object) -``` - - - -### add\_probe - -```python -def add_probe(probe) -``` - -Adds a Probe instance to this hop's results. - ### parse