@backstage/plugin-techdocs-node 0.0.0-nightly-20220305022735
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1076 -0
- package/README.md +49 -0
- package/dist/index.cjs.js +1674 -0
- package/dist/index.cjs.js.map +1 -0
- package/package.json +81 -0
package/README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# @backstage/plugin-techdocs-node
|
|
2
|
+
|
|
3
|
+
Common node.js functionalities for TechDocs, to be shared between techdocs-backend plugin and techdocs-cli
|
|
4
|
+
|
|
5
|
+
This package is used by `techdocs-backend` to serve docs from different types of publishers (Google GCS, Local, etc.).
|
|
6
|
+
It is also used to build docs and publish them to storage, by both `techdocs-backend` and `techdocs-cli`.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
Create a preparer instance from the [preparers available](/plugins/techdocs-node/src/stages/prepare) at which takes an Entity instance.
|
|
11
|
+
Run the [docs generator](/plugins/techdocs-node/src/stages/generate) on the prepared directory.
|
|
12
|
+
Publish the generated directory files to a [storage](/plugins/techdocs-node/src/stages/publish) of your choice.
|
|
13
|
+
|
|
14
|
+
Example:
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
async () => {
|
|
18
|
+
const preparedDir = await preparer.prepare(entity);
|
|
19
|
+
|
|
20
|
+
const parsedLocationAnnotation = getLocationForEntity(entity);
|
|
21
|
+
const { resultDir } = await generator.run({
|
|
22
|
+
directory: preparedDir,
|
|
23
|
+
dockerClient: dockerClient,
|
|
24
|
+
parsedLocationAnnotation,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
await publisher.publish({
|
|
28
|
+
entity: entity,
|
|
29
|
+
directory: resultDir,
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Features
|
|
35
|
+
|
|
36
|
+
Currently the build process is split up in these three stages.
|
|
37
|
+
|
|
38
|
+
- Preparers
|
|
39
|
+
- Generators
|
|
40
|
+
- Publishers
|
|
41
|
+
|
|
42
|
+
Preparers read your entity data and creates a working directory with your documentation source code. For example if you have set your `backstage.io/techdocs-ref` to `url:https://github.com/backstage/backstage.git` it will clone that repository to a temp folder and pass that on to the generator.
|
|
43
|
+
|
|
44
|
+
Generators takes the prepared source and runs the `techdocs-container` on it. It then passes on the output folder of that build to the publisher.
|
|
45
|
+
|
|
46
|
+
Publishers gets a folder path from the generator and publish it to your storage solution. Read documentation to know more about configuring storage solutions.
|
|
47
|
+
http://backstage.io/docs/features/techdocs/configuration
|
|
48
|
+
|
|
49
|
+
Any of these can be extended. We want to extend our support to most of the storage providers (Publishers) and source code host providers (Preparers).
|