---
name: docs_authoring
description: "How to add a page to the evolution/docs end-user documentation system, and where the permissions docs/logic live"
metadata: 
  node_type: memory
  type: reference
  originSessionId: bc0c41e9-a496-45b9-a31e-0d940754b513
---

End-user docs live in `evolution/docs/`, grouped into section folders (`overview/`, `modules/`, `projects/`, `reporting/`, `api/`, `mobile/`, `admin/`).

**To add a doc page**, copy the template pattern any existing page uses (e.g. `docs/modules/assets.php`):
1. `require __DIR__ . '/../includes/bootstrap.inc.php';` (defines `DOCS_ROOT`, `WEB_ROOT`, `e()`).
2. Set `$page`, `$docTitle`, `$docSubtitle`.
3. Include `head.inc.php`, `sidebar.inc.php`, `header.inc.php` from `DOCS_ROOT . '/includes/'`.
4. Content is Bootstrap 5 markup (cards, tables, `material-symbols-rounded` icons). Bootstrap JS via CDN at the bottom.

**Sidebar nav** is hand-edited in `docs/includes/sidebar.inc.php` — entries are grouped under `<div class="h5">Section</div>` blocks. Active state uses `isActive("filename.php")` matching the URL.

Permission docs: `docs/admin/setting-permissions.php` is the canonical end-user write-up of the staff permission system. The underlying logic: levels (0 Denied / 1 Allowed / 2 Admin) are set in [[evolution_permission_system]] via `staffedit.inc` → `permissions` table → loaded into `$_SESSION` at login by `login2save.php` → checked per-screen. If permission behaviour changes in code, update that doc page rather than recording the detail here.
