Skip to content

Commit 7e289a0

Browse files
committed
update docs
1 parent 3c9e8ec commit 7e289a0

File tree

99 files changed

+283
-160
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+283
-160
lines changed
Lines changed: 87 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,102 @@
1+
"""This script generates the rst files for the modules in the bookmarks package.
2+
3+
Use it in conjunction with make.bat to generate the documentation.
4+
5+
"""
16
import os
27

3-
SOURCE = os.path.normpath(f'{__file__}/{os.pardir}/{os.pardir}/{os.pardir}/bookmarks').replace('\\', '/')
4-
DOCS_DIR = os.path.normpath(f'{__file__}/{os.pardir}/modules').replace('\\', '/')
8+
PYTHON_MODULE_DIR = os.path.normpath(f'{__file__}/{os.pardir}/{os.pardir}/{os.pardir}/bookmarks').replace('\\', '/')
9+
PYTHON_MODULE_DOCS_DIR = os.path.normpath(f'{__file__}/{os.pardir}/modules').replace('\\', '/')
510

6-
def recursive_search(path):
7-
for entry in os.scandir(path):
8-
if entry.is_dir():
9-
yield from recursive_search(entry.path)
10-
else:
11-
yield entry
11+
if not os.path.isdir(PYTHON_MODULE_DOCS_DIR):
12+
raise RuntimeError(f'Could not find the docs directory: {PYTHON_MODULE_DOCS_DIR}')
1213

14+
if not os.path.isdir(PYTHON_MODULE_DIR):
15+
raise RuntimeError(f'Could not find the source directory: {PYTHON_MODULE_DIR}')
1316

14-
_source = '/'.join(SOURCE.split('/')[:-1])
15-
contents = []
1617

17-
for entry in recursive_search(SOURCE):
18-
if not entry.name.endswith('.py'):
19-
continue
18+
def recursive_search(_path):
19+
if '__pycache__' in _path:
20+
return
21+
22+
print(f'>>> Searching for modules in: {_path}')
23+
for _entry in os.scandir(_path):
24+
if _entry.is_dir():
25+
yield from recursive_search(_entry.path.replace('\\', '/'))
26+
else:
27+
yield _entry
2028

21-
path = entry.path.replace('\\', '/')
2229

23-
parent = os.path.join(path, os.pardir)
24-
basemod = os.path.normpath(parent).replace('\\', '/').replace(_source, '').strip('/')
25-
basemod = basemod if basemod else 'bookmarks'
2630

27-
if entry.name == '__init__.py':
28-
rst_dir = f'{DOCS_DIR}/{basemod}'
29-
rst_file = f'{rst_dir}/{basemod}.rst'
31+
if __name__ == '__main__':
32+
print('>>> Generating the documentation for the bookmarks package:')
33+
print(f'>>> Source: {PYTHON_MODULE_DIR}')
3034

31-
if not os.path.isdir(rst_dir):
32-
os.makedirs(rst_dir)
33-
continue
35+
_source = '/'.join(PYTHON_MODULE_DIR.split('/')[:-1])
36+
contents = []
3437

