diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..463df2a --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,49 @@ +name: Deploy docs + +on: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install uv and set the python version + uses: astral-sh/setup-uv@v5 + with: + python-version: "3.11" + enable-cache: true + cache-dependency-glob: "uv.lock" + + - name: Install docs dependencies + run: uv sync --extra docs + + - name: Build docs + run: uv run zensical build + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./site + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - id: deployment + uses: actions/deploy-pages@v4 diff --git a/docs/usage/adding-models.md b/docs/usage/adding-models.md index 0717348..90681fa 100644 --- a/docs/usage/adding-models.md +++ b/docs/usage/adding-models.md @@ -114,7 +114,7 @@ The `add_view()` method accepts several parameters to configure your model's adm | `select_schema` | Pydantic Schema | ❌ | Schema for read operations - excludes problematic fields | | `update_internal_schema` | Pydantic Schema | ❌ | Internal schema for system updates | | `delete_schema` | Pydantic Schema | ❌ | Schema for deletion operations | -| `allowed_actions` | Set[str] | ❌ | Controls available operations ("view", "create", "update", "delete") | +| `allowed_actions` | `Set[str]` | ❌ | Controls available operations ("view", "create", "update", "delete") | | `include_in_models` | bool | ❌ | Whether to show in admin navigation (default: True) | | `password_transformer` | PasswordTransformer | ❌ | For handling password fields | | `display_field` | str | ❌ | Column used as this model's label when it appears as a related record from another model (e.g. `"name"`). Falls back to the primary key when unset. | diff --git a/docs/usage/interface.md b/docs/usage/interface.md index 3d6b23e..52252c2 100644 --- a/docs/usage/interface.md +++ b/docs/usage/interface.md @@ -57,7 +57,7 @@ The left sidebar contains collapsible sections: #### Step 1: Access Create Form -- Click **"+ Add [ModelName]"** button on any model list page +- Click **"+ Add \[ModelName\]"** button on any model list page - Form opens with fields based on your Pydantic schema #### Step 2: Fill Required Fields diff --git a/docs/usage/overview.md b/docs/usage/overview.md index ae3a625..22007b4 100644 --- a/docs/usage/overview.md +++ b/docs/usage/overview.md @@ -70,7 +70,7 @@ After completing the Usage section, you'll have a solid foundation for building Need to jump to a specific topic? Here are the most commonly accessed sections: -- **[Quick setup example](configuration.md#basic-example)** - Get running in 5 minutes +- **[Quick setup example](configuration.md#minimal-setup)** - Get running in 5 minutes - **[Session backends](session-backends.md#redis-sessions)** - Configure Redis for production - **[Adding your first model](adding-models.md#basic-model-registration)** - Register a model and start managing data - **[Search and filtering](interface.md#search-and-filtering)** - Find records quickly diff --git a/mkdocs.yml b/mkdocs.yml deleted file mode 100644 index 8ccaea7..0000000 --- a/mkdocs.yml +++ /dev/null @@ -1,95 +0,0 @@ -site_name: CRUDAdmin -site_description: Modern admin interface for FastAPI with built-in authentication, event tracking, and security features. -site_author: Igor Benav -site_url: https://github.com/benavlabs/crudadmin - -theme: - name: material - font: - text: Ubuntu - logo: assets/logo.png - favicon: assets/logo.png - features: - - navigation.instant - - navigation.instant.prefetch - - navigation.tabs - - navigation.indexes - - search.suggest - - content.code.copy - palette: - - media: "(prefers-color-scheme: light)" - scheme: default - primary: custom - accent: custom - toggle: - icon: material/brightness-7 - name: Switch to dark mode - - - media: "(prefers-color-scheme: dark)" - scheme: slate - primary: custom - accent: custom - toggle: - icon: material/brightness-4 - name: Switch to light mode - -plugins: - - search - - meta-descriptions - - mkdocstrings: - handlers: - python: - rendering: - show_source: true - -nav: - - CRUDAdmin: index.md - - Quick-Start: quick-start.md - - Usage: - - Overview: usage/overview.md - - Basic Configuration: usage/configuration.md - - Session Backends: usage/session-backends.md - - Adding Models: usage/adding-models.md - - Managing Admin Users: usage/admin-users.md - - Using the Interface: usage/interface.md - - Common Patterns: usage/common-patterns.md - - Advanced: - - Overview: advanced/overview.md - - API Reference: - - Overview: api/overview.md - - CRUDAdmin: api/crud_admin.md - - ModelView: api/model_view.md - - AdminSite: api/admin_site.md - - Session Management: api/session.md - - Event System: api/events.md - - Community: - - Overview: community/overview.md - - Contributing: community/CONTRIBUTING.md - - Code of Conduct: community/CODE_OF_CONDUCT.md - - License: community/LICENSE.md - -markdown_extensions: - - admonition - - codehilite - - toc: - permalink: true - - pymdownx.details: - - pymdownx.highlight: - anchor_linenums: true - line_spans: __span - pygments_lang_class: true - - pymdownx.inlinehilite - - pymdownx.snippets - - pymdownx.superfences - -repo_name: benavlabs/crudadmin -repo_url: https://github.com/benavlabs/crudadmin -edit_uri: edit/main/docs/ - -extra_css: - - stylesheets/extra.css - -extra: - analytics: - provider: google - property: !ENV [GOOGLE_ANALYTICS_KEY, ''] \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index ed4317b..c6da3ec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -93,10 +93,9 @@ dev = [ ] docs = [ - "mkdocs>=1.6.1", - "mkdocs-meta-descriptions-plugin>=4.0.0", - "mkdocs-material>=9.6.1", - "mkdocstrings[python]>=0.27.0" + "zensical>=0.0.15", + "mkdocstrings[python]>=1.0,<2", + "mkdocs-autorefs>=1.0,<2" ] all = [ diff --git a/zensical.toml b/zensical.toml new file mode 100644 index 0000000..95e0aa8 --- /dev/null +++ b/zensical.toml @@ -0,0 +1,129 @@ +[project] +site_name = "CRUDAdmin" +site_description = "Modern admin interface for FastAPI with built-in authentication, event tracking, and security features." +site_author = "Igor Benav" +site_url = "https://benavlabs.github.io/crudadmin" +docs_dir = "docs" +site_dir = "site" + +copyright = "© 2026 Benav Labs" + +extra_css = ["stylesheets/extra.css"] + +repo_name = "benavlabs/crudadmin" +repo_url = "https://github.com/benavlabs/crudadmin" +edit_uri = "edit/main/docs/" + +# ============================================================================== +# Theme +# ============================================================================== + +[project.theme] +variant = "modern" + +logo = "assets/logo.png" +favicon = "assets/logo.png" + +font.text = "Ubuntu" + +features = [ + "navigation.instant", + "navigation.instant.prefetch", + "navigation.tabs", + "navigation.indexes", + "search.suggest", + "content.code.copy", +] + +[[project.theme.palette]] +scheme = "default" +primary = "custom" +accent = "custom" +toggle.icon = "lucide/sun" +toggle.name = "Switch to dark mode" + +[[project.theme.palette]] +scheme = "slate" +primary = "custom" +accent = "custom" +toggle.icon = "lucide/moon" +toggle.name = "Switch to light mode" + +# ============================================================================== +# Navigation +# ============================================================================== + +[[project.nav]] +"CRUDAdmin" = "index.md" + +[[project.nav]] +"Quick-Start" = "quick-start.md" + +[[project.nav]] +"Usage" = [ + { "Overview" = "usage/overview.md" }, + { "Basic Configuration" = "usage/configuration.md" }, + { "Session Backends" = "usage/session-backends.md" }, + { "Adding Models" = "usage/adding-models.md" }, + { "Managing Admin Users" = "usage/admin-users.md" }, + { "Using the Interface" = "usage/interface.md" }, + { "Common Patterns" = "usage/common-patterns.md" }, +] + +[[project.nav]] +"Advanced" = [ + { "Overview" = "advanced/overview.md" }, +] + +[[project.nav]] +"API Reference" = [ + { "Overview" = "api/overview.md" }, + { "CRUDAdmin" = "api/crud_admin.md" }, + { "ModelView" = "api/model_view.md" }, + { "AdminSite" = "api/admin_site.md" }, + { "Session Management" = "api/session.md" }, + { "Event System" = "api/events.md" }, +] + +[[project.nav]] +"Community" = [ + { "Overview" = "community/overview.md" }, + { "Contributing" = "community/CONTRIBUTING.md" }, + { "Code of Conduct" = "community/CODE_OF_CONDUCT.md" }, + { "License" = "community/LICENSE.md" }, +] + +# ============================================================================== +# Markdown extensions +# ============================================================================== + +[[project.markdown_extensions]] +admonition = {} + +[[project.markdown_extensions]] +"codehilite" = {} + +[[project.markdown_extensions]] +"toc" = { permalink = true } + +[[project.markdown_extensions]] +"pymdownx.details" = {} + +[[project.markdown_extensions]] +"pymdownx.highlight" = { anchor_linenums = true, line_spans = "__span", pygments_lang_class = true } + +[[project.markdown_extensions]] +"pymdownx.inlinehilite" = {} + +[[project.markdown_extensions]] +"pymdownx.snippets" = {} + +[[project.markdown_extensions]] +"pymdownx.superfences" = {} + +# ============================================================================== +# Plugins +# ============================================================================== + +[[project.plugins]] +"mkdocstrings" = { config = { handlers = { python = { options = { show_source = true } } } } }