Diplodoc extensions
Extensions are designed to add new capabilities to Diplodoc's functionality.
Installation
Before using an extension, it must be loaded. This can be done using npm via the command npm install ... or by saving the extension files locally, which is also suitable for using custom-developed extensions.
Example — installing an extension for connecting Algolia:
npm install @diplodoc/algolia-extension
Connection
You can connect an extension to a project in one of two ways:
- By specifying it in the project's
.yfmfile in the parameter extensions:extensions: - @diplodoc/algolia-extension - /local/path/to/extension - By passing it via the
-eparameter when callingyfm:yfm build -e @diplodoc/algolia-extension
Note
If an extension is specified for connection but is unavailable, the yfm command will be executed with an error.
If an extension is not connected when running the yfm command, but is necessary for correct project processing, the yfm command may be executed with a correct response code, but with an unpredictable result.
Built-in extensions
Diplodoc includes several extensions as examples of the Extensions API:
|
Name |
Description |
|
|
Retrieves information about the modification date and authors from a Github repository when building a project for placement in article content. |
|
|
Adds additional plugins to the markdown-it parser to expand documentation markup capabilities. |