Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8a8e405

Browse files
more web doc updates (#3123)
* 📚 Fix documentation sync: Add doc/html and automation - Manually synced doc/html from master to gh-pages branch - Added GitHub Actions workflow to auto-sync docs when updated - Added workflow to auto-generate docs when source changes - Updated .gitignore to handle .DS_Store files Fixes: gh-pages doc/html not being automatically copied from master The doc/html directory now exists on gh-pages and will be automatically kept in sync with master via GitHub Actions workflows. * 🔗 Fix API documentation link Updated index.html to point to correct documentation path: - Changed from docs/html/index.html to doc/html/index.html - Ensures the API link in the navigation works correctly - Now matches the actual location of the synced documentation * 🔧 Fix Angular documentation path and sync content - Updated index.html to point to correct Angular docs path (angular/doc/html) - Synced Angular documentation from master to angular/doc/html - Removed redundant docs/ and angular/docs/ directories - Ensured consistent documentation structure across both main and Angular libs Both main library (doc/html) and Angular library (angular/doc/html) documentation are now correctly positioned and will sync from master.
1 parent 772fd1b commit 8a8e405

File tree

120 files changed

+691
-408
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+691
-408
lines changed

‎.github/workflows/build-docs.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Build and Update Documentation
2+
3+
on:
4+
push:
5+
branches: [master, develop]
6+
paths:
7+
- 'src/**'
8+
- 'angular/projects/lib/**'
9+
- 'typedoc*.json'
10+
- 'package.json'
11+
- 'scripts/generate-docs.js'
12+
- 'scripts/reorder-*.js'
13+
pull_request:
14+
branches: [master, develop]
15+
paths:
16+
- 'src/**'
17+
- 'angular/projects/lib/**'
18+
- 'typedoc*.json'
19+
workflow_dispatch:
20+
21+
jobs:
22+
build-docs:
23+
runs-on: ubuntu-latest
24+
if: github.repository == 'gridstack/gridstack.js'
25+
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
with:
30+
token: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Setup Node.js
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: '18'
36+
cache: 'yarn'
37+
38+
- name: Install dependencies
39+
run: yarn install --frozen-lockfile
40+
41+
- name: Install Angular dependencies
42+
run: |
43+
cd angular
44+
yarn install --frozen-lockfile
45+
46+
- name: Build TypeScript
47+
run: |
48+
yarn t
49+
50+
- name: Generate documentation
51+
run: |
52+
yarn doc:all
53+
54+
- name: Configure Git
55+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
56+
run: |
57+
git config --global user.name 'github-actions[bot]'
58+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
59+
60+
- name: Commit updated documentation
61+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
62+
run: |
63+
# Check if there are changes to the documentation
64+
if git diff --quiet doc/ angular/doc/; then
65+
echo "No documentation changes to commit"
66+
exit 0
67+
fi
68+
69+
# Add documentation changes
70+
git add doc/ angular/doc/
71+
72+
# Create commit message
73+
COMMIT_MSG="📚 Auto-update documentation
74+
75+
Generated from latest source code changes
76+
- Updated TypeDoc HTML documentation
77+
- Updated API documentation
78+
79+
Source: ${{ github.sha }}"
80+
81+
# Commit changes
82+
git commit -m "$COMMIT_MSG"
83+
git push origin master
84+
85+
echo "✅ Documentation updated and committed to master!"
86+
87+
- name: Upload documentation artifacts
88+
if: github.event_name == 'pull_request'
89+
uses: actions/upload-artifact@v4
90+
with:
91+
name: documentation-preview
92+
path: |
93+
doc/html/
94+
angular/doc/html/
95+
retention-days: 7

‎.github/workflows/sync-docs.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: Sync Documentation to gh-pages
2+
3+
on:
4+
push:
5+
branches: [master, develop]
6+
paths:
7+
- 'doc/html/**'
8+
- 'angular/doc/html/**'
9+
- '.github/workflows/sync-docs.yml'
10+
workflow_dispatch:
11+
12+
jobs:
13+
sync-docs:
14+
runs-on: ubuntu-latest
15+
if: github.repository == 'gridstack/gridstack.js'
16+
17+
steps:
18+
- name: Checkout master branch
19+
uses: actions/checkout@v4
20+
with:
21+
ref: master
22+
fetch-depth: 0
23+
token: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- name: Configure Git
26+
run: |
27+
git config --global user.name 'github-actions[bot]'
28+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
29+
30+
- name: Check if docs exist
31+
id: check-docs
32+
run: |
33+
if [ -d "doc/html" ]; then
34+
echo "main_docs=true" >> $GITHUB_OUTPUT
35+
else
36+
echo "main_docs=false" >> $GITHUB_OUTPUT
37+
fi
38+
39+
if [ -d "angular/doc/html" ]; then
40+
echo "angular_docs=true" >> $GITHUB_OUTPUT
41+
else
42+
echo "angular_docs=false" >> $GITHUB_OUTPUT
43+
fi
44+
45+
- name: Checkout gh-pages branch
46+
if: steps.check-docs.outputs.main_docs == 'true' || steps.check-docs.outputs.angular_docs == 'true'
47+
run: |
48+
git fetch origin gh-pages
49+
git checkout gh-pages
50+
51+
- name: Sync main library documentation
52+
if: steps.check-docs.outputs.main_docs == 'true'
53+
run: |
54+
echo "Syncing main library documentation..."
55+
56+
# Remove existing docs directory if it exists
57+
if [ -d "docs/html" ]; then
58+
rm -rf docs/html
59+
fi
60+
61+
# Copy from master branch
62+
git checkout master -- doc/html
63+
64+
# Move to the correct location for gh-pages
65+
mkdir -p docs
66+
mv doc/html docs/html
67+
rm -rf doc
68+
69+
# Add changes
70+
git add docs/html
71+
72+
- name: Sync Angular documentation
73+
if: steps.check-docs.outputs.angular_docs == 'true'
74+
run: |
75+
echo "Syncing Angular library documentation..."
76+
77+
# Remove existing Angular docs if they exist
78+
if [ -d "angular/doc/html" ]; then
79+
rm -rf angular/doc/html
80+
fi
81+
82+
# Copy from master branch
83+
git checkout master -- angular/doc/html
84+
85+
# Add changes
86+
git add angular/doc/html
87+
88+
- name: Commit and push changes
89+
if: steps.check-docs.outputs.main_docs == 'true' || steps.check-docs.outputs.angular_docs == 'true'
90+
run: |
91+
# Check if there are changes to commit
92+
if git diff --staged --quiet; then
93+
echo "No documentation changes to sync"
94+
exit 0
95+
fi
96+
97+
# Create commit message
98+
COMMIT_MSG="📚 Auto-sync documentation from master"
99+
if [ "${{ steps.check-docs.outputs.main_docs }}" == "true" ]; then
100+
COMMIT_MSG="$COMMIT_MSG
101+
102+
- Updated main library HTML docs (docs/html/)"
103+
fi
104+
if [ "${{ steps.check-docs.outputs.angular_docs }}" == "true" ]; then
105+
COMMIT_MSG="$COMMIT_MSG
106+
107+
- Updated Angular library HTML docs (angular/doc/html/)"
108+
fi
109+
110+
COMMIT_MSG="$COMMIT_MSG
111+
112+
Source: ${{ github.sha }}"
113+
114+
# Commit and push
115+
git commit -m "$COMMIT_MSG"
116+
git push origin gh-pages
117+
118+
echo "✅ Documentation synced to gh-pages successfully!"

‎.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ dist_save
55
*.zip
66
angular/
77
react/
8+
.DS_Store
9+
doc/.DS_Store
810

911
!node_modules/
1012
node_modules/*
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /