Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
b8678cd808 | |||
4f25981183 | |||
81a5f87eb7 | |||
dd3c4860a0 |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@gitzone/tsdoc",
|
"name": "@gitzone/tsdoc",
|
||||||
"version": "1.0.5",
|
"version": "1.0.7",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@gitzone/tsdoc",
|
"name": "@gitzone/tsdoc",
|
||||||
"version": "1.0.5",
|
"version": "1.0.7",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "a tool for better documentation",
|
"description": "a tool for better documentation",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
@ -1,10 +1,38 @@
|
|||||||
import * as plugins from './tsdoc.plugins';
|
import * as plugins from './tsdoc.plugins';
|
||||||
|
import * as paths from './tsdoc.paths';
|
||||||
|
|
||||||
export class MkDocs {
|
export class MkDocs {
|
||||||
|
public smartshellInstance = new plugins.smartshell.Smartshell({
|
||||||
|
executor: 'bash',
|
||||||
|
pathDirectories: [paths.binDir]
|
||||||
|
});
|
||||||
|
|
||||||
public static async isMkDocsDir(dirPathArg: string): Promise<boolean> {
|
public static async isMkDocsDir(dirPathArg: string): Promise<boolean> {
|
||||||
const result = await plugins.smartfile.fs.fileExists(
|
const result = await plugins.smartfile.fs.fileExists(
|
||||||
plugins.path.join(dirPathArg, 'mkdocs.yml')
|
plugins.path.join(dirPathArg, 'mkdocs.yml')
|
||||||
);
|
);
|
||||||
return !result;
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Instance
|
||||||
|
public typedocDirectory: string;
|
||||||
|
constructor(dirPathArg) {
|
||||||
|
this.typedocDirectory = dirPathArg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async update () {
|
||||||
|
await this.smartshellInstance.exec(`docker pull registry.gitlab.com/hosttoday/ht-docker-mkdocs`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async compile () {
|
||||||
|
await this.update();
|
||||||
|
await this.smartshellInstance.exec(`rm -rf public/`);
|
||||||
|
await this.smartshellInstance.exec(`docker run --rm -it -p 8000:8000 -v ${paths.cwd}:/docs registry.gitlab.com/hosttoday/ht-docker-mkdocs build`);
|
||||||
|
await this.smartshellInstance.exec(`gitzone commit`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async serve () {
|
||||||
|
await this.update();
|
||||||
|
await this.smartshellInstance.exec(`docker run --rm -it -p 8000:8000 -v ${paths.cwd}:/docs registry.gitlab.com/hosttoday/ht-docker-mkdocs`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user