Readable Source Code Documentation
for 25 Programming Languages
![]() | Natural Docs lets you document code written in any of 25 programming languages, plus it can be easily extended for more so whatever you use, it can too. And if your project uses multiple languages, no problem! It will all be included in the same set of documentation. |
Natural Docs also speaks your other language... English! Its comments are designed to be very natural and readable so they're just as usable in the source code as they are in the generated documentation. No weird syntax or tags scattered everywhere. | ![]() |
![]() | Natural Docs' generated documentation is pretty and powerful, with three independently scrolling panels, dynamic menus, search, and pop-up summaries when you hover over links. All its features work wherever you put it, be it a web server, a network share, or just opened from your hard drive. |
If you're new to Natural Docs be sure to read our Getting Started guide and we'll have you up and running in no time. If you've been using Natural Docs 1.5, check out our tour of What's New in 2.0! |
Time to start wrapping up 2.4. What do we have in store? Five New Languages I've been letting the language list languish for far too long, so now we have five more. Natural Docs now has native support for:
All of these languages have mini-parsers written for them, so while they still only have basic language support they each have their own keyword lists for syntax highlighting and tweaks to handle anything that requires it, like decorators or special string formats. Go and TypeScript were tricky enough that I feel like I'm already a third of the way towards full language support. While I was at it I also greatly improved support for JavaScript. It needed it for its own sake but also for things shared with TypeScript. In the process of doing all this I made the base parser more extensible so it will be easier to do it more without duplicating a lot of code. I want to improve support for more languages, so... which ones do you use? I have my own idea of which ones to tackle and in what order but I'd also prioritize the ones people say they're using, so if you let me know which languages you're using Natural Docs with I'll see what I can do. Finishing Up Repositories Continuing the work from development release 2, there is now support for Forgejo, Bitbucket, and Azure Repos in addition to the existing support for GitHub, GitLab, Codeberg, and Gitea. There's also support for self-hosted versions. If you include the name of the site in the Repository line but the URL doesn't go to their public site Natural Docs will assume it's self-hosted and use whatever URL you entered as the base address. So if you host your repository on Bitbucket.org, you would do this: Repository: https://bitbucket.org/UserName/ProjectName However, if you're using a self-hosted version you would include the name of the site and put the base URL of wherever it's hosted: Bitbucket Repository: https://mysite.com/BitBucket/projects/ProjectName/repos/RepoName It doesn't matter what folder, domain, or subdomain you have, it will just add to the URL you give it. If Natural Docs doesn't recognize your site or needs more information it will tell you when you try to run it. You can always fall back to just setting the "Link Template" parameter yourself, this just makes it a bit simpler and cleaner in the config file. Finishing Up Quick Documentation I've extended the quick documentation mentioned in development release 1 and 2 to be usable with more things. You can now use it to document anything that typically has a single-line definition, which means besides enum values it now works for variables, constants, delegates, and events that don't have add/remove defined. You can now do this: struct Point { So what are the rules for when you can use quick documentation like this? You can use it when:
I feel like those rules make sense and should be easy to remember. Finishing Up Enums So quick documentation was initially limited to enum values, but now it's expanded to more. However, I still improved enums further by allowing inline grouping. So you can write this: enum Transportation { and it works as if you wrote this: /* Enum: Transportation Also, you can now document values inside enum bodies with full comments above them if you want to. That's not something I'd recommend, but it adds compatibility for comments already written for Javadoc or XML: enum Transportation { They'll be merged into the enum body automatically and the result will be the same as the previous examples. Wrapping Up That's basically it for 2.4. I may improve support for a few more languages (so tell me which ones you want) but otherwise it's done. 2.4's feature list will be the new languages, repository links, quick documentation, enums, and the big speed boost from moving to native binaries. I haven't forgotten about SystemVerilog so work on that's should start up again for 2.5. |