Skip to content

Commit

Permalink
move doc/source/* -> doc/source/fiftyone/*
Browse files Browse the repository at this point in the history
  • Loading branch information
bigstones committed Dec 9, 2023
1 parent 77693dc commit df208bc
Show file tree
Hide file tree
Showing 460 changed files with 22 additions and 34 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ jobs:
python-version: ${{ matrix.python }}
cache: "pip"
cache-dependency-path: |
requirements/common.txt
requirements/github.txt
requirements/test.txt
pyproject.toml
- name: Install requirements
if: steps.pip-cache.outputs.cache-hit != true
run: |
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dist/
/eta/

/docs/build/
/docs/source/api/
/docs/source/fiftyone/api/

/bin
/lib
Expand Down
2 changes: 1 addition & 1 deletion app/gen-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1624,7 +1624,7 @@ function delim(arr, str) {
// MAIN
//////////

const PLUGIN_RST_DOCS = path.join(__dirname, "..", "docs/source/plugins/api");
const PLUGIN_RST_DOCS = path.join(__dirname, "..", "docs/source/fiftyone/plugins/api");

const project = new DocProject(docs, RstFile);
project.generate();
2 changes: 1 addition & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/source/user_guide/model_zoo/models.rst
/source/fiftyone/user_guide/model_zoo/models.rst
6 changes: 3 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ A couple noteable flags are supported:

### Main Content

The main content is located in the `docs/source` folder. The files are written
The main content is located in the `docs/source/fiftyone` folder. The files are written
in [Sphinx RST format](https://sphinx-tutorial.readthedocs.io/step-1).

The API documentation is automatically generated from the Python source code,
Expand Down Expand Up @@ -89,9 +89,9 @@ Theme files are located in the `docs/theme` folder. However, you should prefer
to make changes in the following locations instead of the theme itself whenever
possible:

- `docs/source/_static` contains `custom.css` and `custom.js` files, where
- `docs/source/fiftyone/_static` contains `custom.css` and `custom.js` files, where
any CSS overrides or custom JS should be added
- `docs/source/_templates` contains HTML files (Jinja2 templates) that
- `docs/source/fiftyone/_templates` contains HTML files (Jinja2 templates) that
override theme templates of the same name. These should extend the theme
templates - see the existing templates for how to do this. If you need to
override part of the theme template that isn't conveniently marked as a
Expand Down
2 changes: 1 addition & 1 deletion docs/generate_docs.bash
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ echo "Generating API docs"
# sphinx-apidoc [OPTIONS] -o <OUTPUT_PATH> <MODULE_PATH> [EXCLUDE_PATTERN, ...]
sphinx-apidoc --force --no-toc --separate --follow-links \
--templatedir=docs/templates/apidoc \
-o docs/source/api fiftyone \
-o docs/source/fiftyone/api fiftyone \
fiftyone/brain/internal \
fiftyone/server \
fiftyone/service \
Expand Down
22 changes: 6 additions & 16 deletions docs/scripts/make_model_zoo_docs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Script for generating the model zoo docs page contents
``docs/source/user_guide/model_zoo/models.rst``.
``docs/source/fiftyone/user_guide/model_zoo/models.rst``.
| Copyright 2017-2023, Voxel51, Inc.
| `voxel51.com <https://voxel51.com/>`_
Expand Down Expand Up @@ -235,9 +235,7 @@ def _render_model_content(template, model_name):

if zoo_model.size_bytes is not None:
size_str = etau.to_human_bytes_str(zoo_model.size_bytes, decimals=2)
size_str = (
size_str[:-2] + " " + size_str[-2:]
) # 123.45 MB, not 123.45MB
size_str = size_str[:-2] + " " + size_str[-2:] # 123.45 MB, not 123.45MB
else:
size_str = None

Expand Down Expand Up @@ -324,11 +322,7 @@ def _render_card_model_content(template, model_name):


def _generate_section(template, all_models, print_source, header_name):
content = [
_render_section_content(
template, all_models, print_source, header_name
)
]
content = [_render_section_content(template, all_models, print_source, header_name)]

for _, source, model_content in all_models:
if source == print_source:
Expand Down Expand Up @@ -360,23 +354,19 @@ def main():
content = [_HEADER]
content.append(_CARD_SECTION_START)
for model_name in foz.list_zoo_models():
card_content = _render_card_model_content(
card_model_template, model_name
)
card_content = _render_card_model_content(card_model_template, model_name)
content.append(card_content)

content.append(_CARD_SECTION_END)
content.extend(
_generate_section(section_template, models, "torch", "Torch")
)
content.extend(_generate_section(section_template, models, "torch", "Torch"))
content.extend(
_generate_section(section_template, models, "tensorflow", "TensorFlow")
)

# Write docs page

docs_dir = "/".join(os.path.realpath(__file__).split("/")[:-2])
outpath = os.path.join(docs_dir, "source/user_guide/model_zoo/models.rst")
outpath = os.path.join(docs_dir, "source/fiftyone/user_guide/model_zoo/models.rst")

print("Writing '%s'" % outpath)
etau.write_file("\n".join(content), outpath)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions docs/source/conf.py → docs/source/fiftyone/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,17 @@
<table class="fo-notebook-links" align="left">
<td>
<a target="_blank" href="https://colab.research.google.com/github/voxel51/fiftyone/blob/%s/docs/source/{{ env.doc2path(env.docname, base=None) }}">
<a target="_blank" href="https://colab.research.google.com/github/voxel51/fiftyone/blob/%s/docs/source/fiftyone/{{ env.doc2path(env.docname, base=None) }}">
<img src="../_static/images/icons/colab-logo-256px.png"> &nbsp; Run in Google Colab
</a>
</td>
<td>
<a target="_blank" href="https://github.com/voxel51/fiftyone/blob/%s/docs/source/{{ env.doc2path(env.docname, base=None) }}">
<a target="_blank" href="https://github.com/voxel51/fiftyone/blob/%s/docs/source/fiftyone/{{ env.doc2path(env.docname, base=None) }}">
<img src="../_static/images/icons/github-logo-256px.png"> &nbsp; View source on GitHub
</a>
</td>
<td>
<a target="_blank" href="https://gitcdn.link/cdn/voxel51/fiftyone/%s/docs/source/{{ env.doc2path(env.docname, base=None) }}" download>
<a target="_blank" href="https://gitcdn.link/cdn/voxel51/fiftyone/%s/docs/source/fiftyone/{{ env.doc2path(env.docname, base=None) }}" download>
<img src="../_static/images/icons/cloud-icon-256px.png"> &nbsp; Download notebook
</a>
</td>
Expand Down
Loading

0 comments on commit df208bc

Please sign in to comment.