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 docgen all script and update documentation #8258

Merged
merged 6 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/check-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: Doc Change Check (Run "yarn docgen devsite" if this fails)
name: Doc Change Check (Run "yarn docgen:all" if this fails)

on: pull_request

Expand All @@ -33,10 +33,10 @@ jobs:
node-version: 20.x
- name: Yarn install
run: yarn
- name: Run doc generation (devsite docs)
run: yarn docgen devsite
- name: Run doc generation
run: yarn docgen:all
- name: Check for changes in docs-devsite dir (fail if so)
run: git diff --exit-code docs-devsite
- name: Reference documentation needs to be updated. See message below.
if: ${{ failure() }}
run: echo "Changes in this PR affect the reference docs. Run \`yarn docgen devsite\` locally to regenerate docs and add them to this PR."
run: echo "Changes in this PR affect the reference docs. Run \`yarn docgen:all\` locally to regenerate docs and add them to this PR."
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@ root directory to generate the documentation locally:

```
yarn
yarn docgen devsite
yarn docgen:all
```

This will generate reference docs in `docs-devsite/`. Commit and push the generated
This will generate reference docs and the toc in `docs-devsite/`. Commit and push the generated
documentation changes to GitHub following the [PR submission guidelines](#submit). Your push
to the remote repository should force any failing documentation checks to execute again.

Expand Down
6 changes: 0 additions & 6 deletions toc/toc.yaml → docs-devsite/_toc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,6 @@ toc:
path: /docs/reference/js/vertexai-preview.date_2.md
- title: EnhancedGenerateContentResponse
path: /docs/reference/js/vertexai-preview.enhancedgeneratecontentresponse.md
- title: ErrorDetails
path: /docs/reference/js/vertexai-preview.errordetails.md
- title: FileData
path: /docs/reference/js/vertexai-preview.filedata.md
- title: FileDataPart
Expand Down Expand Up @@ -517,8 +515,6 @@ toc:
path: /docs/reference/js/vertexai-preview.groundingattribution.md
- title: GroundingMetadata
path: /docs/reference/js/vertexai-preview.groundingmetadata.md
- title: HTTPErrorDetails
path: /docs/reference/js/vertexai-preview.httperrordetails.md
- title: InlineDataPart
path: /docs/reference/js/vertexai-preview.inlinedatapart.md
- title: ModelParams
Expand All @@ -545,8 +541,6 @@ toc:
path: /docs/reference/js/vertexai-preview.usagemetadata.md
- title: VertexAI
path: /docs/reference/js/vertexai-preview.vertexai.md
- title: VertexAIError
path: /docs/reference/js/vertexai-preview.vertexaierror.md
- title: VertexAIOptions
path: /docs/reference/js/vertexai-preview.vertexaioptions.md
- title: VideoMetadata
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"test:saucelabs": "node scripts/run_saucelabs.js",
"docgen": "ts-node-script scripts/docgen/docgen.ts",
"docgen:compat": "node scripts/docgen-compat/generate-docs.js --api js",
"docgen:all": "yarn docgen devsite && yarn docgen toc",
"lint": "lerna run --scope @firebase/* lint",
"lint:fix": "lerna run --scope @firebase/* lint:fix",
"size-report": "ts-node-script scripts/size_report/report_binary_size.ts",
Expand Down
6 changes: 6 additions & 0 deletions scripts/docgen/docgen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,18 @@ async function generateToc() {
'toc',
'--input',
'temp',
'--output',
'docs-devsite',
'-p',
'/docs/reference/js',
'-j'
],
{ stdio: 'inherit' }
);
// The toc on the devsite must be named _toc.yaml
await spawn('mv', ['docs-devsite/toc.yaml', 'docs-devsite/_toc.yaml'], {
stdio: 'inherit'
});
} finally {
cleanup();
}
Expand Down
Loading