API Definition

CLI

build -r RAMLFILE

Command-line function to build HTML documentation off of a given RAML file.

-o OUTPUT, --output OUTPUT

Specify where to output the built HTML files. If not given, then output from the giving config file will be used. If not defined in output, then a directory named output will be created in the relative location that the command is ran.

-c CONFIGFILE, --config CONFIGFILE

A yaml configuration file for the documentation generator. See Configuration for more information.

If no config file is provided, griffin will look for a file called griffin.yaml by default within the same directory that the build command is run.

-R RAMLCONFIGFILE, --ramlconfig RAMLCONFIGFILE

A ini configuration file for parsing RAML. See the ramlfications documentation for more information.

-q, --quiet

Suppress output.

griffin.cli.build(ramlfile, config, output=None, ramlconfig=None)

Builds HTML templates from a RAML file and saves to desired output.

Parameters:
  • ramlfile (str) – path to raml file
  • config (dict) – documentation config
  • output (str) – output of HTML files
  • ramlconfig (str) –

    configuration for RAML parsing. See ramlfications documentation for more information.

Core

class griffin.core.APIContext

Context object of the parsed API.

api

The API parsed by ramlfications.

metadata

Metadata about the API.

groupings

A dict of groups of endpoints, defined by their parent nodes. For example,:

/foo
    displayName: Foo
    description: a foo endpoint
    get:
    /{id}
        displayName: A single Foo
        description: A particular Foo
        get:

There would be a foo grouping, with the foo and the foo/{id} endpoints.

endpoints

A list of all parsed endpoints.

griffin.core.create_context(ramlfile, ramlconfig=None)

Returns context to populate templates.

Parameters:
  • ramlfile (str) – RAML file to parse
  • ramlconfig (str) – config file for RAML (see ramlfications docs)
Return type:

APIContext object