ansible / ansible-sdk

The Ansible SDK
Apache License 2.0
25 stars 14 forks source link

Docs: Use sphinx immaterial extension for docs #54

Closed oraNod closed 2 years ago

oraNod commented 2 years ago

Use the Sphinx immaterial extension for docs to get that sweet API reference.

oraNod commented 2 years ago

@nitzmahone @Akasurde Hi, this PR uses the Sphinx immaterial extension and theme, as originally proposed as it seems to do a good job of generating API docs. I've closed my other PR because that was using two conf.py files to graft the Ansible theme on to the generated API docs.

We still need to deal with the following warnings for this to play nicely with RTD:

/home/dnaro/git/dnaro-sdk-immaterial/ansible_sdk.executors.AnsibleDockerJobOptions:1: WARNING: Parameter name 'container_image_ref' does not match any of the parameters defined in the signature: []
/home/dnaro/git/dnaro-sdk-immaterial/ansible_sdk.executors.AnsiblePodmanJobOptions:1: WARNING: Parameter name 'container_image_ref' does not match any of the parameters defined in the signature: []
/home/dnaro/git/dnaro-sdk-immaterial/ansible_sdk/model/job_event.py:docstring of ansible_sdk.AnsibleJobStatusEvent.event:1: WARNING: duplicate object description of ansible_sdk.AnsibleJobStatusEvent.event, other instance in api/AnsibleJobStatusEvent.event, use :noindex: for one of them
/home/dnaro/git/dnaro-sdk-immaterial/ansible_sdk/model/job_event.py:docstring of ansible_sdk.AnsibleJobStatusEvent.event_data:1: WARNING: duplicate object description of ansible_sdk.AnsibleJobStatusEvent.event_data, other instance in api/AnsibleJobStatusEvent.event_data, use :noindex: for one of them
/home/dnaro/git/dnaro-sdk-immaterial/ansible_sdk/model/job_event.py:docstring of ansible_sdk.AnsibleJobStatusEvent.parent_uuid:1: WARNING: duplicate object description of ansible_sdk.AnsibleJobStatusEvent.parent_uuid, other instance in api/AnsibleJobStatusEvent.parent_uuid, use :noindex: for one of them
/home/dnaro/git/dnaro-sdk-immaterial/ansible_sdk/model/job_event.py:docstring of ansible_sdk.AnsibleJobStatusEvent.pid:1: WARNING: duplicate object description of ansible_sdk.AnsibleJobStatusEvent.pid, other instance in api/AnsibleJobStatusEvent.pid, use :noindex: for one of them
/home/dnaro/git/dnaro-sdk-immaterial/ansible_sdk/model/job_event.py:docstring of ansible_sdk.AnsibleJobStatusEvent.start_line:1: WARNING: duplicate object description of ansible_sdk.AnsibleJobStatusEvent.start_line, other instance in api/AnsibleJobStatusEvent.start_line, use :noindex: for one of them
/home/dnaro/git/dnaro-sdk-immaterial/ansible_sdk/model/job_event.py:docstring of ansible_sdk.AnsibleJobStatusEvent.stdout:1: WARNING: duplicate object description of ansible_sdk.AnsibleJobStatusEvent.stdout, other instance in api/AnsibleJobStatusEvent.stdout, use :noindex: for one of them
/home/dnaro/git/dnaro-sdk-immaterial/ansible_sdk/model/job_event.py:docstring of ansible_sdk.AnsibleJobStatusEvent.uuid:1: WARNING: duplicate object description of ansible_sdk.AnsibleJobStatusEvent.uuid, other instance in api/AnsibleJobStatusEvent.uuid, use :noindex: for one of them
/home/dnaro/git/dnaro-sdk-immaterial/ansible_sdk.executors.AnsibleDockerJobExecutor:1: WARNING: duplicate object description of ansible_sdk.executors.AnsibleDockerJobExecutor, other instance in api/ansible_sdk.executors, use :noindex: for one of them

I'll keep pushing to get these resolved. Any suggestions / tips are appreciated. Cheers.

oraNod commented 2 years ago

Here is the generated HTML: https://people.redhat.com/dnaro/ansible-sdk-pr-54/

oraNod commented 2 years ago

@nitzmahone I'm going to close this one. I spoke with @Akasurde and the Ansible SDK theme plus the API docs extension are working and good enough for this stage.

I get that the immaterial extension is a bit "sexier" and I do like the fact that we can put the docstrings adjacent to the parameters, which I'm going to investigate in a separate PR. There's another Sphinx extension that might help us make that better: https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html

Perhaps we can revive this PR later if needed but I'd rather just close it rather than attempt to fix the remaining warnings. Cheers.