Skip to content

Commit

Permalink
remove python dependency from running docs locally
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-rp committed Mar 19, 2024
1 parent 44f4d47 commit 17b0539
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 3 additions & 2 deletions docs/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "PYTHONPATH=. poetry run pydoc-markdown && node tools/preprocess_docs.js && node tools/update_version_env.js && docusaurus start",
"start": "node tools/preprocess_docs.js && node tools/update_version_env.js && docusaurus start",
"watch-snippets": "node tools/update_snippets.js --watch",
"build": "PYTHONPATH=. poetry run pydoc-markdown && node tools/preprocess_docs.js && node tools/update_version_env.js && docusaurus build",
"build:netlify": "PYTHONPATH=. pydoc-markdown && node tools/preprocess_docs.js && node tools/update_version_env.js && docusaurus build --out-dir build/docs",
Expand All @@ -13,7 +13,8 @@
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"update-snippets": "node tools/update_snippets.js"
"update-snippets": "node tools/update_snippets.js",
"generate-api-reference": "PYTHONPATH=. poetry run pydoc-markdown"
},
"dependencies": {
"@docusaurus/core": "2.4.1",
Expand Down
11 changes: 10 additions & 1 deletion docs/website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/

// @ts-check
const fs = require('fs');

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
Expand Down Expand Up @@ -289,7 +290,6 @@ const sidebars = {
keywords: ['reference'],
},
items: [
require("./docs_processed/api_reference/sidebar.json"),
'reference/installation',
'reference/command-line-interface',
'reference/telemetry',
Expand All @@ -304,6 +304,15 @@ const sidebars = {
]
};

// inject api reference if it exists
if (fs.existsSync('./docs_processed/api_reference/sidebar.json')) {
for (const item of sidebars.tutorialSidebar) {
if (item.label === 'Reference') {
item.items.splice(0,0,require("./docs_processed/api_reference/sidebar.json"));
}
}
}

// on the master branch link to devel and vice versa
if (process.env.IS_MASTER_BRANCH) {
sidebars.tutorialSidebar.push( {
Expand Down

0 comments on commit 17b0539

Please sign in to comment.