35-
basename = path.replace(_source, '').strip('/').replace('.py', '.rst')
36-
basename = basename if basename else 'bookmarks'
37-
rst_file = f'{DOCS_DIR}/{basename}'
38-
with open(rst_file, 'w') as f:
38+
# Generate the index bookmarks.rst file
39+
with open(f'{PYTHON_MODULE_DOCS_DIR}/bookmarks.rst', 'w') as f:
3940
f.write(f'.. meta::\n')
4041
f.write(f' :description: Developer documentation page for the Bookmarks python modules\n')
41-
f.write(f' :keywords: Bookmarks, bookmarksvfx, asset manager, assets, PySide, Qt5, PySide2, Python, vfx, animation, film, productivity, free, open-source, opensource, lightweight, ShotGrid, RV, FFMpeg, ffmpeg, publish, manage, digital content management, production, OpenImageIO\n')
42+
f.write(
43+
f' :keywords: Bookmarks, bookmarksvfx, pipeline, pipe, asset manager, assets, PySide, Qt, PySide,'
44+
f'Python, vfx, animation, film, production, open-source, opensource, ShotGun, ShotGrid, RV, '
45+
f'ffmpeg, openimageio, publish, manage, digital content management\n'
46+
)
4247
f.write(f'\n')
43-
title = '.'.join(basename.replace(".rst", '').split('/')[1:])
44-
f.write(f'{title}\n')
45-
f.write('=' * (len(basemod) + 10) + '\n')
48+
f.write(f'bookmarks\n')
49+
f.write(f'=========\n')
4650
f.write(f'\n')
47-
f.write(f'.. automodule:: {basename.replace("/", ".").replace(".rst", "")}\n')
48-
f.write(' :members:\n')
49-
f.write(' :show-inheritance:\n')
51+
f.write(f'.. automodule:: bookmarks\n')
52+
f.write(f' :members:\n')
53+
f.write(f' :show-inheritance:\n')
54+
f.write(f'\n')
55+
f.write(f'.. toctree::\n')
56+
f.write(f' :glob:\n')
57+
f.write(f'\n')
58+
f.write(f' bookmarks/**\n')
59+
f.write(f'\n')
60+
61+
for entry in recursive_search(PYTHON_MODULE_DIR):
62+
if not entry.name.endswith('.py'):
63+
continue
64+
65+
path = entry.path.replace('\\', '/')
66+
67+
parent = os.path.join(path, os.pardir)
68+
basemod = os.path.normpath(parent).replace('\\', '/').replace(_source, '').strip('/')
69+
basemod = basemod if basemod else 'bookmarks'
70+
71+
if entry.name == '__init__.py':
72+
rst_dir = f'{PYTHON_MODULE_DOCS_DIR}/{basemod}'
73+
rst_file = f'{rst_dir}/{basemod}.rst'
74+
os.makedirs(rst_dir, exist_ok=True)
75+
continue
76+
77+
basename = path.replace(_source, '').strip('/').replace('.py', '.rst')
78+
basename = basename if basename else 'bookmarks'
79+
rst_file = f'{PYTHON_MODULE_DOCS_DIR}/{basename}'
80+
81+
os.makedirs(os.path.dirname(rst_file), exist_ok=True)
82+
83+
with open(rst_file, 'w') as f:
84+
print(f'>>> Generating rst for: {path}')
85+
86+
f.write(f'.. meta::\n')
87+
f.write(f' :description: Developer documentation page for the Bookmarks python modules\n')
88+
f.write(
89+
f' :keywords: Bookmarks, bookmarksvfx, pipeline, pipe, asset manager, assets, PySide, Qt, PySide,'
90+
f'Python, vfx, animation, film, production, open-source, opensource, ShotGun, ShotGrid, RV, '
91+
f'ffmpeg, openimageio, publish, manage, digital content management\n'
92+
)
93+
f.write(f'\n')
94+
title = '.'.join(basename.replace(".rst", '').split('/')[1:])
95+
f.write(f'{title}\n')
96+
f.write('=' * (len(basemod) + 10) + '\n')
97+
f.write(f'\n')
98+
f.write(f'.. automodule:: {basename.replace("/", ".").replace(".rst", "")}\n')
99+
f.write(' :members:\n')
100+
f.write(' :show-inheritance:\n')
101+
102+

docs/src/modules/bookmarks.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. meta::
22
:description: Developer documentation page for the Bookmarks python modules
3-
:keywords: Bookmarks, bookmarksvfx, asset manager, assets, PySide, Qt5, PySide2, Python, vfx, animation, film, productivity, free, open-source, opensource, lightweight, ShotGrid, RV, FFMpeg, ffmpeg, publish, manage, digital content management, production, OpenImageIO
3+
:keywords: Bookmarks, bookmarksvfx, pipeline, pipe, asset manager, assets, PySide, Qt, PySide,Python, vfx, animation, film, production, open-source, opensource, ShotGun, ShotGrid, RV, ffmpeg, openimageio, publish, manage, digital content management
44

55
bookmarks
66
=========
@@ -9,8 +9,8 @@ bookmarks
99
:members:
1010
:show-inheritance:
1111

