Skip to content

Instantly share code, notes, and snippets.

@hishnash
Created April 27, 2017 07:51
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hishnash/43fedeb24db39e0f9ae9f3b777427cd3 to your computer and use it in GitHub Desktop.
Save hishnash/43fedeb24db39e0f9ae9f3b777427cd3 to your computer and use it in GitHub Desktop.

Documentation Engine Demo

This is a demo of how our documentation engine to see the real Paw docs go to Paw Docs

  • Paw Docs Engine demo

A Tile Component

We can put some txt here... But really we can put any content we want.

A list

  • These items
  • are normal
  • Used to link to other doc pages

But we could also put anythign inside here.

function evaluate(context){
    return 1 // a code snippet
};

Another tile

We auto group tiles in react at render time. So that if these tiles are in sequence they will end up in a parent container.


We really can use any markup inside these items it just renders the children.

For example and image banner.

Tiles are not the only custom item we have

Dynamic values have a dedicated UI item

Visual Tab

Not all custom directives need a dedicated react component, for example this dvvis is a subclass of our tab component. For React this means we have no custom code for dvvis the only custom code is on the sphinx gen side.Not all custom directives need a dedicated react component, for example this dvvis is a subclass of our tab component. For React this means we have no custom code for dvvis the only custom code is on the sphinx gen side.

The Code Tab however has a lot of dedicated layout info, the data defined here is passed to the AST as config.

Code Tab

username

The username.

password

The password.

charset

The charset used for encoding.

function evaluate(context){
    var dv = new DynamicValue('com.luckymarmot.BasicAuthDynamicValue', {
        username: 'john.appleseed',
        password: 'myOwnSuperSecretPassword'
    });
    return dv.getEvaluatedString();
};

A custom tab

Since the dv is just a subclass of of a tabbed view.

We also have tutorial step

Like tiles these will auto join up if in sequence

By auto joining sequence tstep components we are able to dynamically inject step numbers.

As with tiles we can put anything in here.

readFile

Specification

filename

relative path to file

string

files data read as a string

It may be handy to store files in your Extension directory, and then read their content from your script (e.g. for templates). Use the readFile() function for that purpose.

Another step to our tutorial

Not shown here but our docs can also auto get a list of items on the page and a see also list shown on the right hand side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment