Score:-2

How do I automatically generate documentation for my site?

hk flag

I am working on a complex Drupal site with a lot of custom modules, custom entities, custom classes, custom views, custom events, custom event subscribers, custom forms, custom controllers. In short, a lot of custom code.

It is a big challenge trying to keep the technical documentation for the system updated when we keep making changes to the application on an ongoing basis.

Is there some way to generate technical documentation for the site automatically? For example.

A module is used for x, y, z V view is used for such things, the view blocks are being used in such and such pages. C content type is used for l, m, n and is used in V1, V2, V3 views.

If not fully automatically, partially at least and have some mechanism to add remaining items manually?

Edit: Thanks for the tip on the API module @cilefen. That seems to be a good way to generate documentation about the custom code. However there are pieces that are part of configuration as well - like views, layouts, blocks etc. That would not get documented with the API module.

Score:1
id flag

Use the API module to generate documentation from code. Doxygen or phpDocumentor may work for you too, depending on your needs.

Jaypan avatar
de flag
I second the API module.
hk flag
Thanks for the tip on the API module. That is an interesting option. How do you document views, layouts, content types and other items that are part of the configuration?
id flag
That is also the API module. Consider any *.api.php file in Drupal generates pages on the API site. We are now getting into opinion territory, but also https://www.mkdocs.org is simple and easy-to-use for ad-hoc documentation.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.