Plugin API effecting all the instances of the officegen object.
Methods
-
staticmodule:lib/basicgen.plugins.getDocTypeByName(typeName)
-
Get a document type object by name.
This method get a document type object.Name Type Description typeNamestring The name of the document type. Returns:
The plugin object of the document type. -
staticmodule:lib/basicgen.plugins.getPrototypeByName(typeName)
-
Get a document prototype object by name.
This method get a prototype object.Name Type Description typeNamestring The name of the prototype object. Returns:
The prototype plugin object. -
staticmodule:lib/basicgen.plugins.registerDocType(typeName, createFunc, schema_data, docType, displayName)
-
Register a new type of document that we can generate.
This method registering a new type of document that we can generate. You can extend officegen to support any type of document that based on resources files inside ZIP stream.Name Type Description typeNamestring The type of the document file. createFuncfunction The function to use to create this type of file. schema_dataobject Information needed by Schema-API to generate this kind of document. docTypestring Document type. displayNamestring The display name of this type. -
staticmodule:lib/basicgen.plugins.registerParserType(typeName, parserFunc, extra_data, displayName)
-
Register a new resource parser.
This method registering a new resource parser. One use of this feature is in case that you are developing a new type of document and you want to extend officegen to use some kind of template engine as jade, ejs, haml* or CoffeeKup. In this case you can use a template engine to generate one or more of the resources inside the output archive. Another use of this method is to replace an existing plugin with different implementation.Name Type Description typeNamestring The type of the parser plugin. parserFuncfunction The resource generating function. extra_dataobject Optional additional data that may be required by the parser function. displayNamestring The display name of this type. -
staticmodule:lib/basicgen.plugins.registerPrototype(typeName, baseObj, displayName)
-
Register a document prototype object.
This method registering a prototype document object. You can place all the common code needed by a group of document types in a single prototype object.Name Type Description typeNamestring The name of the prototype object. baseObjobject The prototype object. displayNamestring The display name of this type.