Coverage for src/docs.py: 42%
12 statements
« prev ^ index » next coverage.py v7.3.0, created at 2024-11-20 12:27 +0000
« prev ^ index » next coverage.py v7.3.0, created at 2024-11-20 12:27 +0000
1import logging
2import pathlib
4import pdoc
7logger = logging.getLogger('blog')
10def write_api_docs() -> int:
11 """
12 Generate the website API documentation.
14 Returns the total number of generated files so you have something
15 interesting to log.
17 >>> logger.info('wrote docs - %d file(s)', write_api_docs())
18 """
20 output_directory = pathlib.Path('./www/api/')
22 pdoc.pdoc('src', output_directory=output_directory)
24 results = output_directory.glob('**/*')
25 results = filter(lambda p: p.is_file(), results)
26 results = filter(lambda p: not p.name.startswith('.'), results)
27 results = list(results)
28 return len(results)