Problem/Motivation
The Image Link Formatter module currently provides documentation primarily through its README file. To improve documentation accessibility, discoverability, and maintainability, we should implement a GitLab Pages documentation site using the standardized MkDocs approach supported by Drupal's GitLab templates.
A GitLab Pages site will provide:
- Better navigation and search functionality
- Version-controlled documentation-as-code
- Automatic publishing on commits to the default branch
- Preview capabilities in merge requests
- A professional, maintainable documentation structure
Steps to reproduce
Proposed resolution
Implement a GitLab Pages documentation site for the Image Link Formatter module following the standard Drupal GitLab templates approach documented at: https://project.pages.drupalcode.org/gitlab_templates/jobs/pages/
Implementation steps:
- Create MkDocs configuration file (
mkdocs.ymlin project root)- Configure site metadata (name, URL, repository links)
- Set up Material for MkDocs theme
- Configure navigation structure
- Use the project's existing
logo.pngfile - Enable search and privacy plugins
- Create documentation structure (
/docsfolder)- Create
docs/index.mdas the homepage - Migrate and enhance content from existing README
- Structure documentation following best practices:
- Installation and setup
- Configuration guide
- Usage examples
- Field formatter configuration options
- Troubleshooting
- Contributing guidelines
- Developer documentation (if applicable)
- Create
- Configure GitLab Pages deployment
- Verify that the GitLab templates are properly configured (should work automatically)
- Set unique domain setting as needed in
Deploy > Pages > Domains & settings - Test that the
pagesjob runs on commits to the default branch
- Validate deployment
- Confirm site publishes at: https://project.pages.drupalcode.org/image_link_formatter
- Verify all internal links work correctly
- Check that search functionality works
- Validate logo display
- Test MR preview functionality
Example implementation structure:
image_link_formatter/
├── mkdocs.yml
├── logo.png (existing)
└── docs/
├── index.md (homepage)
├── installation.md
├── configuration.md
├── usage.md
├── troubleshooting.md
└── developer/
└── architecture.md (optional)
Examples and references
Similar implementations:
- Name Field module: #3569923: Add gitlab pages
- Authorization module: #3595618: Add gitlab pages
- Search for other projects: https://git.drupalcode.org/search?group_id=2&repository_ref=main&scope=b...
Official documentation:
- GitLab Pages for Drupal projects: https://project.pages.drupalcode.org/gitlab_templates/jobs/pages/
- Material for MkDocs: https://squidfunk.github.io/mkdocs-material/
- GitLab Pages official docs: https://docs.gitlab.com/ee/user/project/pages/
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork image_link_formatter-3612109
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
Comment #4
dydave commentedQuick follow-up on this issue:
This ticket was initially prompted by the need of finding an appropriate place in the module to store AI "spec-driven" prompts and PLAN/SPECS.md types of files.
I thought documentation would be a "safer" space to work with AI and give more trust to its generated content.
Since I saw there was a new documentation job supported in the gitlab CI builds for documentation, I thought it would be a great opportunity to try producing everything with AI.
So I started by adding the mkdocs.yml config file with the specs files in the
docs/specsfolder and then thought of expanding with different sections: User guide, developer, etc...The README.md file served as a great starting point.
I actually spent most of the time refining the documentation:
Each time I would preview the md files locally and think of new things to add or modify.
It was a very iterative process which I tried to keep documented in the file: GITLAB_PAGES_SPEC.md.
At a very small scale, I tried to apply a "spec-driven" approach and refine as much as possible a specifications document to specify certain tasks or rules for the AI agent.
A lot of issues were thankfully caught by the quality gates: breaking build pipelines on Gitlab CI, which is a really great thing.👍
Among some of the problems encountered:
I deployed the documentation several times by triggering builds manually on the issue fork repos which allowed me to fully test the rendered output of all the pages.
Since all the jobs and tests were still passing all 🟢, I went ahead and merged the changes above at #3.
The documentation site is now live at: 🥳
https://project.pages.drupalcode.org/image_link_formatter/
The last build with all jobs came back all green 🟢:
https://git.drupalcode.org/project/image_link_formatter/-/pipelines/899870
I already updated the project page to add a section to point to the new documentation:
https://www.drupal.org/project/image_link_formatter#documentation
I'm sure we will think of other things to add or modify in the documentation, but this is already a great initial base for such a small module on which we should be able to keep building in the future. 👌
Since I don't see any more actions to be carried in this issue, we could most likely consider all the work initially described and expected should have been completed at this point.
Therefore, marking issue as Fixed for now.
Feel free to let us know if you have any questions or concerns on any aspects of the documentation or the module in general, we would surely be glad to hear your feedback.
Thanks in advance!