12-
1312
.. toctree::
14-
:glob:
13+
:glob:
14+
15+
bookmarks/**
1516

16-
bookmarks/**

docs/src/modules/bookmarks/actions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. meta::
22
:description: Developer documentation page for the Bookmarks python modules
3-
:keywords: Bookmarks, bookmarksvfx, asset manager, assets, PySide, Qt5, PySide2, Python, vfx, animation, film, productivity, free, open-source, opensource, lightweight, ShotGrid, RV, FFMpeg, ffmpeg, publish, manage, digital content management, production, OpenImageIO
3+
:keywords: Bookmarks, bookmarksvfx, pipeline, pipe, asset manager, assets, PySide, Qt, PySide,Python, vfx, animation, film, production, open-source, opensource, ShotGun, ShotGrid, RV, ffmpeg, openimageio, publish, manage, digital content management
44

55
actions
66
===================

docs/src/modules/bookmarks/bookmarker/bookmark_editor.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. meta::
22
:description: Developer documentation page for the Bookmarks python modules
3-
:keywords: Bookmarks, bookmarksvfx, asset manager, assets, PySide, Qt5, PySide2, Python, vfx, animation, film, productivity, free, open-source, opensource, lightweight, ShotGrid, RV, FFMpeg, ffmpeg, publish, manage, digital content management, production, OpenImageIO
3+
:keywords: Bookmarks, bookmarksvfx, pipeline, pipe, asset manager, assets, PySide, Qt, PySide,Python, vfx, animation, film, production, open-source, opensource, ShotGun, ShotGrid, RV, ffmpeg, openimageio, publish, manage, digital content management
44

55
bookmarker.bookmark_editor
66
==============================

docs/src/modules/bookmarks/bookmarker/job_editor.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. meta::
22
:description: Developer documentation page for the Bookmarks python modules
3-
:keywords: Bookmarks, bookmarksvfx, asset manager, assets, PySide, Qt5, PySide2, Python, vfx, animation, film, productivity, free, open-source, opensource, lightweight, ShotGrid, RV, FFMpeg, ffmpeg, publish, manage, digital content management, production, OpenImageIO
3+
:keywords: Bookmarks, bookmarksvfx, pipeline, pipe, asset manager, assets, PySide, Qt, PySide,Python, vfx, animation, film, production, open-source, opensource, ShotGun, ShotGrid, RV, ffmpeg, openimageio, publish, manage, digital content management
44

55
bookmarker.job_editor
66
==============================

docs/src/modules/bookmarks/bookmarker/main.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. meta::
22
:description: Developer documentation page for the Bookmarks python modules
3-
:keywords: Bookmarks, bookmarksvfx, asset manager, assets, PySide, Qt5, PySide2, Python, vfx, animation, film, productivity, free, open-source, opensource, lightweight, ShotGrid, RV, FFMpeg, ffmpeg, publish, manage, digital content management, production, OpenImageIO
3+
:keywords: Bookmarks, bookmarksvfx, pipeline, pipe, asset manager, assets, PySide, Qt, PySide,Python, vfx, animation, film, production, open-source, opensource, ShotGun, ShotGrid, RV, ffmpeg, openimageio, publish, manage, digital content management
44

55
bookmarker.main
66
==============================

docs/src/modules/bookmarks/bookmarker/server_editor.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. meta::
22
:description: Developer documentation page for the Bookmarks python modules
3-
:keywords: Bookmarks, bookmarksvfx, asset manager, assets, PySide, Qt5, PySide2, Python, vfx, animation, film, productivity, free, open-source, opensource, lightweight, ShotGrid, RV, FFMpeg, ffmpeg, publish, manage, digital content management, production, OpenImageIO
3+
:keywords: Bookmarks, bookmarksvfx, pipeline, pipe, asset manager, assets, PySide, Qt, PySide,Python, vfx, animation, film, production, open-source, opensource, ShotGun, ShotGrid, RV, ffmpeg, openimageio, publish, manage, digital content management
44

55
bookmarker.server_editor
66
==============================

docs/src/modules/bookmarks/common/core.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. meta::
22
:description: Developer documentation page for the Bookmarks python modules
3-
:keywords: Bookmarks, bookmarksvfx, asset manager, assets, PySide, Qt5, PySide2, Python, vfx, animation, film, productivity, free, open-source, opensource, lightweight, ShotGrid, RV, FFMpeg, ffmpeg, publish, manage, digital content management, production, OpenImageIO
3+
:keywords: Bookmarks, bookmarksvfx, pipeline, pipe, asset manager, assets, PySide, Qt, PySide,Python, vfx, animation, film, production, open-source, opensource, ShotGun, ShotGrid, RV, ffmpeg, openimageio, publish, manage, digital content management
44

55
common.core
66
==========================

docs/src/modules/bookmarks/common/data.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. meta::
22
:description: Developer documentation page for the Bookmarks python modules
3-
:keywords: Bookmarks, bookmarksvfx, asset manager, assets, PySide, Qt5, PySide2, Python, vfx, animation, film, productivity, free, open-source, opensource, lightweight, ShotGrid, RV, FFMpeg, ffmpeg, publish, manage, digital content management, production, OpenImageIO
3+
:keywords: Bookmarks, bookmarksvfx, pipeline, pipe, asset manager, assets, PySide, Qt, PySide,Python, vfx, animation, film, production, open-source, opensource, ShotGun, ShotGrid, RV, ffmpeg, openimageio, publish, manage, digital content management
44

55
common.data
66
==========================

docs/src/modules/bookmarks/common/env.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. meta::
22
:description: Developer documentation page for the Bookmarks python modules
3-
:keywords: Bookmarks, bookmarksvfx, asset manager, assets, PySide, Qt5, PySide2, Python, vfx, animation, film, productivity, free, open-source, opensource, lightweight, ShotGrid, RV, FFMpeg, ffmpeg, publish, manage, digital content management, production, OpenImageIO
3+
:keywords: Bookmarks, bookmarksvfx, pipeline, pipe, asset manager, assets, PySide, Qt, PySide,Python, vfx, animation, film, production, open-source, opensource, ShotGun, ShotGrid, RV, ffmpeg, openimageio, publish, manage, digital content management
44

55
common.env
66
==========================

0 commit comments

Comments
 (0)