Documentation Reader - A Plugin for Scripters!

ANOTHER UPDATE

This has been added :smiley: And the OP has been updated to have an image of this update.

I agree - that’s why this update changed to accommodate that. Now if you have erroneous documentation comments, you’ll get a warning in your output every time you select the script in Explorer, but the rest of the comments should load properly regardless.

2 Likes

Sweet, just updated and things are looking better!

Quick question:
confusing-text

That means no description was loaded - I should probably change that to default to an empty string…

Nice plugin ! I would love if I can say for example < type > and that the plugin will highlight the type :slight_smile: So that I can say @returns < int > or @returns < table >

Or even say
@param name < type >

1 Like

It’s an easy enough addition to make, but I’d need convincing on why this makes sense for a weakly typed language like Lua? Could you offer any examples of where this is useful?

DARK THEME UPDATE

Since it appears a dark theme for Studio is already on production, just not live, I have updated the plugin to accommodate the new theme! Here are some images :slight_smile:

Images

List view

Details view

Swap menu
image

Settings menu

2 Likes

I’ll test this plugin heh. Maybe it can become handy when I’m developing my new game.

You seem to have forgotten to remove your debug lines :stuck_out_tongue:

I got these while testing and didn’t get them after disabling the plugin.

image

1 Like

…That’s only mildly embarrassing.
Fixing now.

2 Likes

Fixed.

2 Likes

UPDATE

You can now add a ā€œvalue-typeā€ attribute to your parameters and return values. Here is an example in Rodocs:

--[[**
    Some function

    @param [t:number] bar Some random number
    @param addend Another number, but notice that the value type is not listed. That's because it is optional.

    @returns [t:number] The sum of the two numbers
**--]]
function foo(bar, addend)
    return bar + addend
end

For the XML style, please reference the help documents that can be brought up using the help button :slight_smile:

1 Like

UPDATE

Now when you select a script, you will have the option to ā€œGenerate markup.ā€ In the future, I plan to implement multiple markup languages, which will be another setting. For now, there is only Markdown.

This is a really awesome addition for GitHub repositories :smiley: Hopefully this helps to incentivize people to add Rodocs comments to their open source libraries since it will auto-generate Markdown now :slight_smile:

2 Likes

One further update - I finally got around to making the plugin work with Studio themes with the new API.

Reminder for the author of the plugin.

Also something that popped up in my mind. A field that states whether the function will yield or not.

1 Like

I am considering removing the XML style documentation so as to make it easier to expand upon Rodocs. Is anyone opposed to this idea?

2 Likes

You’ll get no objections from me. Before you do so however, how are you going about getting xml style elements and their attributes? I’m curious.

I just documented my RbxWeb module with this, and it’s so much better now. This plugin is absolutely amazing if you dedicate the time to documenting all of your code.

I did notice a bug with the plugin where it wasn’t showing documentation until I refreshed my plugins. It wasn’t even showing an error either. I’ll update this comment with a picture of it if it happens again.
image

Edit:
Here’s the bug.

And I do have a module selected, with proper documentation.

3 Likes

This plugin is great, I’ve been documenting all my scripts with it. I have one thing to nitpick though; it only allows for one return value and even gives a warning in the output about it.

Having multiple doc tags of type returns is not allowed.

I find this silly because it’s natural for Lua functions to return multiple values, or a tuple.

1 Like

I love this. The minute I start a new script, I’ll be using this to keep myself sane and productive. You are a lifesaver :joy:

This is a great plugin, it has really helped keep me sane when working with large codebases. I do have two suggestions though. Firstly, could you consider adding a setting to hide the Swap and Help buttons (and maybe an option to move the Settings button to the reader)? My plugin bar is getting really cluttered and I want to minimize that as much as possible. I could edit the script, but I don’t want to miss out on any updates. Secondly, can you enable ClickableWhenViewportHidden on the toolbar buttons? (Sorry for the necro)

2 Likes