This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
apemanzilla's profile picture

opdoc - GUI documentation browser for OpenPeripheral

Started by apemanzilla, 02 December 2015 - 11:59 PM
apemanzilla #1
Posted 03 December 2015 - 12:59 AM
I got tired of using OpenPeripheral's built-in 'doc' program, so I wrote opdoc! It's a useful program that uses
Flare to give you a nice, clean GUI for browsing the peripheral documentation in-game.


When you run opdoc, you'll see a bar at the top of the screen containing all attached peripherals that are supported by OpenPeripheral. Selecting one from this list will give you a list of its methods, as seen in the screenshot. Selecting a method will give you the description, arguments, and return information for that method. Here's a quick gif of it in action:


Much better than the built-in program, eh? The scrollbars are particularly useful for reading the documentation for methods with a lot of arguments.


You can download the program like so:


pastebin get 3NPXAasm opdoc


When you run it, it will automatically detect all compatible peripherals, and from there on it's pretty easy to figure out.
Edited on 03 December 2015 - 12:09 AM
Bomb Bloke #2
Posted 03 December 2015 - 01:51 AM
Oh hey, that's pretty cool. Source's surprisingly short, too, which speaks well of Flare.

FWIW, these days running "/op_dump" in chat creates an HTML dump of all OpenP functionality "currently available" into your install folder. But I'm really liking the presentation you've got here; a bit of decent colouring and formatting goes a long way towards making information easy to sift through.
apemanzilla #3
Posted 03 December 2015 - 02:26 AM
Oh hey, that's pretty cool. Source's surprisingly short, too, which speaks well of Flare.

FWIW, these days running "/op_dump" in chat creates an HTML dump of all OpenP functionality "currently available" into your install folder. But I'm really liking the presentation you've got here; a bit of decent colouring and formatting goes a long way towards making information easy to sift through.

Yeah, I could have probably reduced the source to 60 or so lines had I been more familiar with Flare, this is pretty much my first project with it. I didn't know about the op_dump command, but this could still be useful for people who prefer to stay within CC.
Exerro #4
Posted 04 December 2015 - 02:01 PM
Oooh, this looks really nice and slick. I love the colouration, and it's good to see Flare getting some use too. It might be worth setting `button.noAlign` to true for the buttons in the function list though, it looks a little weird with them all centre aligned.
apemanzilla #5
Posted 04 December 2015 - 07:27 PM
Oooh, this looks really nice and slick. I love the colouration, and it's good to see Flare getting some use too. It might be worth setting `button.noAlign` to true for the buttons in the function list though, it looks a little weird with them all centre aligned.

Ah, I hadn't seen that.

Also, while trying to make the containers slide in/out with transitionInRight and the other functions, the containers would seem to stop 1 pixel early - they should have been at (1,1) but they would end up at (0,1) when sliding in from the left or (2,1) when sliding in from the right.
D4rkSol1tud3 #6
Posted 25 December 2015 - 12:45 PM
This is amazing, very well done. I wish the built in way was something like this.
apemanzilla #7
Posted 28 December 2015 - 07:40 PM
This is amazing, very well done. I wish the built in way was something like this.

Thanks! The built-in documentation is pretty basic, which is why I made this :)/>
gScottSingleton #8
Posted 08 March 2016 - 04:35 AM
I absolutely <heart> this!

a table browser to call those functions and review results would be uber-fabulous.
Konlab #9
Posted 25 March 2016 - 09:07 AM
What is the license for redistributing a modified version?
apemanzilla #10
Posted 29 March 2016 - 03:09 AM
What is the license for redistributing a modified version?

You can do whatever you want as long as you don't hold me liable for anything and provide attribution.
Edited on 29 March 2016 - 01:10 AM