Problem/Motivation

Sibling modules in the same ecosystem, ai and ai_agents, both publish a MkDocs site (https://project.pages.drupalcode.org/ai/, https://project.pages.drupalcode.org/ai_agents/). ai_agents_views had neither a mkdocs.yml nor the pages CI stage those two rely on, so nothing in its own docs/ directory was ever built or published anywhere - it was readable only by browsing the repository directly.

Separately, docs/ mixed audiences with no organization reflecting that: architecture.md is a deep internals reference for contributors (plugin classes, trait methods, DI); testing.md and views-assistant.md are also fairly technical (the PHPUnit suite, static analysis setup, hook_requirements() internals); prompts.md and the newer views-assistant-prompts.md are genuinely site-builder-facing - the actual target audience the module's own shipped agents are written for ("Sitebuilders with no Drupal experience," per config/install/ai_agents.ai_agent.views_agent.yml). There was no dedicated landing page, and no distinction anywhere between "read this to use the module" and "read this to contribute to it."

Two of the docs files' own internal cross-references were also broken, in a way a published site would have surfaced immediately: docs/prompts.md linked to ../config/install/ai_agents.ai_agent.views_agent.yml, a path outside docs_dir that a built MkDocs site can never resolve. docs/views-assistant-prompts.md referenced ../../docs/prompts.md - a relative path that actually escapes the module root entirely rather than reaching its own sibling file - and separately claimed prior bug write-ups live "at the repo root," when those write-ups actually live in an entirely different, outer project, not in this module's repository at all.

Proposed resolution

  • mkdocs.yml (new): modeled on ai_agents's simpler configuration (no versioning/plugin stack, since this module is comparably small) - theme: material, docs_dir: docs, site_dir: site, and a nav grouped as Home, Example Prompts (Views Agent / Views Assistant), Views Assistant Submodule, and Testing. architecture.md is deliberately left out of the nav - it stays a repo-only contributor reference, per project decision, rather than being published to the site-builder-facing site.
  • docs/index.md (new): a site-builder-friendly Home page - what the module can do, install steps, a sample prompt, and pointers into the prompt libraries and the optional chat submodule - adapted from the plain-language parts of project-page.html and README.md, with none of the internals content from architecture.md.
  • .gitlab-ci.yml: added the pages: stage: .post stub present in both ai and ai_agents, without which the shared GitLab CI template has nothing to build or publish from.
  • .gitignore (new): ignores /site, the MkDocs build output, matching the ai module's convention.
  • .cspell-project-words.txt: added mkdocs - not in the shared dictionary, and needed by both sibling modules' own project word lists too.
  • Fixed the broken cross-references above: docs/prompts.md's dead config-file link was replaced with plain prose (a site builder doesn't need the raw YAML path anyway); docs/views-assistant-prompts.md's broken relative path was corrected to a real link to its sibling file, and the wrong "repo root" claim was reworded to point at the issue queue instead of a location that doesn't exist in this repository.
  • README.md: added a "Documentation" section (published-site link plus local mkdocs serve steps, mirroring ai_agents's README), converted bare doc-path mentions into real links, and added the docs/views-assistant-prompts.md reference that was missing entirely before.

Remaining tasks

  • File this issue on drupal.org.
  • Open an MR with the changes above.

Test coverage added locally

Not applicable as unit/Kernel tests - this is a documentation and tooling change with no code or config behavior to regression-test. Verified instead by installing mkdocs and mkdocs-material into a throwaway virtualenv and running mkdocs build --strict against the module's own mkdocs.yml: it built cleanly (exit 0), with the only message being the expected, intentional notice that architecture.md exists but isn't included in the nav.

API changes

None. Documentation and build tooling only - no changes to any shipped plugin, config, or config schema.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jibran created an issue. See original summary.

  • jibran committed e7b22f89 on 1.0.x
    feat: #3626343 Add MkDocs support and a site-builder-friendly...
jibran’s picture

Status: Active » Fixed

Committed and pushed to 1.0.x

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • jibran committed 53795290 on 1.0.x
    fix: #3626343 Fix MkDocs build.
    
    Signed-off-by: Jibran Ijaz...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.