+ Reply to Thread
Results 1 to 3 of 3

Thread: RIFT API Documentation

  1. #1
    Shadowlander GreenZomie's Avatar
    Join Date
    Sep 2018
    Posts
    34

    Default RIFT API Documentation

    I feel many years late to the party, but while there are some wikis about that seemed to make a stab at documenting the Rift Addon API, I can't seem to find a good source of documentation outside of the built in `Inspect.Documentation` API. So, I got Igor to produce me ALL the documentation in a nice `markdown` ready format.

    If you want some of this goodness yourself then there is some software you will need:

    Code
    * Site: https://code.visualstudio.com/
    If you are not using this as your general purpose text/script editor then you are missing out.

    Node.js
    * Site: https://nodejs.org/en/
    Node now installs with Node Package Manager (npm) which we will use to setup a localhost http server for MDWiki

    http-server
    Site: https://www.npmjs.com/package/http-server
    This is installed from the command line:

    npm install http-server -g

    MdWiki
    Site: http://www.mdwiki.info
    This is a brutally simple markdown wiki. All it consists of is one self contained html file.
    Download the mdwiki.html file is all you need. Or everything and read the docs if locally hosting a markdown wiki is something that suddenly appeals.

    Get MDWiki going
    Create a folder somewhere to hold the RIFT API documentation.
    Inside that folder create a folder called public and copy the mdwiki.html file into that folder.
    In the base folder place a shell script or cmd file:

    http-server

    In the public folder create a file called `index.md` an put some text in it. "# Hello" or some such.
    Now if you open a tab in your browser and navigate to `http://localhost:8080/mdwiki.html` you should see the text you just entered.

    Igor
    * Site: https://github.com/chrisbecke/Igor
    Igor is a Rift Addon. I hope you know how to install it: Download as Zip will give a zip file you can extract directly in your Addons folder like normal, but the resulting folder name will be a little more unique than normal. No matter...

    Now start Rift and check that the addons include Igor.
    Check that there is no log.txt file in your Documents/RIFT folder.
    Enter the commands

    /log
    /igor dumpall md
    /log

    This will turn logging on. Get Igor to write all the docs it can find to the console (to be logged), and then turn logging off. Hopefully there wont be chat interleaved with the documentation.

    Now open the log.txt file in Code and use its Find Text regex mode to delete the first 16 or 17 characters at the start of every line (16 in the mornings, 17 after 10am) and manually trim any other extraneous rubbish that made it in.

    ^(.{0,16})


    and save the resulting file as 'api.md` in the `public` folder you created way above.
    Redirect your browser to `http://localhost:8080/mdwiki.html#!api.md` and you should - after a moment - have all the RIFT Addon API documents available, nicely formatted and searchable in a single page.
    Last edited by GreenZomie; 10-05-2018 at 05:51 AM.

  2. #2
    Ascendant forbiddenlake's Avatar
    Join Date
    Jun 2013
    Posts
    5,706

    Default

    This is neat. "Download as ZIP" to get Igor.

    Is this what you're looking for? https://www.seebs.net/rift/live/index.html
    I don't know if he keeps it up to date though

  3. #3
    Shadowlander GreenZomie's Avatar
    Join Date
    Sep 2018
    Posts
    34

    Default

    Quote Originally Posted by forbiddenlake View Post
    This is neat. "Download as ZIP" to get Igor.

    Is this what you're looking for? https://www.seebs.net/rift/live/index.html
    I don't know if he keeps it up to date though
    Oh! Seebs beat me to it. Not at all surprising. I see he also has sone type inference stuff going on that I didn't get by enumerating the documentation tables directly... I don't know if I perhaps missed something - but I think I can enhance my output now using Inspector.Type to actually map return types.

    Ironically this whole project is just the indirect outcome of me trying to get quality documentation together so I could work on the addon I actually wanted to make. As it stands I am at an ironic impasse because as it turns out, slash commands run from macros run from buttons don't have access to the hardware event anymore as some part of that pipeline already ate it so Im going to have to pivot from making things that can be added to the normal UI using macros to using my own UI.

    At any rate, all Igor does atm really is provide ways for me to look at live lua objects by name, list and print docs to the console, and prepare a markdown dump of the whole lot.
    It would be really nice if, on the test server or in some kind of sandboxed way, I could use the lua file io libraries.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts