|
1 | 1 | # Repository Guidelines |
2 | 2 |
|
3 | 3 | ## Project Structure & Module Organization |
4 | | -- Root contains the primary content: `JumpServer-whitepaper.md` (source) and `index.html` (rendered site). |
5 | | -- Assets live under `images/` (generated from embedded images in the Markdown). |
6 | | -- Utility script: `extract_images.py` (extracts base64 images from the Markdown to `images/`). |
7 | | -- Other: `CNAME` for GitHub Pages custom domain, `LICENSE`, `README.md`. |
| 4 | +- Root contains `JumpServer-whitepaper.html` and its asset folder `JumpServer-whitepaper.fld/` (images, header, theme files). |
| 5 | +- Keep relative paths intact: the HTML references assets by filename inside `.fld`. |
| 6 | +- If adding assets, place them in `JumpServer-whitepaper.fld/` and reference with relative paths. |
8 | 7 |
|
9 | 8 | ## Build, Test, and Development Commands |
10 | | -- Extract images from Markdown: |
11 | | - - `python3 extract_images.py` — saves decoded images into `images/` and logs counts. |
12 | | -- Preview locally: |
13 | | - - `python3 -m http.server 8000` then open `http://localhost:8000/index.html`. |
14 | | -- Regenerate assets after editing `JumpServer-whitepaper.md`: |
15 | | - - Re-run `python3 extract_images.py` and verify `images/` updates. |
| 9 | +- View locally: `open JumpServer-whitepaper.html` (macOS) or double‑click in a file browser. |
| 10 | +- Optional local server (helps with some browser policies): `python3 -m http.server` then open `http://localhost:8000/JumpServer-whitepaper.html`. |
| 11 | +- No build step; this is a static export. |
16 | 12 |
|
17 | 13 | ## Coding Style & Naming Conventions |
18 | | -- Python (`extract_images.py`): |
19 | | - - Python 3.8+; PEP 8; 4-space indentation; snake_case for variables/functions. |
20 | | - - Keep scripts stateless and idempotent; avoid hardcoding paths beyond project root. |
21 | | -- HTML/CSS (`index.html`): |
22 | | - - Two-space indentation; semantic tags where possible; descriptive class names. |
23 | | -- Assets: |
24 | | - - Images generated as `images/<sanitized-alt>.<ext>`; prefer meaningful alt text in Markdown. |
| 14 | +- HTML: keep semantic tags where possible; avoid inline styles unless necessary for fidelity. |
| 15 | +- Assets: follow existing pattern `imageNNN.(jpg|png)` to keep ordering clear (e.g., `image063.jpg`). |
| 16 | +- Indentation: 2 spaces for HTML; wrap lines at ~120 chars. |
| 17 | +- Do not rename or move `JumpServer-whitepaper.html` or the `.fld` directory. |
25 | 18 |
|
26 | 19 | ## Testing Guidelines |
27 | | -- Manual checks: |
28 | | - - Run `python3 extract_images.py` and confirm the reported image count matches expectations. |
29 | | - - Open `index.html` locally; verify images render and links work. |
30 | | -- Optional validation: |
31 | | - - Validate HTML via an online validator when making structural changes. |
| 20 | +- Visual check: open the HTML and verify all images render and links work. |
| 21 | +- Links: ensure internal anchors resolve; use relative paths only. |
| 22 | +- Accessibility spot check: provide alt text for new images where feasible. |
| 23 | +- If large edits: test in at least two browsers (e.g., Safari/Chrome). |
32 | 24 |
|
33 | 25 | ## Commit & Pull Request Guidelines |
34 | | -- Commit messages: prefer Conventional Commits (e.g., `feat: ...`, `fix: ...`, `perf: ...`, `docs: ...`). |
35 | | -- Scope small, atomic commits; explain “why” in the body if non-obvious. |
36 | | -- Pull Requests should include: |
37 | | - - Summary of changes, screenshots for visual changes, and any manual test notes. |
38 | | - - Reference related issues (e.g., `Closes #123`). |
| 26 | +- Commit messages: use concise prefixes like `docs:`, `assets:`, `fix:` (e.g., `docs: update section 3 wording`). |
| 27 | +- One logical change per commit; keep diffs focused on content you touched. |
| 28 | +- PRs should include: short description, before/after screenshots for visual changes, and any manual test notes. |
39 | 29 |
|
40 | | -## Security & Configuration Tips |
41 | | -- Do not commit secrets; this site is static. Review diffs for large/binary additions. |
42 | | -- `CNAME` config must remain at repo root for Pages; update only when the domain changes. |
| 30 | +## Security & Maintenance Notes |
| 31 | +- Do not embed secrets or tracking scripts. |
| 32 | +- Keep external dependencies out of the repo; prefer self‑contained assets inside `.fld`. |
| 33 | +- Large images: compress before adding to keep repo small. |
| 34 | + |
| 35 | +## Agent-Specific Instructions |
| 36 | +- When editing files, preserve file names and relative links in `JumpServer-whitepaper.fld/`. |
| 37 | +- Avoid restructuring; prioritize minimal diffs to maintain link integrity. |
0 commit comments