Maybe a better question is, what editor do I use to create documentation for a project or library? In the "New Project" tutorial, I see examples of projects, but am missing the how (tools, editor) of creating the documentation.
For example, the project "Herb Box Eco System", has a nice window that presents various code files, in the section titled, "CODE". How is that window created?
That includes the Serial reference pages. I believe they use a tool named Hugo to render the content from those pages:
A popular documentation generation tool is called doxygen. That works from comments in the code. Often I find the doxygen generated documentation to be hard to navigate but I think with a bit of care it can be very good.
I don't have experience with the Arduino Project Hub. I suspect if you start a new project and tinker around it will quickly be quite clear.
I know the Arduino Project Hub does offer integration with the Arduino Web Editor, where you can embed your Arduino Web Editor sketches in an Arduino Project Hub project and the contents will be automatically updated anytime you edit your sketch and also it will be easy for people to open a copy of your code in their own Arduino Web Editor account. However, I don't believe that is the case with the code boxes you see in the Herb Box Eco System project.