1- # my-sphinx
1+ # Knowledge Utility Kit
22
3- A project for publishing documentation to GitHub Pages using Sphinx .
3+ A project for publishing documentation to GitHub Pages using ** MkDocs ** and ** Material for MkDocs ** .
44
55## 📁 Project Structure
66
77```
8- my-sphinx /
8+ kukgini.github.io /
99├── .github/
1010│ └── workflows/
1111│ └── build-and-deploy.yml # GitHub Actions automated build
1212├── bin/ # Build tools (for local use)
1313│ ├── build # Build documentation
1414│ ├── deploy # Build + Git deployment
1515│ └── clean # Clean build artifacts
16- ├── src/ # Documentation source files
17- │ ├── bosh/
18- │ ├── cf/
19- │ ├── git/
20- │ ├── golang/
21- │ ├── os/
22- │ ├── md/
23- │ ├── z-diagrams/
24- │ ├── conf.py # Sphinx configuration
25- │ └── index.rst # Documentation main page
16+ ├── src/ # Documentation source files (Markdown)
17+ │ ├── ap2/
18+ │ ├── dt/
19+ │ ├── paas/
20+ │ ├── iaas/
21+ │ ├── _static/ # Custom CSS
22+ │ └── index.md # Home page
2623├── docs/ # Build output (for GitHub Pages deployment)
27- │ ├── .nojekyll # Disable Jekyll for GitHub Pages
28- │ ├── index.html # Main HTML page
29- │ ├── _static/ # Static files (CSS, JS, etc.)
30- │ └── ... # Other HTML files
24+ ├── mkdocs.yml # MkDocs configuration
3125├── requirements.txt # Python dependencies
3226└── README.md
3327```
@@ -36,16 +30,12 @@ my-sphinx/
3630
3731### 🤖 Automated Build (GitHub Actions)
3832
39- When you modify and commit source files in the ` src/ ` directory , GitHub Actions will automatically build and deploy the documentation.
33+ When you modify and push source files, GitHub Actions will automatically build and deploy the documentation.
4034
4135** Trigger conditions:**
4236- Changes to files in the ` src/ ` directory
4337- Changes to ` requirements.txt `
44- - Push to ` master ` or ` main ` branch
45-
46- ** GitHub Actions execution status:**
47- - Check execution status in the repository's ** Actions** tab
48- - After build completion, the ` docs/ ` directory is automatically updated
38+ - Push to ` main ` branch
4939
5040### 📦 Local Build
5141
@@ -61,9 +51,9 @@ When you modify and commit source files in the `src/` directory, GitHub Actions
6151
6252** Process:**
63531 . Create an isolated virtual environment (` .venv ` )
64- 2 . Install dependencies (` sphinx ` , ` sphinx_rtd_theme ` , ` recommonmark ` )
65- 3 . Build HTML documentation with Sphinx (` src/ ` → ` docs/ ` )
66- 4 . Create ` .nojekyll ` file (for GitHub Pages)
54+ 2 . Install dependencies (` mkdocs ` , ` mkdocs-material ` )
55+ 3 . Build documentation (` src/ ` → ` docs/ ` )
56+ 4 . Create ` .nojekyll ` file
67575 . Automatically clean up virtual environment
6858
6959Build output is generated in the ` docs/ ` directory.
@@ -80,123 +70,50 @@ Build output is generated in the `docs/` directory.
80703 . Automatic commit
81714 . Push to GitHub
8272
83- > ** 💡 Tip** : With GitHub Actions, you only need to modify sources and push without building locally!
84-
8573#### 3. Clean Build Artifacts
8674
8775``` bash
8876./bin/clean
8977```
9078
91- Deletes the ` docs/ ` , ` _build /` , and ` .venv/ ` directories.
79+ Deletes the ` docs/ ` , ` site /` , and ` .venv/ ` directories.
9280
9381## 📝 Writing Documentation
9482
9583### Adding Documents
9684
97- 1 . Create a ` .rst ` or ` .md ` file in the ` src/ ` directory
98- 2 . Add the new document to ` src/index.rst ` :
99-
100- ``` rst
101- .. toctree::
102- :maxdepth: 1
103-
104- your-new-document.md
105- ```
106-
107- 3 . Build and deploy:
108-
109- ``` bash
110- ./bin/deploy
111- ```
112-
113- ### Supported Formats
114-
115- - ** reStructuredText** (` .rst ` ): Sphinx default format
116- - ** Markdown** (` .md ` ): Supported through the ` recommonmark ` extension
117-
118- ## 🌐 GitHub Pages Setup
119-
120- ### 1. Enable GitHub Pages
121-
122- 1 . GitHub repository → ** Settings** → ** Pages**
123- 2 . ** Source** : Deploy from a branch
124- 3 . ** Branch** : ` master ` (or ` main ` )
125- 4 . ** Folder** : Select ` /docs `
126- 5 . ** Save**
127-
128- ### 2. GitHub Actions Permissions (Important!)
129-
130- 1 . GitHub repository → ** Settings** → ** Actions** → ** General**
131- 2 . In the ** Workflow permissions** section:
132- - Select ** Read and write permissions**
133- - Check ** Allow GitHub Actions to create and approve pull requests**
134- 3 . ** Save**
135-
136- Without this setting, GitHub Actions cannot commit build results.
137-
138- ### 3. Verify Automated Deployment
85+ 1 . Create a ` .md ` file in the ` src/ ` directory.
86+ 2 . Add the new document to ` mkdocs.yml ` under ` nav ` :
13987
140- Now when you modify and push files in the ` src/ ` directory:
141-
142- 1 . ** GitHub Actions** automatically executes the build
143- 2 . Build results are committed to ` docs/ `
144- 3 . ** GitHub Pages** automatically updates
145-
146- ** Check execution:**
147- - Check workflow execution status in the repository's ** Actions** tab
148- - When complete, the GitHub Pages site automatically updates
149-
150- ## 🛠️ Advanced Usage
151-
152- ### Manual Python Execution
153-
154- ``` bash
155- # Build
156- python3 bin/build
157-
158- # Deploy
159- python3 bin/deploy
160-
161- # Clean
162- python3 bin/clean
88+ ``` yaml
89+ nav :
90+ - Home : index.md
91+ - My Section :
92+ - my-new-doc.md
16393` ` `
16494
165- ### Complete Rebuild
166-
167- ``` bash
168- ./bin/clean
169- ./bin/build
170- ```
171-
172- ### Changing Sphinx Configuration
173-
174- You can change Sphinx settings by editing the ` src/conf.py ` file:
175-
176- - Change theme
177- - Add extensions
178- - Modify project metadata
179-
180- ## 📦 Dependencies
181-
182- The project uses the following Python packages:
183-
184- - ** sphinx** : Documentation generation tool
185- - ** sphinx_rtd_theme** : Read the Docs theme
186- - ** recommonmark** : Markdown support
95+ 3. Build and deploy.
18796
188- Dependencies are automatically installed in an isolated virtual environment during build, so they don't affect your system Python environment.
97+ ### Supported Features
18998
190- ## 🔒 Isolated Build Environment
99+ - **Markdown**: Standard Markdown syntax.
100+ - **Admonitions**: ` !!! note "Title"` blocks.
101+ - **Code Highlighting**: Fenced code blocks with language specifiers.
102+ - **Mermaid Diagrams**:
103+ ` ` ` mermaid
104+ graph TD
105+ A[Start] --> B{Is it working?}
106+ B -- Yes --> C[Great!]
107+ B -- No --> D[Debug]
108+ ` ` `
191109
192- All builds run in a temporary virtual environment:
110+ # # 🛠️ Configuration
193111
194- 1 . Create ` .venv ` when build starts
195- 2 . Install dependencies
196- 3 . Build documentation
197- 4 . Automatically delete ` .venv ` after build completes
112+ You can change site settings by editing `mkdocs.yml` :
198113
199- You can use all necessary build tools while keeping your system Python environment clean.
114+ - Change theme colors
115+ - Add plugins
116+ - Modify navigation structure
200117
201118# # 📄 License
202119
0 commit comments