Skip to content

Commit fe04431

Browse files
committed
refacto to work with infrahub-docs
1 parent f97452f commit fe04431

File tree

8 files changed

+120
-116
lines changed

8 files changed

+120
-116
lines changed

.github/workflows/sync-docs.yml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,11 @@ jobs:
3232
- name: Sync folders
3333
run: |
3434
rm -rf target-repo/docs/docs-python-sdk/*
35-
rm -f target-repo/python_sdk/examples/*
3635
rm -f target-repo/docs/sidebars-python-sdk.ts
37-
cp -r source-repo/docs/docs/python-sdk/* target-repo/docs/docs-python-sdk
38-
cp -r source-repo/examples/* target-repo/python_sdk/examples/
39-
cp source-repo/docs/sidebars.ts target-repo/docs/sidebars-python-sdk.ts
40-
sed -i 's/python-sdk\///g' target-repo/docs/sidebars-python-sdk.ts
41-
42-
for entry in source-repo/docs/docs/*; do
43-
name=$(basename "$entry")
44-
if [ "$name" != "python-sdk" ]; then
45-
if [ -d "$entry" ]; then
46-
cp -r "$entry"/* "target-repo/docs/docs/$name/"
47-
elif [ -f "$entry" ]; then
48-
cp "$entry" "target-repo/docs/docs/"
49-
fi
50-
fi
51-
done
52-
36+
rm -f target-repo/docs/sidebars-infrahubctl.ts
37+
cp -r source-repo/docs/docs/* target-repo/docs/docs-python-sdk/
38+
cp source-repo/docs/sidebars-infrahubctl.ts target-repo/docs/
39+
cp source-repo/docs/sidebars-python-sdk.ts target-repo/docs/
5340
cd target-repo
5441
git config user.name github-actions
5542
git config user.email [email protected]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ It's meant to run on any laptop or server and it communicates with a remote Infr
1818

1919
## Installation
2020

21-
The `infrahubctl` command line utility is installed as a part of the [Infrahub SDK for Python]($(base_url)python-sdk/guides/installation#ctl).
21+
The `infrahubctl` command line utility is installed as a part of the [Infrahub SDK for Python](../python-sdk/guides/installation#ctl).
2222

2323
## Configuration
2424

docs/docs/introduction.mdx

Lines changed: 0 additions & 24 deletions
This file was deleted.

docs/docusaurus.config.ts

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ const config: Config = {
3636
// Please change this to your repo.
3737
// Remove this to remove the "edit this page" links.
3838
editUrl: "https://github.com/opsmill/infrahub-sdk-python/tree/stable/docs",
39-
routeBasePath: "/",
39+
path: 'docs/python-sdk',
40+
routeBasePath: 'python-sdk',
41+
sidebarPath: './sidebars-python-sdk.ts',
4042
sidebarCollapsed: true,
41-
sidebarPath: "./sidebars.ts",
4243
},
4344
blog: false,
4445
theme: {
@@ -47,7 +48,18 @@ const config: Config = {
4748
} satisfies Preset.Options,
4849
],
4950
],
50-
51+
plugins: [
52+
[
53+
'@docusaurus/plugin-content-docs',
54+
{
55+
id: 'infrahubctl',
56+
path: 'docs/infrahubctl',
57+
routeBasePath: 'infrahubctl',
58+
sidebarCollapsed: false,
59+
sidebarPath: './sidebars-infrahubctl.ts',
60+
},
61+
],
62+
],
5163
themeConfig: {
5264
// announcementBar: {
5365
// content: 'Welcome to our brand new docs!',
@@ -61,10 +73,22 @@ const config: Config = {
6173
},
6274
items: [
6375
{
64-
type: "docSidebar",
65-
sidebarId: "ToolsSDKsSidebar",
66-
position: "left",
67-
label: "Tools & SDKs",
76+
type: 'dropdown',
77+
position: 'left',
78+
label: 'Tools & SDKs',
79+
items: [
80+
{
81+
type: "docSidebar",
82+
sidebarId: "pythonSdkSidebar",
83+
label: "Python SDK",
84+
},
85+
{
86+
type: "docSidebar",
87+
sidebarId: "infrahubctlSidebar",
88+
label: "Infrahubctl",
89+
docsPluginId: "infrahubctl",
90+
},
91+
],
6892
},
6993
// {
7094
// type: "search",

docs/sidebars-infrahubctl.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
2+
3+
const sidebars: SidebarsConfig = {
4+
infrahubctlSidebar: [
5+
{
6+
type: 'doc',
7+
id: 'infrahubctl',
8+
label: 'Infrahubctl',
9+
},
10+
{
11+
type: 'category',
12+
label: 'Commands',
13+
items: [
14+
'infrahubctl-branch',
15+
'infrahubctl-check',
16+
'infrahubctl-dump',
17+
'infrahubctl-generator',
18+
'infrahubctl-info',
19+
'infrahubctl-load',
20+
'infrahubctl-menu',
21+
'infrahubctl-object',
22+
'infrahubctl-protocols',
23+
'infrahubctl-render',
24+
'infrahubctl-repository',
25+
'infrahubctl-run',
26+
'infrahubctl-schema',
27+
'infrahubctl-transform',
28+
'infrahubctl-validate',
29+
'infrahubctl-version'
30+
],
31+
},
32+
],
33+
};
34+
35+
export default sidebars;

docs/sidebars-python-sdk.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
2+
3+
const sidebars: SidebarsConfig = {
4+
pythonSdkSidebar: [
5+
{
6+
type: 'category',
7+
label: 'Python SDK',
8+
link: {
9+
type: 'doc',
10+
id: 'introduction',
11+
},
12+
items: [
13+
{
14+
type: 'category',
15+
label: 'Guides',
16+
items: [
17+
'guides/installation',
18+
'guides/client',
19+
'guides/query_data',
20+
'guides/create_update_delete',
21+
'guides/branches',
22+
'guides/store',
23+
'guides/tracking',
24+
'guides/batch',
25+
'guides/object-storage',
26+
'guides/resource-manager',
27+
],
28+
},
29+
{
30+
type: 'category',
31+
label: 'Topics',
32+
items: [
33+
'topics/tracking',
34+
],
35+
},
36+
{
37+
type: 'category',
38+
label: 'Reference',
39+
items: [
40+
'reference/config',
41+
],
42+
},
43+
],
44+
},
45+
],
46+
};
47+
48+
export default sidebars;

docs/sidebars.ts

Lines changed: 0 additions & 66 deletions
This file was deleted.

docs/src/pages/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function Home(): React.JSX.Element {
1111
>
1212
<main>
1313
<div className="container margin-top--lg">
14-
<h1>Tools & SDK</h1>
14+
<h1>Tools & SDKs</h1>
1515
</div>
1616
</main>
1717
</Layout>

0 commit comments

Comments
 (0)