I have created a custom module for my site that includes a public REST API. We've also written public documentation for the API. It's currently written in Markdown for convenience and easy export. We maintain the documentation in version control so that it stays up-to-date along with changes to the endpoint in the module itself.
We would like to publish this documentation to the site in a way that is publicly accessible. I've found documentation on hook_help
but that seems to be targeted towards site admins (e.g. documenting settings for the module). Instead, we're looking to document the API endpoint for an end user. We know we could simply create Page content to hold the documentation but we were looking for something more automatic when the module code is updated.
Is hook_help
still the right way to add this content to the site? Is there a way to make only portions of the Help section public? Or is there another way to publish API documentation as part of the module?
We are currently on Drupal 7 if it is relevant.
EDIT:
Additional Info:
- We are using the Services module to manage the API endpoint(s)
- We are less looking for documentation generation and more looking for a way to publish the documentation that we have already written in a way that it is updated automatically when the module is updated. We maintain our documentation in version control so that it is updated as part of development. By doing it manually, it is more comprehensive and directly useful than generated documentation (IMO). We would just like the work done during development to be displayed publicly without having to do the extra step of copy-pasting to a Page (a step which is easily forgotten).