Time to start wrapping up 2.4. What do we have in store?
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:
Rust
Swift
Kotlin
Go
TypeScript
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.
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.
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 {
int x; /// The horizontal coordinate
int y; /// The vertical coordinate
}
So what are the rules for when you can use quick documentation like this? You can use it when:
The language has full support, which currently is only C#.
You're documenting something that's usually short and on a single line, not something that has a body with { } or =>. So yes for variables, constants, and enum values, no for classes, functions, and properties.
You're using a /// or /** comment after it on the same line.
I feel like those rules make sense and should be easy to remember.
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 {
// Group: Land
Car, /// Goes vroom vroom
Bicycle, /// Goes brring brring
Skateboard, /// Goes "ow, I fell"
// Group: Water
Boat, /// Is expensive
Kayak, /// Is less expensive
InnerTube /// Is not expensive
}
and it works as if you wrote this:
/* Enum: Transportation
*
* Land:
* Car - Goes vroom vroom
* Bicycle - Goes brring brring
* Skateboard - Goes "ow, I fell"
*
* Water:
* Boat - Is expensive
* Kayak - Is less expensive
* InnerTube - Is not expensive
*/
enum Transportation {
Car, Bicycle, Skateboard,
Boat, Kayak, InnerTube
}
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 {
/// <summary>Goes vroom vroom</summary>
Car, ...
They'll be merged into the enum body automatically and the result will be the same as the previous examples.
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.