Skip to content

Commit 6afa4f0

Browse files
authored
Initialize annecyh/starter-pack-demo
0 parents  commit 6afa4f0

52 files changed

Lines changed: 2192 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Main Documentation Checks
2+
3+
on:
4+
- push
5+
- pull_request
6+
- workflow_dispatch
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
documentation-checks:
14+
uses: canonical/documentation-workflows/.github/workflows/documentation-checks.yaml@main
15+
with:
16+
working-directory: 'sp-docs'
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Keep action in sync
2+
3+
on:
4+
pull_request_target:
5+
paths:
6+
- .github/workflows/automatic-doc-checks.yml
7+
- sp-files/.github/workflows/automatic-doc-checks.yml
8+
9+
jobs:
10+
comment:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/github-script@v7
14+
with:
15+
script: |
16+
github.rest.issues.createComment({
17+
issue_number: context.issue.number,
18+
owner: context.repo.owner,
19+
repo: context.repo.repo,
20+
body: 'Make sure to keep `.github/workflows/automatic-doc-checks.yml` and `sp-files/.github/workflows/automatic-doc-checks.yml` in sync!'
21+
})

.readthedocs.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sp-files/.readthedocs.yaml

.wokeignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sp-files/.wokeignore

README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See the documentation at https://canonical-starter-pack.readthedocs-hosted.com/use-canonical-sphinx-extension/

init.sh

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/bin/bash
2+
3+
# Generate a unique directory name based on timestamp
4+
timestamp=$(date +%Y%m%d%H%M%S)
5+
temp_directory="temp-starter-pack-$timestamp"
6+
7+
# Ask the user for the installation directory
8+
read -p "Enter the installation directory (e.g., '.' or 'docs'): " install_directory
9+
10+
# Clone the starter pack repository to the temporary directory
11+
echo "Cloning the starter pack repository..."
12+
git clone --depth 1 -b use-canonical-sphinx-extension --single-branch https://github.com/canonical/starter-pack "$temp_directory"
13+
#git clone --depth 1 https://github.com/canonical/sphinx-docs-starter-pack "$temp_directory"
14+
rm -rf "$temp_directory/.git"
15+
16+
# Update file contents for the install directory
17+
echo "Updating working directory in workflow files..."
18+
sed -i "s|working-directory:\s*'\.'|working-directory: '$install_directory'|g" "$temp_directory/sp-files/.github/workflows"/*
19+
echo "Updating .readthedocs.yaml configuration..."
20+
sed -i "s|configuration:\s*sp-docs/conf\.py|configuration: $install_directory/conf.py|g" "$temp_directory/sp-files/.readthedocs.yaml"
21+
sed -i "s|requirements:\s*sp-docs/\.sphinx/requirements\.txt|requirements: $install_directory/.sphinx/requirements.txt|g" "$temp_directory/.readthedocs.yaml"
22+
echo "Updating conf.py configuration..."
23+
if [ "$install_directory" == "." ]; then
24+
sed -i "s|'github_folder':\s*'/sp-docs/'|'github_folder': '/'|g" "$temp_directory/sp-files/conf.py"
25+
else
26+
sed -i "s|'github_folder':\s*'/sp-docs/'|'github_folder': '/$install_directory/'|g" "$temp_directory/sp-files/conf.py"
27+
fi
28+
29+
# Create the specified installation directory if it doesn't exist
30+
if [ ! -d "$install_directory" ]; then
31+
echo "Creating the installation directory: $install_directory"
32+
mkdir -p "$install_directory"
33+
fi
34+
35+
# Copy the contents of the starter pack repository to the installation directory
36+
echo "Copying contents to the installation directory..."
37+
cp -R "$temp_directory"/sp-files/* "$temp_directory"/sp-files/.??* "$install_directory"
38+
39+
# Move workflow files and configuration
40+
if [ "$install_directory" != "." ]; then
41+
echo "Moving workflow files and configuration..."
42+
if [ ! -d .github/workflows ]; then
43+
mkdir -p .github/workflows
44+
fi
45+
mv "$install_directory/.github/workflows"/* .github/workflows
46+
rmdir -p --ignore-fail-on-non-empty "$install_directory/.github/workflows"
47+
if [ ! -f .wokeignore ]; then
48+
ln -s "$install_directory/.wokeignore"
49+
else
50+
echo "ACTION REQUIRED: Found a .wokeignore file in the root directory. Include the contents from $install_directory/.wokeignore in this file!"
51+
fi
52+
fi
53+
54+
# Clean up
55+
echo "Cleaning up..."
56+
rm -rf "$temp_directory"
57+
58+
echo "Setup completed!"

sp-docs/.custom_wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
WCAG

sp-docs/.readthedocs.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../sp-files/.readthedocs.yaml

sp-docs/.sphinx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../sp-files/.sphinx/

sp-docs/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../sp-files/Makefile

0 commit comments

Comments
 (0)