Scripting is often done now with a large number of ModuleScripts communicating with functions. I, for one, quite like this approach. But I found it tedious to repeatedly open my ModuleScripts and scroll through the code just to remember exactly how I had named a function earlier in the week. So I decided to do something about it.
I introduce to you, Documentation Reader, a plugin meant to help game programmers keep track of their code.
This allows developers to use simple documentation comments in their scripts to render details into this plugin’s widget with a click!
To add documentation to a script, simply add comments where you’d like them in the following format:
--[[** <description> This is where you can write the description for your documentation comment </description> <parameter name = "bar"> This is where you can describe what your parameter is expecting and what it is used for </parameter> <returns> This is where you can explain what your function returns </returns> **--]] function foo(bar) return bar + 1 end
Version 1.1 (Latest)
New "Rodocs" format
--[[** This is where you can write the description for your documentation comment @param bar This is where you can describe what your parameter is expecting and what it is used for @returns This is where you can explain what your function returns **--]] function foo(bar) return bar + 1 end
Please note that all documentation tags are optional–you could create an empty documentation comment and it would work just fine.
To view documentation in a script, simply select the script you want to read about in the Explorer window. The Doc Reader window will display a list of buttons for every documentation comment that it finds. Just click on a button to read more details!
I know I wanted this, and I have seen at least one post in this forum asking for a similar feature as well. So I hope this is able to help developers!
And another note, anyone who would like to make comments or suggestions, please feel free to do so below. And if you would like to make a fork and send me the code changes, I am more than happy to read them and possibly merge it into the plugin’s source code!