Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to use arbitrary Sphinx HTML artifact folder #1336

Merged
merged 3 commits into from
May 9, 2024

Conversation

jakelishman
Copy link
Member

@jakelishman jakelishman commented May 9, 2024

This adds a --sphinx-artifact-folder (alias --sphinx-output) option to manually specify the root of the Sphinx HTML output for a given package. This implies --skip-download. This is convenient for local API-docs development of the targetted packages, since I can use their regular docs-build processes and then just point gen-api at the right place without needing to copy anything into special folders.

For example, I've locally been using Sphinx as normal in Qiskit, then running

npm run gen-api -- -p qiskit -v 1.2.0 -a /path/to/docs/_build/html

to have the script directly target the Sphinx files without copying them.

I made the magic /artifact suffix a bit more local, rather than spread between two functions for two reasons:

  1. it's easier to reason about magic that's only local.
  2. if the /artifact is always appended by zxMain outside of the control of prepareSphinxFolder, it defeated the main purpose of this option.

This adds a `--sphinx-artifact-folder` (alias `--sphinx-output`) option
to manually specify the root of the Sphinx HTML output for a given
package.  This implies `--skip-download`.  This is convenient for local
API-docs development of the targetted packages, since I can use their
regular docs-build processes and then just point `gen-api` at the right
place without needing to copy anything into special folders.
@jakelishman jakelishman force-pushed the jake/override-sphinx-dir branch from 56a306d to 198451a Compare May 9, 2024 16:59
Copy link
Collaborator

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent! No need to add tests. @arnaucasau will document this in #1336

scripts/commands/updateApiDocs.ts Outdated Show resolved Hide resolved
scripts/commands/updateApiDocs.ts Outdated Show resolved Hide resolved
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Copy link
Collaborator

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@Eric-Arellano Eric-Arellano added this pull request to the merge queue May 9, 2024
Merged via the queue into main with commit a479ead May 9, 2024
2 checks passed
@Eric-Arellano Eric-Arellano deleted the jake/override-sphinx-dir branch May 9, 2024 17:46
frankharkins pushed a commit to frankharkins/documentation that referenced this pull request Jul 22, 2024
This adds a `--sphinx-artifact-folder` (alias `--sphinx-output`) option
to manually specify the root of the Sphinx HTML output for a given
package. This implies `--skip-download`. This is convenient for local
API-docs development of the targetted packages, since I can use their
regular docs-build processes and then just point `gen-api` at the right
place without needing to copy anything into special folders.

For example, I've locally been using Sphinx as normal in Qiskit, then
running
```bash
npm run gen-api -- -p qiskit -v 1.2.0 -a /path/to/docs/_build/html
```
to have the script directly target the Sphinx files without copying
them.

I made the magic `/artifact` suffix a bit more local, rather than spread
between two functions for two reasons:
1. it's easier to reason about magic that's only local.
2. if the `/artifact` is _always_ appended by `zxMain` outside of the
control of `prepareSphinxFolder`, it defeated the main purpose of this
option.

---------

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants