1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00

reduce TOC level

This commit is contained in:
Kelly Brazil
2024-03-14 21:58:43 -07:00
parent 37061227d9
commit a0dff721b1
5 changed files with 8 additions and 7 deletions

View File

@ -6,7 +6,7 @@ Convert parser doc string to markdown
import sys import sys
import importlib import importlib
from inspect import isfunction, signature, cleandoc from inspect import isfunction, signature, cleandoc
import yapf import yapf # type: ignore
import os import os
import sys import sys
@ -29,7 +29,7 @@ header = f'''[Home](https://kellyjonbrazil.github.io/jc/)
# {mod_path} # {mod_path}
''' '''
summary = module.__doc__ summary = module.__doc__ or ''
functions = [] functions = []
for attribute in dir(module): for attribute in dir(module):
@ -45,7 +45,7 @@ for attribute in dir(module):
functions.append(attribute) functions.append(attribute)
######## TABLE OF CONTENTS ######## ######## TABLE OF CONTENTS ########
toc = f'# Table of Contents\n\n*[{mod_path}](#{mod_path})\n' toc = f'## Table of Contents\n\n*[{mod_path}](#{mod_path})\n'
for api in functions: for api in functions:
toc = f'{toc} *[{api}](#{mod_path}.{api})\n' toc = f'{toc} *[{api}](#{mod_path}.{api})\n'
@ -78,6 +78,7 @@ if 'jc.parsers.' in mod_path and not 'universal' in mod_path:
footer = footer + 'This parser can be used with the `--slurp` command-line option.\n\n' footer = footer + 'This parser can be used with the `--slurp` command-line option.\n\n'
footer = footer + f'Version {ver} by {author} ({author_email})\n' footer = footer + f'Version {ver} by {author} ({author_email})\n'
final_doc = ''
if 'jc.parsers.' in mod_path and not 'universal' in mod_path: if 'jc.parsers.' in mod_path and not 'universal' in mod_path:
final_doc = header + '\n' + summary + '\n\n' + api_docs + '\n' + footer final_doc = header + '\n' + summary + '\n\n' + api_docs + '\n' + footer
elif mod_path == 'jc': elif mod_path == 'jc':

View File

@ -3,7 +3,7 @@
# jc.lib # jc.lib
# Table of Contents ## Table of Contents
*[jc.lib](#jc.lib) *[jc.lib](#jc.lib)
*[all_parser_info](#jc.lib.all_parser_info) *[all_parser_info](#jc.lib.all_parser_info)

View File

@ -3,7 +3,7 @@
# jc.parsers.universal # jc.parsers.universal
# Table of Contents ## Table of Contents
*[jc.parsers.universal](#jc.parsers.universal) *[jc.parsers.universal](#jc.parsers.universal)
*[simple_table_parse](#jc.parsers.universal.simple_table_parse) *[simple_table_parse](#jc.parsers.universal.simple_table_parse)

View File

@ -3,7 +3,7 @@
# jc.streaming # jc.streaming
# Table of Contents ## Table of Contents
*[jc.streaming](#jc.streaming) *[jc.streaming](#jc.streaming)
*[add_jc_meta](#jc.streaming.add_jc_meta) *[add_jc_meta](#jc.streaming.add_jc_meta)

View File

@ -3,7 +3,7 @@
# jc.utils # jc.utils
# Table of Contents ## Table of Contents
*[jc.utils](#jc.utils) *[jc.utils](#jc.utils)
*[compatibility](#jc.utils.compatibility) *[compatibility](#jc.utils.compatibility)