API Definition¶
CLI¶
-
build-r RAMLFILE¶ Command-line function to build HTML documentation off of a given RAML file.
-
-oOUTPUT,--outputOUTPUT¶ Specify where to output the built HTML files. If not given, then
outputfrom the giving config file will be used. If not defined in output, then a directory namedoutputwill be created in the relative location that the command is ran.
-
-cCONFIGFILE,--configCONFIGFILE¶ A
yamlconfiguration file for the documentation generator. See Configuration for more information.If no config file is provided,
griffinwill look for a file calledgriffin.yamlby default within the same directory that thebuildcommand is run.
-
-RRAMLCONFIGFILE,--ramlconfigRAMLCONFIGFILE¶ A
iniconfiguration 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
dictof 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
foogrouping, with thefooand thefoo/{id}endpoints.
-
endpoints¶ A
listof 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
ramlficationsdocs)
Return type: APIContextobject