Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Semantic Router
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
aurelio-labs
Semantic Router
Commits
35274af0
Commit
35274af0
authored
1 month ago
by
Carlos Gauci
Browse files
Options
Downloads
Patches
Plain Diff
chore: update docs generation
parent
3d744b63
No related branches found
No related tags found
No related merge requests found
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.github/workflows/docs.yml
+67
-14
67 additions, 14 deletions
.github/workflows/docs.yml
.pydoc-markdown.yml
+20
-0
20 additions, 0 deletions
.pydoc-markdown.yml
poetry.lock
+433
-124
433 additions, 124 deletions
poetry.lock
pyproject.toml
+2
-0
2 additions, 0 deletions
pyproject.toml
with
522 additions
and
138 deletions
.github/workflows/docs.yml
+
67
−
14
View file @
35274af0
...
@@ -3,6 +3,7 @@ name: Release Docs
...
@@ -3,6 +3,7 @@ name: Release Docs
on
:
on
:
release
:
release
:
types
:
[
released
]
types
:
[
released
]
workflow_dispatch
:
jobs
:
jobs
:
build-docs
:
build-docs
:
...
@@ -37,21 +38,73 @@ jobs:
...
@@ -37,21 +38,73 @@ jobs:
-
name
:
Install dependencies
-
name
:
Install dependencies
run
:
|
run
:
|
poetry install --all-extras
poetry install --all-extras
-
name
:
Build docs
-
name
:
Build docs
run
:
|
run
:
|
poetry run sphinx-build -M html docs/source docs/build
mkdir -p docs/build
-
name
:
Authenticate to Google Cloud
poetry run pydoc-markdown .pydoc-markdown.yml
id
:
auth
uses
:
google-github-actions/auth@v2
-
name
:
Checkout docs repo
uses
:
actions/checkout@v4
with
:
with
:
credentials_json
:
${{ secrets.GOOGLE_CREDENTIALS }}
repository
:
aurelio-labs/docs
-
name
:
Upload Docs
path
:
temp-docs
token
:
${{ secrets.DOCS_PAT }}
-
name
:
Copy and rename docs
run
:
|
ROOT_DIR=$(pwd)
rm -rf temp-docs/semantic-router/client-reference
mkdir -p temp-docs/semantic-router/client-reference/
# Find and copy all md files
cd docs/build/semantic_router
find . -type f -name "*.md" | while read file; do
dir=$(dirname "$file")
echo "Processing file: $file in directory: $dir"
mkdir -p "$ROOT_DIR/temp-docs/semantic-router/client-reference/$dir"
cp "$file" "$ROOT_DIR/temp-docs/semantic-router/client-reference/${file%.md}.mdx"
done
-
name
:
Update frontmatter keys
run
:
|
find temp-docs/semantic-router/client-reference -type f -name "*.mdx" -exec sed -i 's/sidebar_label:/sidebarTitle:/g' {} +
-
name
:
Install jq
run
:
sudo apt-get install -y jq
-
name
:
Update mintlify docs.json navigation
run
:
|
# Get files and create grouped structure using jq
files=$(cd temp-docs/semantic-router/client-reference && find . -type f -name "*.mdx" | sed 's|^./||' | sed 's|.mdx$||' | sort | jq -R -s '
split("\n")[:-1]
| map("semantic-router/client-reference/" + .)
| reduce .[] as $path (
{"root": [], "groups": {}};
if ($path | split("/") | length) == 4 then
.groups[$path | split("/")[2]] += [$path]
else
.root += [$path]
end
)
| [.root[], (.groups | to_entries | map({
"group": .key,
"pages": .value
}))[]
]
')
# Update the docs.json file
jq --arg pages "$files" '
(.navigation.tabs[] | select(.tab == "Semantic Router") |
.groups[] | select(.group == "Client Reference") |
.pages) |= ($pages | fromjson)
' temp-docs/docs.json > temp-docs/docs.json.tmp && mv temp-docs/docs.json.tmp temp-docs/docs.json
-
name
:
Commit and push changes
working-directory
:
temp-docs
run
:
|
run
:
|
gcloud storage rsync docs/build/html gs://docs-bucket-production/semantic-router --recursive --delete-unmatched-destination-objects
git config --local user.email "github-actions[bot]@users.noreply.github.com"
# - name: Upload Docs
git config --local user.name "github-actions[bot]"
# id: upload-directory
git add .
# uses: google-github-actions/upload-cloud-storage@v2
git diff --quiet && git diff --staged --quiet || (git commit -m "Update Semantic Router documentation" && git push)
# with:
\ No newline at end of file
# path: docs/build/html
# destination: docs-bucket-production/semantic-router
# parent: false
This diff is collapsed.
Click to expand it.
.pydoc-markdown.yml
0 → 100644
+
20
−
0
View file @
35274af0
loaders
:
-
type
:
python
packages
:
-
semantic_router
search_path
:
[
"
."
]
processors
:
-
type
:
filter
skip_empty_modules
:
true
exclude_private
:
true
exclude_special
:
true
documented_only
:
true
do_not_filter_modules
:
true
-
type
:
smart
-
type
:
crossref
renderer
:
type
:
docusaurus
docs_base_path
:
docs/build
relative_output_path
:
.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
poetry.lock
+
433
−
124
View file @
35274af0
This diff is collapsed.
Click to expand it.
pyproject.toml
+
2
−
0
View file @
35274af0
...
@@ -39,6 +39,7 @@ psycopg2-binary = {version = "^2.9.9", optional = true}
...
@@ -39,6 +39,7 @@ psycopg2-binary = {version = "^2.9.9", optional = true}
sphinx
=
{
version
=
"^7.0.0"
,
optional
=
true
}
sphinx
=
{
version
=
"^7.0.0"
,
optional
=
true
}
sphinxawesome-theme
=
{
version
=
"^5.2.0"
,
optional
=
true
}
sphinxawesome-theme
=
{
version
=
"^5.2.0"
,
optional
=
true
}
tornado
=
{
version
=
"^6.4.2"
,
optional
=
true
}
tornado
=
{
version
=
"^6.4.2"
,
optional
=
true
}
urllib3
=
">
=
1.25
.
4
,
<
1.27
"
[
tool.poetry.extras
]
[
tool.poetry.extras
]
hybrid
=
[
"pinecone-text"
]
hybrid
=
[
"pinecone-text"
]
...
@@ -66,6 +67,7 @@ mypy = "^1.7.1"
...
@@ -66,6 +67,7 @@ mypy = "^1.7.1"
types-pyyaml
=
"^6.0.12.12"
types-pyyaml
=
"^6.0.12.12"
types-requests
=
"^2.31.0"
types-requests
=
"^2.31.0"
black
=
{
extras
=
[
"jupyter"
],
version
=
">
=
23.12
.
1
,
<
24.5
.
0
"}
black
=
{
extras
=
[
"jupyter"
],
version
=
">
=
23.12
.
1
,
<
24.5
.
0
"}
pydoc-markdown
=
"^4.8.2"
[
build-system
]
[
build-system
]
requires
=
[
"poetry-core"
]
requires
=
[
"poetry-core"
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment