Skip to content

Commit

Permalink
Fixed documentation for bases.__all__
Browse files Browse the repository at this point in the history
  • Loading branch information
sg495 committed Dec 30, 2021
1 parent 28ed1d1 commit 9306573
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 17 deletions.
28 changes: 14 additions & 14 deletions docs/api/bases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ bases.__all__

The following members were explicitly reexported using ``__all__``:

- :py:obj:`bases.encoding.zeropad.base10`
- :py:obj:`bases.encoding.zeropad.base16`
- :py:obj:`bases.encoding.zeropad.base2`
- :py:obj:`bases.encoding.fixchar.base32`
- :py:obj:`bases.encoding.fixchar.base32hex`
- :py:obj:`bases.encoding.fixchar.base32z`
- :py:obj:`bases.encoding.zeropad.base36`
- :py:obj:`bases.encoding.block.base45`
- :py:obj:`bases.encoding.zeropad.base58btc`
- :py:obj:`bases.encoding.zeropad.base58flickr`
- :py:obj:`bases.encoding.zeropad.base58ripple`
- :py:obj:`bases.encoding.fixchar.base64`
- :py:obj:`bases.encoding.fixchar.base64url`
- :py:obj:`bases.encoding.fixchar.base8`
- :py:obj:`bases.encoding.base10`
- :py:obj:`bases.encoding.base16`
- :py:obj:`bases.encoding.base2`
- :py:obj:`bases.encoding.base32`
- :py:obj:`bases.encoding.base32hex`
- :py:obj:`bases.encoding.base32z`
- :py:obj:`bases.encoding.base36`
- :py:obj:`bases.encoding.base45`
- :py:obj:`bases.encoding.base58btc`
- :py:obj:`bases.encoding.base58flickr`
- :py:obj:`bases.encoding.base58ripple`
- :py:obj:`bases.encoding.base64`
- :py:obj:`bases.encoding.base64url`
- :py:obj:`bases.encoding.base8`
- :py:func:`bases.encoding.get`
- :py:func:`bases.encoding.has`
- :py:func:`bases.encoding.make`
Expand Down
22 changes: 21 additions & 1 deletion docs/make-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,25 @@
},
"exclude_members": {},
"include_modules": [],
"exclude_modules": []
"exclude_modules": [],
"member_fullnames": {
"bases": {
"base2": "bases.encoding.base2",
"base8": "bases.encoding.base8",
"base10": "bases.encoding.base10",
"base16": "bases.encoding.base16",
"base32": "bases.encoding.base32",
"base32hex": "bases.encoding.base32hex",
"base32z": "bases.encoding.base32z",
"base36": "bases.encoding.base36",
"base64": "bases.encoding.base64",
"base64url": "bases.encoding.base64url",
"base10": "bases.encoding.base10",
"base36": "bases.encoding.base36",
"base58btc": "bases.encoding.base58btc",
"base58flickr": "bases.encoding.base58flickr",
"base58ripple": "bases.encoding.base58ripple",
"base45": "bases.encoding.base45"
}
}
}
9 changes: 7 additions & 2 deletions docs/make-api.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def make_apidocs() -> None:
"toc_filename": Optional[str],
"include_members": Dict[str, List[str]],
"exclude_members": Dict[str, List[str]],
"exclude_modules": List[str]
"exclude_modules": List[str],
"member_fullnames": Dict[str, Dict[str, str]],
}
Set "toc_filename" to null to avoid generating a table of contents file.
Expand All @@ -61,6 +62,8 @@ def make_apidocs() -> None:
validate(include_modules, List[str])
exclude_modules = config.get("exclude_modules", None)
validate(exclude_modules, List[str])
member_fullnames = config.get("member_fullnames", None)
validate(member_fullnames, Dict[str, Dict[str, str]])
except FileNotFoundError:
print(err_msg)
sys.exit(1)
Expand Down Expand Up @@ -110,7 +113,9 @@ def make_apidocs() -> None:
imported_member = member_module is not None and member_module != mod
if mod_name in include_members and member_name in include_members[mod_name]:
imported_member = False
if imported_member:
if mod_name in member_fullnames and member_name in member_fullnames[mod_name]:
member_fullname = member_fullnames[mod_name][member_name]
elif imported_member:
if inspect.ismodule(member):
member_fullname = member_module_name or ""
else:
Expand Down

0 comments on commit 9306573

Please sign in to comment.