writr 1.7.1 → 1.8.6
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/README.md +18 -4
- package/bin/writr +1 -5
- package/dist/cache.js +0 -2
- package/dist/cache.js.map +1 -1
- package/dist/config.d.ts +4 -1
- package/dist/config.js +6 -2
- package/dist/config.js.map +1 -1
- package/dist/data/dataService.js +7 -9
- package/dist/data/dataService.js.map +1 -1
- package/dist/data/fileDataProvider.js +14 -12
- package/dist/data/fileDataProvider.js.map +1 -1
- package/dist/generator.d.ts +8 -0
- package/dist/generator.js +58 -0
- package/dist/generator.js.map +1 -0
- package/dist/index.d.ts +1 -4
- package/dist/index.js +72 -57
- package/dist/index.js.map +1 -1
- package/dist/log.d.ts +6 -0
- package/dist/log.js +17 -0
- package/dist/log.js.map +1 -0
- package/dist/migrate/ghostMigrationProvider.d.ts +9 -0
- package/dist/migrate/ghostMigrationProvider.js +67 -0
- package/dist/migrate/ghostMigrationProvider.js.map +1 -0
- package/dist/migrate/jekyllMigrationProvider.d.ts +4 -0
- package/dist/migrate/jekyllMigrationProvider.js +15 -0
- package/dist/migrate/jekyllMigrationProvider.js.map +1 -0
- package/dist/migrate/mediumMigrationProvider.d.ts +7 -0
- package/dist/migrate/mediumMigrationProvider.js +30 -0
- package/dist/migrate/mediumMigrationProvider.js.map +1 -0
- package/dist/migrate/migrationProviderInterface.d.ts +3 -0
- package/dist/migrate/migrationProviderInterface.js +3 -0
- package/dist/migrate/migrationProviderInterface.js.map +1 -0
- package/dist/migrate/wordpressMigrationProvider.d.ts +12 -0
- package/dist/migrate/wordpressMigrationProvider.js +105 -0
- package/dist/migrate/wordpressMigrationProvider.js.map +1 -0
- package/dist/migrate.d.ts +6 -0
- package/dist/migrate.js +38 -0
- package/dist/migrate.js.map +1 -0
- package/dist/post.js +2 -4
- package/dist/post.js.map +1 -1
- package/dist/render/atomRenderProvider.js +3 -3
- package/dist/render/atomRenderProvider.js.map +1 -1
- package/dist/render/htmRenderlProvider.js +12 -12
- package/dist/render/htmRenderlProvider.js.map +1 -1
- package/dist/render/imageRenderProvider.js +3 -3
- package/dist/render/imageRenderProvider.js.map +1 -1
- package/dist/render/jsonRenderProvider.js +4 -6
- package/dist/render/jsonRenderProvider.js.map +1 -1
- package/dist/serve.d.ts +16 -0
- package/dist/serve.js +33 -0
- package/dist/serve.js.map +1 -0
- package/dist/storage/fileStorageProvider.d.ts +2 -3
- package/dist/storage/fileStorageProvider.js +12 -22
- package/dist/storage/fileStorageProvider.js.map +1 -1
- package/dist/storage/storageProviderInterface.d.ts +1 -0
- package/dist/storage/storageService.d.ts +3 -4
- package/dist/storage/storageService.js +5 -3
- package/dist/storage/storageService.js.map +1 -1
- package/dist/tag.js +3 -4
- package/dist/tag.js.map +1 -1
- package/dist/utils/parser.d.ts +5 -0
- package/dist/utils/parser.js +41 -0
- package/dist/utils/parser.js.map +1 -0
- package/dist/utils/setup.d.ts +8 -0
- package/dist/utils/setup.js +79 -0
- package/dist/utils/setup.js.map +1 -0
- package/init/article-complex.md +40 -0
- package/init/article-ejs.md +40 -0
- package/init/article-unpublished.md +11 -0
- package/init/article1-simple.md +13 -0
- package/init/article1.md +11 -0
- package/init/article2.md +14 -0
- package/init/big-content.md +11 -0
- package/init/config.json +9 -0
- package/init/images/Introducing Docula 1.png +0 -0
- package/init/images/Introducing Docula 2.jpeg +0 -0
- package/init/images/Introducing Docula 3.png +0 -0
- package/init/images/Introducing Docula 4.png +0 -0
- package/init/permalink-test.md +13 -0
- package/init/templates/index.hjs +13 -0
- package/init/templates/partials/header.hjs +2 -0
- package/init/templates/post.hjs +19 -0
- package/init/templates/post2.hjs +17 -0
- package/init/templates/post3.ejs +7 -0
- package/init/templates/tag.hjs +9 -0
- package/package.json +25 -19
package/dist/serve.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Serve = void 0;
|
|
4
|
+
const browserSync = require("browser-sync");
|
|
5
|
+
const generator_1 = require("./generator");
|
|
6
|
+
class Serve {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
this.bs = browserSync.create();
|
|
9
|
+
this.params = options.opts();
|
|
10
|
+
this.generator = new generator_1.SiteGenerator(options);
|
|
11
|
+
}
|
|
12
|
+
async buildAndReload() {
|
|
13
|
+
await this.generator.run();
|
|
14
|
+
this.bs.reload();
|
|
15
|
+
}
|
|
16
|
+
run() {
|
|
17
|
+
const { output, port, watch, path } = this.params;
|
|
18
|
+
const baseDir = `${process.cwd()}/${output}`;
|
|
19
|
+
if (watch) {
|
|
20
|
+
this.bs.watch(`${process.cwd()}/${path}/*.md`, async () => await this.buildAndReload());
|
|
21
|
+
}
|
|
22
|
+
this.bs.init({
|
|
23
|
+
server: {
|
|
24
|
+
baseDir,
|
|
25
|
+
},
|
|
26
|
+
ui: false,
|
|
27
|
+
logPrefix: "Writr",
|
|
28
|
+
port: parseInt(port),
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.Serve = Serve;
|
|
33
|
+
//# sourceMappingURL=serve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../src/serve.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,2CAA0C;AAS1C,MAAa,KAAK;IAMjB,YAAY,OAAY;QACvB,IAAI,CAAC,EAAE,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,IAAI,yBAAa,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,cAAc;QACnB,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC;QAC3B,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC;IAClB,CAAC;IAED,GAAG;QACF,MAAM,EAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAChD,MAAM,OAAO,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,IAAI,MAAM,EAAE,CAAC;QAE7C,IAAG,KAAK,EAAE;YACT,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,IAAI,IAAI,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;SACxF;QAED,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC;YACZ,MAAM,EAAE;gBACP,OAAO;aACP;YACD,EAAE,EAAE,KAAK;YACT,SAAS,EAAE,OAAO;YAClB,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;SACpB,CAAC,CAAC;IACJ,CAAC;CAED;AAnCD,sBAmCC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { StorageProviderInterface } from "
|
|
1
|
+
import { StorageProviderInterface } from "./storageProviderInterface";
|
|
2
2
|
export declare class FileStorageProvider implements StorageProviderInterface {
|
|
3
|
-
log: any;
|
|
4
|
-
constructor();
|
|
5
3
|
get(path: string): Promise<string | undefined>;
|
|
6
4
|
set(path?: string, data?: string): Promise<boolean>;
|
|
7
5
|
delete(path: string): Promise<boolean>;
|
|
8
6
|
copy(src: string, dest: string): Promise<boolean>;
|
|
9
7
|
exists(path: string): Promise<boolean>;
|
|
10
8
|
ensureFilePath(path: string): Promise<void>;
|
|
9
|
+
readDir(path: string): string[];
|
|
11
10
|
}
|
|
@@ -2,11 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FileStorageProvider = void 0;
|
|
4
4
|
const fs = require("fs-extra");
|
|
5
|
-
const
|
|
5
|
+
const log_1 = require("../log");
|
|
6
6
|
class FileStorageProvider {
|
|
7
|
-
constructor() {
|
|
8
|
-
this.log = (0, winston_1.createLogger)({ transports: [new winston_1.transports.Console()] });
|
|
9
|
-
}
|
|
10
7
|
async get(path) {
|
|
11
8
|
let result;
|
|
12
9
|
try {
|
|
@@ -14,24 +11,16 @@ class FileStorageProvider {
|
|
|
14
11
|
result = buffer.toString();
|
|
15
12
|
}
|
|
16
13
|
catch (error) {
|
|
17
|
-
|
|
14
|
+
new log_1.ConsoleMessage().error(error.message);
|
|
18
15
|
}
|
|
19
16
|
return result;
|
|
20
17
|
}
|
|
21
18
|
async set(path, data) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
result = true;
|
|
28
|
-
}
|
|
29
|
-
catch (error) {
|
|
30
|
-
/* istanbul ignore next */
|
|
31
|
-
this.log.error(error);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return result;
|
|
19
|
+
if (!path || !data)
|
|
20
|
+
return false;
|
|
21
|
+
await this.ensureFilePath(path);
|
|
22
|
+
await fs.writeFile(path, data);
|
|
23
|
+
return true;
|
|
35
24
|
}
|
|
36
25
|
async delete(path) {
|
|
37
26
|
let result = false;
|
|
@@ -40,8 +29,7 @@ class FileStorageProvider {
|
|
|
40
29
|
result = true;
|
|
41
30
|
}
|
|
42
31
|
catch (error) {
|
|
43
|
-
|
|
44
|
-
this.log.error(error);
|
|
32
|
+
new log_1.ConsoleMessage().error(error.message);
|
|
45
33
|
}
|
|
46
34
|
return result;
|
|
47
35
|
}
|
|
@@ -53,8 +41,7 @@ class FileStorageProvider {
|
|
|
53
41
|
result = true;
|
|
54
42
|
}
|
|
55
43
|
catch (error) {
|
|
56
|
-
|
|
57
|
-
this.log.error(error);
|
|
44
|
+
new log_1.ConsoleMessage().error(error.message);
|
|
58
45
|
}
|
|
59
46
|
return result;
|
|
60
47
|
}
|
|
@@ -71,6 +58,9 @@ class FileStorageProvider {
|
|
|
71
58
|
let dir = pathList.join("/");
|
|
72
59
|
await fs.ensureDir(dir);
|
|
73
60
|
}
|
|
61
|
+
readDir(path) {
|
|
62
|
+
return fs.readdirSync(path);
|
|
63
|
+
}
|
|
74
64
|
}
|
|
75
65
|
exports.FileStorageProvider = FileStorageProvider;
|
|
76
66
|
//# sourceMappingURL=fileStorageProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileStorageProvider.js","sourceRoot":"","sources":["../../src/storage/fileStorageProvider.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;
|
|
1
|
+
{"version":3,"file":"fileStorageProvider.js","sourceRoot":"","sources":["../../src/storage/fileStorageProvider.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAE/B,gCAAwC;AAExC,MAAa,mBAAmB;IAE5B,KAAK,CAAC,GAAG,CAAC,IAAY;QAClB,IAAI,MAA0B,CAAC;QAE/B,IAAI;YACA,IAAI,MAAM,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrC,MAAM,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;SAC9B;QAAC,OAAO,KAAU,EAAE;YACjB,IAAI,oBAAc,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;SAC7C;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,IAAa,EAAE,IAAa;QAClC,IAAG,CAAC,IAAI,IAAI,CAAC,IAAI;YAAG,OAAO,KAAK,CAAC;QACjC,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAChC,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC/B,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,IAAY;QACrB,IAAI,MAAM,GAAG,KAAK,CAAC;QAEnB,IAAI;YACA,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACtB,MAAM,GAAG,IAAI,CAAC;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} from "../config";
|
|
1
|
+
import { StorageProviderInterface } from "./storageProviderInterface";
|
|
3
2
|
export declare class StorageService implements StorageProviderInterface {
|
|
4
|
-
config: Config;
|
|
5
3
|
provider: StorageProviderInterface;
|
|
6
|
-
constructor(
|
|
4
|
+
constructor();
|
|
7
5
|
get(path: string): Promise<string | undefined>;
|
|
8
6
|
set(path: string, data: string): Promise<boolean>;
|
|
9
7
|
delete(path: string): Promise<boolean>;
|
|
10
8
|
exists(path: string): Promise<boolean>;
|
|
11
9
|
copy(src: string, dest: string): Promise<boolean>;
|
|
12
10
|
getProvider(): StorageProviderInterface;
|
|
11
|
+
readDir(path: string): string[];
|
|
13
12
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StorageService = void 0;
|
|
4
|
-
const fileStorageProvider_1 = require("
|
|
4
|
+
const fileStorageProvider_1 = require("./fileStorageProvider");
|
|
5
5
|
class StorageService {
|
|
6
|
-
constructor(
|
|
7
|
-
this.config = config;
|
|
6
|
+
constructor() {
|
|
8
7
|
this.provider = new fileStorageProvider_1.FileStorageProvider();
|
|
9
8
|
}
|
|
10
9
|
async get(path) {
|
|
@@ -25,6 +24,9 @@ class StorageService {
|
|
|
25
24
|
getProvider() {
|
|
26
25
|
return this.provider;
|
|
27
26
|
}
|
|
27
|
+
readDir(path) {
|
|
28
|
+
return this.getProvider().readDir(path);
|
|
29
|
+
}
|
|
28
30
|
}
|
|
29
31
|
exports.StorageService = StorageService;
|
|
30
32
|
//# sourceMappingURL=storageService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storageService.js","sourceRoot":"","sources":["../../src/storage/storageService.ts"],"names":[],"mappings":";;;AACA
|
|
1
|
+
{"version":3,"file":"storageService.js","sourceRoot":"","sources":["../../src/storage/storageService.ts"],"names":[],"mappings":";;;AACA,+DAA4D;AAG5D,MAAa,cAAc;IAIvB;QACI,IAAI,CAAC,QAAQ,GAAG,IAAI,yCAAmB,EAAE,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,IAAW;QACjB,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,IAAW,EAAE,IAAW;QAC9B,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC9C,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,IAAW;QACpB,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,IAAW;QACpB,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,GAAU,EAAE,IAAW;QAC9B,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC9C,CAAC;IAED,WAAW;QAEP,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAED,OAAO,CAAC,IAAY;QAChB,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;CACJ;AApCD,wCAoCC"}
|
package/dist/tag.js
CHANGED
|
@@ -9,8 +9,7 @@ class Tag {
|
|
|
9
9
|
this.name = name.trim();
|
|
10
10
|
}
|
|
11
11
|
get id() {
|
|
12
|
-
let result = "";
|
|
13
|
-
result = this.name.toLowerCase().replace(/[^a-z0-9+]+/gi, " ").trim();
|
|
12
|
+
let result = this.name.toLowerCase().replace(/[^a-z0-9+]+/gi, " ").trim();
|
|
14
13
|
result = result.split(" ").join("-");
|
|
15
14
|
return result;
|
|
16
15
|
}
|
|
@@ -19,9 +18,9 @@ class Tag {
|
|
|
19
18
|
result.name = this.name;
|
|
20
19
|
result.id = this.id;
|
|
21
20
|
result.posts = [];
|
|
22
|
-
this.posts
|
|
21
|
+
for (const post of this.posts) {
|
|
23
22
|
result.posts.push(await post.toObject());
|
|
24
|
-
}
|
|
23
|
+
}
|
|
25
24
|
return result;
|
|
26
25
|
}
|
|
27
26
|
static create(obj) {
|
package/dist/tag.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.js","sourceRoot":"","sources":["../src/tag.ts"],"names":[],"mappings":";;;AAAA,iCAA8B;AAE9B,MAAa,GAAG;IAId,YAAY,IAAY;QAHxB,SAAI,GAAW,EAAE,CAAC;QAClB,UAAK,GAAgB,IAAI,KAAK,EAAQ,CAAC;QAGrC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC1B,CAAC;IAED,IAAI,EAAE;
|
|
1
|
+
{"version":3,"file":"tag.js","sourceRoot":"","sources":["../src/tag.ts"],"names":[],"mappings":";;;AAAA,iCAA8B;AAE9B,MAAa,GAAG;IAId,YAAY,IAAY;QAHxB,SAAI,GAAW,EAAE,CAAC;QAClB,UAAK,GAAgB,IAAI,KAAK,EAAQ,CAAC;QAGrC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC1B,CAAC;IAED,IAAI,EAAE;QAEJ,IAAI,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QAC1E,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAErC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,IAAI,MAAM,GAAQ,EAAE,CAAC;QACrB,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACxB,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QACpB,MAAM,CAAC,KAAK,GAAG,EAAE,CAAC;QAElB,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE;YAC7B,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;SAC1C;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,GAAQ;QACpB,IAAI,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAE/B,IAAI,GAAG,CAAC,KAAK,EAAE;YACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACzC,IAAI,CAAC,GAAG,WAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;gBAElC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACtB;SACF;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AA1CD,kBA0CC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Parser = void 0;
|
|
4
|
+
const node_html_markdown_1 = require("node-html-markdown");
|
|
5
|
+
class Parser {
|
|
6
|
+
htmlToMd(html) {
|
|
7
|
+
if (!html)
|
|
8
|
+
return '';
|
|
9
|
+
return new node_html_markdown_1.NodeHtmlMarkdown().translate(html);
|
|
10
|
+
}
|
|
11
|
+
generateMdHeaders({ title, slug, date, categories, tags }) {
|
|
12
|
+
let header = '---\n';
|
|
13
|
+
if (title)
|
|
14
|
+
header += `title: ${title}\n`;
|
|
15
|
+
if (slug)
|
|
16
|
+
header += `url: ${slug}\n`;
|
|
17
|
+
if (date)
|
|
18
|
+
header += `date: ${(new Date(date)).toISOString().slice(0, 10)}\n`;
|
|
19
|
+
if (categories)
|
|
20
|
+
header += `categories: ${typeof categories === 'string' ? categories : categories.join(', ')}\n`;
|
|
21
|
+
if (tags)
|
|
22
|
+
header += `tags: ${typeof tags === 'string' ? tags : tags.join(', ')}\n`;
|
|
23
|
+
header += '---\n\n';
|
|
24
|
+
return header;
|
|
25
|
+
}
|
|
26
|
+
slugify(text) {
|
|
27
|
+
const from = "ãàáäâẽèéëêìíïîõòóöôùúüûñç·/_,:;";
|
|
28
|
+
const to = "aaaaaeeeeeiiiiooooouuuunc------";
|
|
29
|
+
const newText = text.split('').map((letter, i) => letter.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i)));
|
|
30
|
+
return newText
|
|
31
|
+
.toString() // Cast to string
|
|
32
|
+
.toLowerCase() // Convert the string to lowercase letters
|
|
33
|
+
.trim() // Remove whitespace from both sides of a string
|
|
34
|
+
.replace(/\s+/g, '-') // Replace spaces with -
|
|
35
|
+
.replace(/&/g, '-y-') // Replace & with 'and'
|
|
36
|
+
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
|
|
37
|
+
.replace(/\-\-+/g, '-'); // Replace multiple - with single -
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.Parser = Parser;
|
|
41
|
+
//# sourceMappingURL=parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/utils/parser.ts"],"names":[],"mappings":";;;AAAA,2DAAoD;AAEpD,MAAa,MAAM;IAEjB,QAAQ,CAAC,IAAY;QACnB,IAAI,CAAC,IAAI;YAAE,OAAO,EAAE,CAAC;QACrB,OAAO,IAAI,qCAAgB,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAED,iBAAiB,CAAC,EAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAsB;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AAG,CAAC,CAAW,wBAAwB;aACvD,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAW,uBAAuB;aACtD,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAO,4BAA4B;aAC3D,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAQ,mCAAmC;IACvE,CAAC;CAEF;AAtCD,wBAsCC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Setup = void 0;
|
|
4
|
+
const fs = require("fs-extra");
|
|
5
|
+
const inquirer = require("inquirer");
|
|
6
|
+
const parser_1 = require("./parser");
|
|
7
|
+
class Setup {
|
|
8
|
+
constructor(name = 'default') {
|
|
9
|
+
this.name = name;
|
|
10
|
+
this.gitignoreContent = "### Node ###\n" +
|
|
11
|
+
"# Logs\n" +
|
|
12
|
+
"logs\n" +
|
|
13
|
+
"*.log\n" +
|
|
14
|
+
"npm-debug.log*\n" +
|
|
15
|
+
"yarn-debug.log*\n" +
|
|
16
|
+
"yarn-error.log*\n" +
|
|
17
|
+
"lerna-debug.log*\n" +
|
|
18
|
+
"# Dependency directories\n" +
|
|
19
|
+
"node_modules/\n" +
|
|
20
|
+
"jspm_packages/\n" +
|
|
21
|
+
"# Optional npm cache directory\n" +
|
|
22
|
+
".npm\n";
|
|
23
|
+
this.packageJsonContent = {
|
|
24
|
+
name: this.name,
|
|
25
|
+
version: "0.0.1",
|
|
26
|
+
description: "",
|
|
27
|
+
keywords: [],
|
|
28
|
+
license: "ISC",
|
|
29
|
+
author: "",
|
|
30
|
+
scripts: {
|
|
31
|
+
test: "echo \"Error: no test specified\" && exit 1"
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
;
|
|
36
|
+
async init() {
|
|
37
|
+
try {
|
|
38
|
+
fs.mkdirSync(this.name);
|
|
39
|
+
fs.outputFileSync(`./${this.name}/.gitignore`, this.gitignoreContent);
|
|
40
|
+
fs.outputFileSync(`./${this.name}/package.json`, JSON.stringify(this.packageJsonContent, null, 2));
|
|
41
|
+
fs.copySync(`${__dirname}/../../init`, `./${this.name}/blog`);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
throw new Error('Directory already exists');
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
async new() {
|
|
48
|
+
try {
|
|
49
|
+
const questions = [
|
|
50
|
+
{
|
|
51
|
+
name: 'title',
|
|
52
|
+
message: 'What is the title of the post?',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'categories',
|
|
56
|
+
message: 'Please enter the categories of the post separated by commas',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'tags',
|
|
60
|
+
message: 'Please enter the tags of the post separated by commas',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'date',
|
|
64
|
+
message: 'Please enter the date of the post in the format YYYY-MM-DD',
|
|
65
|
+
default: new Date().toLocaleDateString('en-CA'),
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
const response = await inquirer.prompt(questions);
|
|
69
|
+
response.slug = new parser_1.Parser().slugify(response.title);
|
|
70
|
+
const headerContent = new parser_1.Parser().generateMdHeaders(response);
|
|
71
|
+
await fs.outputFileSync(`${response.slug}.md`, headerContent);
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
throw new Error('Error creating new file');
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.Setup = Setup;
|
|
79
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../src/utils/setup.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,qCAAqC;AACrC,qCAAgC;AAEhC,MAAa,KAAK;IAMhB,YAAY,OAAe,SAAS;QAElC,IAAI,CAAC,IAAI,GA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oBACE,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE,uDAAuD;iBACjE;gBACD;oBACE,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE,4DAA4D;oBACrE,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,kBAAkB,CAAC,OAAO,CAAC;iBAChD;aACF,CAAA;YACD,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YAClD,QAAQ,CAAC,IAAI,GAAG,IAAI,eAAM,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAErD,MAAM,aAAa,GAAG,IAAI,eAAM,EAAE,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAA;YAE9D,MAAM,EAAE,CAAC,cAAc,CAAC,GAAG,QAAQ,CAAC,IAAI,KAAK,EAAE,aAAa,CAAC,CAAC;SAE/D;QAAC,OAAO,KAAU,EAAE;YACnB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;SAC5C;IACH,CAAC;CAEF;AAhFD,sBAgFC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Docula: Persistent Links and Styles!'
|
|
3
|
+
tags:
|
|
4
|
+
- Github
|
|
5
|
+
- Open Source
|
|
6
|
+
- Docula
|
|
7
|
+
date: 2017-03-07
|
|
8
|
+
layout: post2
|
|
9
|
+
featured_image: Docula_%20Persistent%20Links%20and%20Styles%201.jpeg
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
## Docula: Persistent Links and Styles!
|
|
15
|
+
|
|
16
|
+
In our last update, we simplified the modules down to two ([docula-ui](https://www.npmjs.com/package/docula-ui), and [docula-core](https://www.npmjs.com/package/docula-core)) and also added In-Memory data stores as the default. Now with this latest update, we made it so that you can do [persistent linking](https://docu.la/docs/article/configuration/deeplinks) and [customize the interface](https://docu.la/docs/article/configuration/customization) it very easily.
|
|
17
|
+
|
|
18
|
+
### Persistent Linking
|
|
19
|
+
|
|
20
|
+
There are many times a document can move around in a GitHub repository, but you want to keep to an URL that works. [Check out how to do it here!](https://docu.la/docs/article/configuration/deeplinks)
|
|
21
|
+
|
|
22
|
+
### Styling! Let’s Get Started
|
|
23
|
+
|
|
24
|
+
The first step is to see how we did this. Since we use [GitHub](https://github.com/) for our knowledge base repository, it made sense to extend the configuration for skinning there. Here is what the [Fons repository](https://github.com/fonsio/public-kb) looks like with the `style.css` and `navigation.html` file in the root.
|
|
25
|
+
|
|
26
|
+

|
|
27
|
+
|
|
28
|
+
The configuration for your [docula-ui](https://www.npmjs.com/package/docula-ui) is easy to do the config. You will want to add in the style.css path and navigation.html path. Also, if you have a customized logo, you can do that. Here is an example that we use for Fons.
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
Docula.install(app, '/help', {git: 'https://github.com/fonsio/public-kb.git',pageTitle: 'Fons',logo: 'https://fons.io/n/img/fons-logo-300x85.png',redis: redisConfig(),elasticsearch: elasticConfig(),topNavigation: 'navigation.html',cssTheme: 'theme.scss'});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Yep, its as simple as that and you can see the style.css and navigation.html examples here: [https://github.com/fonsio/public-kb](https://github.com/fonsio/public-kb)
|
|
35
|
+
|
|
36
|
+
<div>
|
|
37
|
+
<p>foo</p>
|
|
38
|
+
</div>
|
|
39
|
+
***Happy Styling!***
|
|
40
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Docula: EJS Style'
|
|
3
|
+
tags:
|
|
4
|
+
- Github
|
|
5
|
+
- Open Source
|
|
6
|
+
- Docula
|
|
7
|
+
date: 2017-03-07
|
|
8
|
+
layout: post3
|
|
9
|
+
featured_image: Docula_%20Persistent%20Links%20and%20Styles%201.jpeg
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
## Docula: Persistent Links and Styles!
|
|
15
|
+
|
|
16
|
+
In our last update, we simplified the modules down to two ([docula-ui](https://www.npmjs.com/package/docula-ui), and [docula-core](https://www.npmjs.com/package/docula-core)) and also added In-Memory data stores as the default. Now with this latest update, we made it so that you can do [persistent linking](https://docu.la/docs/article/configuration/deeplinks) and [customize the interface](https://docu.la/docs/article/configuration/customization) it very easily.
|
|
17
|
+
|
|
18
|
+
### Persistent Linking
|
|
19
|
+
|
|
20
|
+
There are many times a document can move around in a GitHub repository, but you want to keep to an URL that works. [Check out how to do it here!](https://docu.la/docs/article/configuration/deeplinks)
|
|
21
|
+
|
|
22
|
+
### Styling! Let’s Get Started
|
|
23
|
+
|
|
24
|
+
The first step is to see how we did this. Since we use [GitHub](https://github.com/) for our knowledge base repository, it made sense to extend the configuration for skinning there. Here is what the [Fons repository](https://github.com/fonsio/public-kb) looks like with the `style.css` and `navigation.html` file in the root.
|
|
25
|
+
|
|
26
|
+

|
|
27
|
+
|
|
28
|
+
The configuration for your [docula-ui](https://www.npmjs.com/package/docula-ui) is easy to do the config. You will want to add in the style.css path and navigation.html path. Also, if you have a customized logo, you can do that. Here is an example that we use for Fons.
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
Docula.install(app, '/help', {git: 'https://github.com/fonsio/public-kb.git',pageTitle: 'Fons',logo: 'https://fons.io/n/img/fons-logo-300x85.png',redis: redisConfig(),elasticsearch: elasticConfig(),topNavigation: 'navigation.html',cssTheme: 'theme.scss'});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Yep, its as simple as that and you can see the style.css and navigation.html examples here: [https://github.com/fonsio/public-kb](https://github.com/fonsio/public-kb)
|
|
35
|
+
|
|
36
|
+
<div>
|
|
37
|
+
<p>foo</p>
|
|
38
|
+
</div>
|
|
39
|
+
***Happy Styling!***
|
|
40
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Article Simple'
|
|
3
|
+
date: 2018-15-01
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+

|
|
7
|
+
|
|
8
|
+
## Docula: Persistent Links and Styles!
|
|
9
|
+
|
|
10
|
+
In our last update, we simplified the modules down to two (<u>[docula-ui](https://www.npmjs.com/package/docula-ui)</u>, and <u>[docula-core](https://www.npmjs.com/package/docula-core))</u> and also added In-Memory data stores as the default. Now with this latest update, we made it so that you can do <u>[persistent linking](https://docu.la/docs/article/configuration/deeplinks)</u> and <u>[customize the interface](https://docu.la/docs/article/configuration/customization)</u> it very easily.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
package/init/article1.md
ADDED
package/init/article2.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Tesla Model 3
|
|
3
|
+
author: Elon Musk
|
|
4
|
+
url: all-about-the-tesla-model-3
|
|
5
|
+
date: 2016-08-12
|
|
6
|
+
publishedAt: 6/25/2017
|
|
7
|
+
keywords: tesla, model 3, elon, musk
|
|
8
|
+
categories: muskified, nice3
|
|
9
|
+
tags: tesla, model 3,Whale,cool
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
How now brown cow.
|
|
13
|
+
|
|
14
|
+
This is how we do it
|
package/init/config.json
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 'Article Perm'
|
|
3
|
+
date: 2018-12-04
|
|
4
|
+
permalink: '/foo/crazy/url/article-perm'
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
## Getting Persistent links in a blog document is critical
|
|
10
|
+
|
|
11
|
+
In our last update, we simplified the modules down to two (<u>[docula-ui](https://www.npmjs.com/package/docula-ui)</u>, and <u>[docula-core](https://www.npmjs.com/package/docula-core))</u> and also added In-Memory data stores as the default. Now with this latest update, we made it so that you can do <u>[persistent linking](https://docu.la/docs/article/configuration/deeplinks)</u> and <u>[customize the interface](https://docu.la/docs/article/configuration/customization)</u> it very easily.
|
|
12
|
+
|
|
13
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{{#each posts}}
|
|
2
|
+
<p>{{formatDate date "MM/DD/YYYY"}}</p>
|
|
3
|
+
<p><a href="{{url}}">{{title}} - {{author}}</a></p>
|
|
4
|
+
{{/each}}
|
|
5
|
+
|
|
6
|
+
<p>Tags: <br />
|
|
7
|
+
<ul>
|
|
8
|
+
{{#each tags}}
|
|
9
|
+
<li><a href="{{id}}">{{name}}</a></li>{{/each}}
|
|
10
|
+
</ul>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
{{formatDate "" "YYYY"}}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<h1>Post</h1>
|
|
2
|
+
|
|
3
|
+
{{> header}}
|
|
4
|
+
|
|
5
|
+
<p>{{post.title}}</p>
|
|
6
|
+
<p>{{post.author}}</p>
|
|
7
|
+
<p>{{{post.body}}}</p>
|
|
8
|
+
|
|
9
|
+
<p>{{post.matter.featured_image}}</p>
|
|
10
|
+
|
|
11
|
+
<p>{{previousPost.id}}</p>
|
|
12
|
+
<p>{{nextPost.id}}</p>
|
|
13
|
+
|
|
14
|
+
<h1>Tags</h1>
|
|
15
|
+
<ul>
|
|
16
|
+
{{#each tags}}
|
|
17
|
+
<li>{{name}}</li>
|
|
18
|
+
{{/each}}
|
|
19
|
+
</ul>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<h1>Post 2</h1>
|
|
2
|
+
|
|
3
|
+
<p>{{post.title}}</p>
|
|
4
|
+
<p>{{post.author}}</p>
|
|
5
|
+
<p>{{{post.body}}}</p>
|
|
6
|
+
|
|
7
|
+
<p>{{post.matter.featured_image}}</p>
|
|
8
|
+
|
|
9
|
+
<p>{{previousPost.id}}</p>
|
|
10
|
+
<p>{{nextPost.id}}</p>
|
|
11
|
+
|
|
12
|
+
<h1>Tags</h1>
|
|
13
|
+
<ul>
|
|
14
|
+
{{#each tags}}
|
|
15
|
+
<li>{{name}}</li>
|
|
16
|
+
{{/each}}
|
|
17
|
+
</ul>
|