←  Programs

ComputerCraft | Programmable Computers for Minecraft

»

opdoc - GUI documentation browser for Open...

apemanzilla's Photo apemanzilla 03 Dec 2015

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.
Posted Image


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:

Posted Image

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 by apemanzilla, 03 December 2015 - 01:09 AM.
Quote

Bomb Bloke's Photo Bomb Bloke 03 Dec 2015

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.
Quote

apemanzilla's Photo apemanzilla 03 Dec 2015

 Bomb Bloke, on 03 December 2015 - 01:51 AM, said:

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.
Quote

Exerro's Photo Exerro 04 Dec 2015

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.
Quote

apemanzilla's Photo apemanzilla 04 Dec 2015

 Exerro, on 04 December 2015 - 02:01 PM, said:

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.
Quote

D4rkSol1tud3's Photo D4rkSol1tud3 25 Dec 2015

This is amazing, very well done. I wish the built in way was something like this.
Quote

apemanzilla's Photo apemanzilla 28 Dec 2015

 D4rkSol1tud3, on 25 December 2015 - 12:45 PM, said:

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 :)
Quote

gScottSingleton's Photo gScottSingleton 08 Mar 2016

I absolutely <heart> this!

a table browser to call those functions and review results would be uber-fabulous.
Quote

Konlab's Photo Konlab 25 Mar 2016

What is the license for redistributing a modified version?
Quote

apemanzilla's Photo apemanzilla 29 Mar 2016

 Konlab, on 25 March 2016 - 09:07 AM, said:

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 by apemanzilla, 29 March 2016 - 02:10 AM.
Quote