Skip to content

Commit

Permalink
docs(SPHINX): upgrade, reorganize, add rtd theme
Browse files Browse the repository at this point in the history
  • Loading branch information
niall-byrne committed Jan 17, 2024
1 parent cbef0ce commit 8df8b7d
Show file tree
Hide file tree
Showing 17 changed files with 530 additions and 383 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,17 @@ You can work with `Profiles` in one of two ways:

To find out more:

- Read about the `Mac Maker Profiles`, and how to build one [here](https://mac-maker.readthedocs.io/en/latest/project/3.profiles.html).
- Read about the `Mac Maker Profiles`, and how to build one [here](https://mac-maker.readthedocs.io/en/latest/project/4.profiles.html).
- Use [this template](https://github.com/osx-provisioner/profile-generator) to create your own custom profiles.
- Read about the `spec.json` file, and how to build one [here](https://mac-maker.readthedocs.io/en/latest/project/4.spec_files.html).
- Read about the `spec.json` file, and how to build one [here](https://mac-maker.readthedocs.io/en/latest/project/5.spec_files.html).

**Please Note:**
- We've had some user feedback that the `spec.json` files are a bit complicated to get started with.
- Although we'll continue to support them, we'll soon introduce the ability to simply specify the path to a `Mac Maker Profile` folder on the local filesystem.

## License

As this project effectively bundles Ansible, it must comply with the [GNU GPL](https://mac-maker.readthedocs.io/en/latest/project/6.license.html).
As this project effectively bundles Ansible, it must comply with the [GNU GPL](https://mac-maker.readthedocs.io/en/latest/project/7.license.html).
You are however free to use and modify this source, as long as the license's terms are respected.

(Pull requests are most welcome, as I sincerely hope this project can be of use to others.)
Expand Down
3 changes: 3 additions & 0 deletions documentation/source/_static/css/overrides.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.wy-nav-content {
max-width: 100%;
}
46 changes: 29 additions & 17 deletions documentation/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# -- Path setup --------------------------------------------------------------

import os
import pathlib
import sys

if os.path.exists('/app'):
Expand All @@ -29,14 +30,15 @@
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
'sphinx_autopackagesummary',
'sphinx_autodoc_typehints',
'sphinx_autopackagesummary',
'sphinx_click.ext',
'sphinx-jsonschema',
'sphinx.ext.intersphinx',
'sphinxcontrib.spelling',
'myst_parser',
]

# sphinx.ext.autosummary
Expand All @@ -53,21 +55,31 @@
tokenizer_lang = 'en_US'
spelling_word_list_filename = 'spelling_wordlist.txt'

# sphinx_autopackagesummary
autosummary_generate = True
autosummary_mock_imports = [
"mac_maker.tests",
"mac_maker.ansible_controller.tests",
"mac_maker.jobs.tests",
"mac_maker.utilities.tests",
"mac_maker.utilities.mixins.tests",
"mac_maker.utilities.validation.tests",
]

def detect_tests():
"""Create a list of import paths with tests."""

test_paths = []
for root, dirs, _ in os.walk('../../pi_portal'):
for name in dirs:
if name == 'tests':
directory = pathlib.Path(os.path.join(root, name).replace('../../', ''))
test_paths.append('.'.join(directory.with_suffix('').parts))
return test_paths


# Exclude tests from sphinx_autopackagesummary here
autosummary_mock_imports = detect_tests()

source_suffix = {
'.rst': 'restructuredtext',
}

typehints_fully_qualified = False
always_document_param_types = True
typehints_defaults = "comma"
typehints_document_rtype = True

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand All @@ -81,12 +93,12 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'haiku'
html_theme = 'sphinx_rtd_theme'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
#html_static_path = ['_static']
html_theme_options = {
'body_max_width': '100%'
}
html_static_path = ['_static']
html_css_files = [
'css/overrides.css',
]
7 changes: 7 additions & 0 deletions documentation/source/project/0.overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Project Overview
================
```{include} ../../../README.md
:start-after: Project Documentation
:end-before: License
```

File renamed without changes.
5 changes: 0 additions & 5 deletions documentation/source/project/2.cli.rst

This file was deleted.

File renamed without changes.
6 changes: 6 additions & 0 deletions documentation/source/project/3.cli.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CLI Summary
===========

.. click:: mac_maker.cli:cli
:prog: mac_maker.cli
:nested: short
6 changes: 6 additions & 0 deletions documentation/source/project/3.cli_reference.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CLI Subcommand Reference
========================

.. click:: mac_maker.cli:cli
:prog: mac_maker.cli
:nested: full
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 0 additions & 4 deletions documentation/source/project/7.readme.rst

This file was deleted.

4 changes: 4 additions & 0 deletions documentation/source/spelling_wordlist.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
ansible
bitrise
codebase
cmd
env
filesystem
github
Expand All @@ -9,8 +11,10 @@ localhost
mac_maker
minItems
mixin
pre
precheck
repo
subcommand
sudo
uniqueItems
url
Expand Down
Loading

0 comments on commit 8df8b7d

Please sign in to comment.