-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update portray to forked version and add support for readthedocs
- Loading branch information
Showing
5 changed files
with
87 additions
and
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
site_name: Omnipy | ||
theme: | ||
name: material | ||
custom_dir: docs/overrides | ||
# features: | ||
# - content.code.annotation | ||
# - navigation.tabs | ||
# - search.highlight | ||
# - toc.integrate | ||
language: en | ||
palette: | ||
- scheme: omnipy | ||
extra_css: | ||
- stylesheets/extra.css | ||
markdown_extensions: | ||
- admonition | ||
- codehilite | ||
- extra | ||
- pymdownx.details | ||
- pymdownx.highlight: | ||
anchor_linenums: true | ||
line_spans: __span | ||
pygments_lang_class: true | ||
- pymdownx.inlinehilite | ||
- pymdownx.snippets | ||
- pymdownx.superfences | ||
|
||
#markdown_extensions: | ||
# - admonition | ||
# - attr_list | ||
# - footnotes | ||
# - md_in_html |
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env python | ||
from enum import Enum | ||
import os | ||
|
||
import pdocs.doc | ||
from portray import api as portray_api | ||
import typer | ||
|
||
|
||
def _is_exported(ident_name): | ||
return not ident_name.startswith("_") or ident_name in [ | ||
'__enter__', | ||
'__exit__', | ||
'__cmp__', | ||
'__eq__', | ||
'__getattr__', | ||
'__setattr__', | ||
'__getitem_', | ||
'__setitem__', | ||
'__delitem__', | ||
'__iter__', | ||
'__call__' | ||
] | ||
|
||
|
||
pdocs.doc._is_exported = _is_exported | ||
|
||
|
||
class Command(str, Enum): | ||
IN_BROWSER = 'in_browser' | ||
AS_HTML = 'as_html' | ||
FOR_READTHEDOCS = 'for_readthedocs' | ||
# ON_GITHUB_PAGES = 'on_github_pages' | ||
|
||
|
||
def main(cmd: Command): | ||
if cmd == Command.IN_BROWSER: | ||
portray_api.in_browser() | ||
if cmd == Command.AS_HTML: | ||
portray_api.as_html() | ||
if cmd == Command.FOR_READTHEDOCS: | ||
readthedocs_path = os.getenv('READTHEDOCS_OUTPUT') | ||
portray_api.as_html(output_dir=os.path.join(readthedocs_path, 'html')) | ||
# elif cmd == Command.ON_GITHUB_PAGES: | ||
# portray_api.on_github_pages() | ||
|
||
|
||
if __name__ == '__main__': | ||
typer.run(main) |
This file was deleted.
Oops, something went wrong.