writr 1.6.9 → 1.8.0
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/bin/writr +7 -3
- 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 +23 -18
- package/dist/cache.d.ts +0 -18
- package/dist/cache.js +0 -76
- package/dist/cache.js.map +0 -1
- package/dist/config.d.ts +0 -26
- package/dist/config.js +0 -105
- package/dist/config.js.map +0 -1
- package/dist/data/dataProviderInterface.d.ts +0 -12
- package/dist/data/dataProviderInterface.js +0 -3
- package/dist/data/dataProviderInterface.js.map +0 -1
- package/dist/data/dataService.d.ts +0 -19
- package/dist/data/dataService.js +0 -139
- package/dist/data/dataService.js.map +0 -1
- package/dist/data/fileDataProvider.d.ts +0 -20
- package/dist/data/fileDataProvider.js +0 -134
- package/dist/data/fileDataProvider.js.map +0 -1
- package/dist/index.d.ts +0 -11
- package/dist/index.js +0 -69
- package/dist/index.js.map +0 -1
- package/dist/post.d.ts +0 -31
- package/dist/post.js +0 -195
- package/dist/post.js.map +0 -1
- package/dist/render/atomRenderProvider.d.ts +0 -8
- package/dist/render/atomRenderProvider.js +0 -55
- package/dist/render/atomRenderProvider.js.map +0 -1
- package/dist/render/htmRenderlProvider.d.ts +0 -14
- package/dist/render/htmRenderlProvider.js +0 -119
- package/dist/render/htmRenderlProvider.js.map +0 -1
- package/dist/render/imageRenderProvider.d.ts +0 -8
- package/dist/render/imageRenderProvider.js +0 -19
- package/dist/render/imageRenderProvider.js.map +0 -1
- package/dist/render/jsonRenderProvider.d.ts +0 -8
- package/dist/render/jsonRenderProvider.js +0 -30
- package/dist/render/jsonRenderProvider.js.map +0 -1
- package/dist/render/renderProviderInterface.d.ts +0 -5
- package/dist/render/renderProviderInterface.js +0 -3
- package/dist/render/renderProviderInterface.js.map +0 -1
- package/dist/storage/fileStorageProvider.d.ts +0 -11
- package/dist/storage/fileStorageProvider.js +0 -76
- package/dist/storage/fileStorageProvider.js.map +0 -1
- package/dist/storage/storageProviderInterface.d.ts +0 -7
- package/dist/storage/storageProviderInterface.js +0 -3
- package/dist/storage/storageProviderInterface.js.map +0 -1
- package/dist/storage/storageService.d.ts +0 -13
- package/dist/storage/storageService.js +0 -30
- package/dist/storage/storageService.js.map +0 -1
- package/dist/tag.d.ts +0 -9
- package/dist/tag.js +0 -39
- package/dist/tag.js.map +0 -1
package/dist/data/dataService.js
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DataService = void 0;
|
|
4
|
-
const fileDataProvider_1 = require("./fileDataProvider");
|
|
5
|
-
const cache_1 = require("../cache");
|
|
6
|
-
class DataService {
|
|
7
|
-
constructor(config) {
|
|
8
|
-
this.config = config;
|
|
9
|
-
this.cache = new cache_1.Cache(this.config);
|
|
10
|
-
}
|
|
11
|
-
//posts
|
|
12
|
-
async getPost(id) {
|
|
13
|
-
let result = undefined;
|
|
14
|
-
result = await this.cache.getPost(id);
|
|
15
|
-
if (!result) {
|
|
16
|
-
result = await this.getProvider().getPost(id);
|
|
17
|
-
if (result) {
|
|
18
|
-
await this.cache.setPost(id, result);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return result;
|
|
22
|
-
}
|
|
23
|
-
async getPosts() {
|
|
24
|
-
let result = new Array();
|
|
25
|
-
let cacheKey = "get-posts";
|
|
26
|
-
let posts = await this.cache.getPosts(cacheKey);
|
|
27
|
-
if (!posts) {
|
|
28
|
-
result = await this.getProvider().getPosts();
|
|
29
|
-
//sort
|
|
30
|
-
let arraySort = require("array-sort");
|
|
31
|
-
result = new arraySort(result, "date", { reverse: true });
|
|
32
|
-
//cache
|
|
33
|
-
await this.cache.setPosts(cacheKey, result);
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
result = posts;
|
|
37
|
-
}
|
|
38
|
-
return result;
|
|
39
|
-
}
|
|
40
|
-
async getPublishedPosts() {
|
|
41
|
-
let result = new Array();
|
|
42
|
-
let cacheKey = "get-published-posts";
|
|
43
|
-
let posts = await this.cache.getPosts(cacheKey);
|
|
44
|
-
if (!posts) {
|
|
45
|
-
result = await this.getProvider().getPublishedPosts();
|
|
46
|
-
//sort
|
|
47
|
-
let arraySort = require("array-sort");
|
|
48
|
-
result = new arraySort(result, "date", { reverse: true });
|
|
49
|
-
//cache
|
|
50
|
-
await this.cache.setPosts(cacheKey, result);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
result = posts;
|
|
54
|
-
}
|
|
55
|
-
return result;
|
|
56
|
-
}
|
|
57
|
-
async getPostsByCount(count) {
|
|
58
|
-
let result = await this.getPosts();
|
|
59
|
-
let list = new Array();
|
|
60
|
-
let currentCount = 0;
|
|
61
|
-
result.forEach((post) => {
|
|
62
|
-
if (currentCount < count) {
|
|
63
|
-
list.push(post);
|
|
64
|
-
currentCount++;
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
result = list;
|
|
68
|
-
return result;
|
|
69
|
-
}
|
|
70
|
-
async getPublishedPostsByCount(count) {
|
|
71
|
-
let result = await this.getPublishedPosts();
|
|
72
|
-
let list = new Array();
|
|
73
|
-
let currentCount = 0;
|
|
74
|
-
result.forEach((post) => {
|
|
75
|
-
if (currentCount < count) {
|
|
76
|
-
list.push(post);
|
|
77
|
-
currentCount++;
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
result = list;
|
|
81
|
-
return result;
|
|
82
|
-
}
|
|
83
|
-
//tags
|
|
84
|
-
async getTag(name) {
|
|
85
|
-
let result = undefined;
|
|
86
|
-
result = await this.cache.getTag(name);
|
|
87
|
-
if (!result) {
|
|
88
|
-
result = await this.getProvider().getTag(name);
|
|
89
|
-
if (result) {
|
|
90
|
-
await this.cache.setTag(name, result);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return result;
|
|
94
|
-
}
|
|
95
|
-
async getTags() {
|
|
96
|
-
let result = new Array();
|
|
97
|
-
let cacheKey = "get-tags";
|
|
98
|
-
let tags = await this.cache.getTags(cacheKey);
|
|
99
|
-
if (!tags) {
|
|
100
|
-
result = await this.getProvider().getTags();
|
|
101
|
-
//sort
|
|
102
|
-
let arraySort = require("array-sort");
|
|
103
|
-
result = new arraySort(result, "id", { reverse: false });
|
|
104
|
-
await this.cache.setTags(cacheKey, result);
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
result = tags;
|
|
108
|
-
}
|
|
109
|
-
return result;
|
|
110
|
-
}
|
|
111
|
-
async getPublishedTags() {
|
|
112
|
-
let result = new Array();
|
|
113
|
-
let cacheKey = "get-published-tags";
|
|
114
|
-
let tags = await this.cache.getTags(cacheKey);
|
|
115
|
-
if (!tags) {
|
|
116
|
-
result = await this.getProvider().getPublishedTags();
|
|
117
|
-
//sort
|
|
118
|
-
let arraySort = require("array-sort");
|
|
119
|
-
result = new arraySort(result, "id", { reverse: false });
|
|
120
|
-
await this.cache.setTags(cacheKey, result);
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
result = tags;
|
|
124
|
-
}
|
|
125
|
-
return result;
|
|
126
|
-
}
|
|
127
|
-
getProvider() {
|
|
128
|
-
let result = undefined;
|
|
129
|
-
switch (this.config.provider.name) {
|
|
130
|
-
default:
|
|
131
|
-
result = new fileDataProvider_1.FileDataProvider();
|
|
132
|
-
break;
|
|
133
|
-
}
|
|
134
|
-
result.init(this.config);
|
|
135
|
-
return result;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
exports.DataService = DataService;
|
|
139
|
-
//# sourceMappingURL=dataService.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dataService.js","sourceRoot":"","sources":["../../src/data/dataService.ts"],"names":[],"mappings":";;;AAIA,yDAAsD;AACtD,oCAAiC;AAEjC,MAAa,WAAW;IAItB,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,IAAI,aAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,OAAO;IACP,KAAK,CAAC,OAAO,CAAC,EAAU;QACtB,IAAI,MAAM,GAAG,SAAS,CAAC;QAEvB,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAEtC,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YAE9C,IAAI,MAAM,EAAE;gBACV,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;aACtC;SACF;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,IAAI,MAAM,GAAG,IAAI,KAAK,EAAQ,CAAC;QAE/B,IAAI,QAAQ,GAAG,WAAW,CAAC;QAC3B,IAAI,KAAK,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAEhD,IAAI,CAAC,KAAK,EAAE;YACV,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,CAAC;YAE7C,MAAM;YACN,IAAI,SAAS,G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AAC;gBAChC,MAAM;SACT;QAED,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAEzB,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AApLD,kCAoLC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Post } from "../post";
|
|
2
|
-
import { Tag } from "../tag";
|
|
3
|
-
import { Config } from "../config";
|
|
4
|
-
import { DataProviderInterface } from "./dataProviderInterface";
|
|
5
|
-
export declare class FileDataProvider implements DataProviderInterface {
|
|
6
|
-
__postPath: string;
|
|
7
|
-
__posts: Array<Post>;
|
|
8
|
-
log: any;
|
|
9
|
-
constructor();
|
|
10
|
-
init(config: Config): void;
|
|
11
|
-
getPost(id: string): Promise<Post | undefined>;
|
|
12
|
-
getPosts(): Promise<Array<Post>>;
|
|
13
|
-
getPublishedPosts(): Promise<Array<Post>>;
|
|
14
|
-
getTag(name: string): Promise<Tag | undefined>;
|
|
15
|
-
getTags(): Promise<Array<Tag>>;
|
|
16
|
-
getPublishedTags(): Promise<Array<Tag>>;
|
|
17
|
-
generateTags(posts: Array<Post>): Array<Tag>;
|
|
18
|
-
formatToKey(key: string): string;
|
|
19
|
-
parsePost(filePath: string): Promise<Post | undefined>;
|
|
20
|
-
}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FileDataProvider = void 0;
|
|
4
|
-
const post_1 = require("../post");
|
|
5
|
-
const tag_1 = require("../tag");
|
|
6
|
-
const fs = require("fs-extra");
|
|
7
|
-
const winston_1 = require("winston");
|
|
8
|
-
const matter = require("gray-matter");
|
|
9
|
-
class FileDataProvider {
|
|
10
|
-
constructor() {
|
|
11
|
-
this.__postPath = "";
|
|
12
|
-
this.__posts = [];
|
|
13
|
-
this.log = (0, winston_1.createLogger)({ transports: [new winston_1.transports.Console()] });
|
|
14
|
-
}
|
|
15
|
-
init(config) {
|
|
16
|
-
if (config.path) {
|
|
17
|
-
this.__postPath = config.path;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
async getPost(id) {
|
|
21
|
-
let result;
|
|
22
|
-
let posts = await this.getPosts();
|
|
23
|
-
posts.forEach(post => {
|
|
24
|
-
if (post.id == this.formatToKey(id)) {
|
|
25
|
-
result = post;
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
return result;
|
|
29
|
-
}
|
|
30
|
-
async getPosts() {
|
|
31
|
-
let result = new Array();
|
|
32
|
-
if (this.__posts.length == 0) {
|
|
33
|
-
let directory = this.__postPath;
|
|
34
|
-
if (await fs.existsSync(directory)) {
|
|
35
|
-
let files = await fs.readdirSync(directory);
|
|
36
|
-
for (let i = 0; i < files.length; i++) {
|
|
37
|
-
let file = files[i];
|
|
38
|
-
if (file.indexOf(".md") > 0) {
|
|
39
|
-
let filePath = directory + "/" + file;
|
|
40
|
-
let post = await this.parsePost(filePath);
|
|
41
|
-
if (post) {
|
|
42
|
-
this.__posts.push(post);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
result = this.__posts;
|
|
49
|
-
return result;
|
|
50
|
-
}
|
|
51
|
-
async getPublishedPosts() {
|
|
52
|
-
let result = new Array();
|
|
53
|
-
let posts = await this.getPosts();
|
|
54
|
-
posts.forEach((post) => {
|
|
55
|
-
if (post.published) {
|
|
56
|
-
result.push(post);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
return result;
|
|
60
|
-
}
|
|
61
|
-
async getTag(name) {
|
|
62
|
-
let result;
|
|
63
|
-
let tags = await this.getTags();
|
|
64
|
-
for (let i = 0; i < tags.length; i++) {
|
|
65
|
-
let tag = tags[i];
|
|
66
|
-
if (this.formatToKey(tag.name) == this.formatToKey(name)) {
|
|
67
|
-
result = tag;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return result;
|
|
71
|
-
}
|
|
72
|
-
async getTags() {
|
|
73
|
-
let posts = await this.getPosts();
|
|
74
|
-
return this.generateTags(posts);
|
|
75
|
-
}
|
|
76
|
-
async getPublishedTags() {
|
|
77
|
-
let posts = await this.getPublishedPosts();
|
|
78
|
-
return this.generateTags(posts);
|
|
79
|
-
}
|
|
80
|
-
generateTags(posts) {
|
|
81
|
-
let result = new Array();
|
|
82
|
-
posts.forEach(post => {
|
|
83
|
-
post.tags.forEach(tagName => {
|
|
84
|
-
let tag = result.find(t => t.id === new tag_1.Tag(tagName).id);
|
|
85
|
-
if (tag == null) {
|
|
86
|
-
tag = new tag_1.Tag(tagName);
|
|
87
|
-
result.push(tag);
|
|
88
|
-
}
|
|
89
|
-
let postExists = tag.posts.find(p => this.formatToKey(p.title) === this.formatToKey(post.title)) != null;
|
|
90
|
-
if (!postExists) {
|
|
91
|
-
tag.posts.push(post);
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
return result;
|
|
96
|
-
}
|
|
97
|
-
formatToKey(key) {
|
|
98
|
-
return key.toLowerCase().trim();
|
|
99
|
-
}
|
|
100
|
-
async parsePost(filePath) {
|
|
101
|
-
let result = undefined;
|
|
102
|
-
if (await fs.pathExists(filePath)) {
|
|
103
|
-
result = new post_1.Post();
|
|
104
|
-
let buff = await fs.readFile(filePath);
|
|
105
|
-
let data = buff.toString();
|
|
106
|
-
let m = matter(data);
|
|
107
|
-
let mData = m.data;
|
|
108
|
-
result.matter = m.data;
|
|
109
|
-
result.content = m.content;
|
|
110
|
-
//handle categories to tags
|
|
111
|
-
if (mData.categories) {
|
|
112
|
-
if (typeof mData.categories === 'string') {
|
|
113
|
-
result.addTags(mData.categories.toString().split(","));
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
result.addTags(mData.categories);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
if (mData.keywords) {
|
|
120
|
-
result.keywords = mData.keywords.toString().split(",");
|
|
121
|
-
}
|
|
122
|
-
if (mData.tags) {
|
|
123
|
-
result.addTags(mData.tags.toString().split(","));
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
this.log.error("The following post does not exist: " + filePath);
|
|
128
|
-
result = undefined;
|
|
129
|
-
}
|
|
130
|
-
return result;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
exports.FileDataProvider = FileDataProvider;
|
|
134
|
-
//# sourceMappingURL=fileDataProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fileDataProvider.js","sourceRoot":"","sources":["../../src/data/fileDataProvider.ts"],"names":[],"mappings":";;;AAAA,kCAA+B;AAC/B,gCAA6B;AAG7B,+BAA+B;AAC/B,qCAAmD;AACnD,sCAAsC;AAEtC,MAAa,gBAAgB;IAK3B;QAJA,eAAU,GAAW,EAAE,CAAC;QACxB,YAAO,GAAgB,EAAE,CAAC;QAIxB,IAAI,CAAC,GAAG,GAAG,IAAA,sBAAY,EAAC,EAAE,UAAU,EAAE,CAAC,IAAI,oBAAU,CAAC,OAAO,EAAE,CAAC,EAAC,CAAC,CAAC;IACrE,CAAC;IAED,IAAI,CAAC,MAAc;QACjB,IAAI,MAAM,CAAC,IAAI,EAAE;YACf,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC;SAC/B;IACH,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,EAAU;QACtB,IAAI,MAAwB,CAAC;QAE7B,IAAI,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;QAElC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACnB,IAAI,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE;gBACnC,MAAM,GAAG,IAAI,CAAC;aACf;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,IAAI,MAAM,GAAG,IAAI,KAAK,EAA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C,CAAC;iBAClC;aACF;YAGD,IAAI,KAAK,CAAC,QAAQ,EAAE;gBAClB,MAAM,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aACxD;YAED,IAAI,KAAK,CAAC,IAAI,EAAE;gBACd,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;aAClD;SACF;aAAM;YACL,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,qCAAqC,GAAG,QAAQ,CAAC,CAAC;YACjE,MAAM,GAAG,SAAS,CAAC;SACpB;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAzKD,4CAyKC"}
|
package/dist/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { DataService } from "./data/dataService";
|
|
3
|
-
import { Config } from "./config";
|
|
4
|
-
export declare class Writr {
|
|
5
|
-
log: any;
|
|
6
|
-
config: Config | undefined;
|
|
7
|
-
data: DataService | undefined;
|
|
8
|
-
constructor();
|
|
9
|
-
parseCLI(process: NodeJS.Process): void;
|
|
10
|
-
runCLI(): Promise<boolean>;
|
|
11
|
-
}
|
package/dist/index.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Writr = void 0;
|
|
4
|
-
const winston_1 = require("winston");
|
|
5
|
-
const dataService_1 = require("./data/dataService");
|
|
6
|
-
const config_1 = require("./config");
|
|
7
|
-
const htmRenderlProvider_1 = require("./render/htmRenderlProvider");
|
|
8
|
-
const del = require("del");
|
|
9
|
-
const fs = require("fs-extra");
|
|
10
|
-
const jsonRenderProvider_1 = require("./render/jsonRenderProvider");
|
|
11
|
-
const atomRenderProvider_1 = require("./render/atomRenderProvider");
|
|
12
|
-
const imageRenderProvider_1 = require("./render/imageRenderProvider");
|
|
13
|
-
const { createCommand } = require('commander');
|
|
14
|
-
class Writr {
|
|
15
|
-
constructor() {
|
|
16
|
-
this.log = (0, winston_1.createLogger)({ transports: [new winston_1.transports.Console()] });
|
|
17
|
-
}
|
|
18
|
-
parseCLI(process) {
|
|
19
|
-
const program = createCommand();
|
|
20
|
-
program.storeOptionsAsProperties(true);
|
|
21
|
-
program.option("-p, --path <path>", "Path of where the blog, config, and template are located");
|
|
22
|
-
program.option("-o, --output <path>", "Path of where to output the generated blog");
|
|
23
|
-
program.option("-r, --render <list>", "What do you want rendered such as html or json (example --render html,json)");
|
|
24
|
-
program.option("-c, --config <path>", "custom configuration path");
|
|
25
|
-
program.parse(process.argv);
|
|
26
|
-
this.config = new config_1.Config();
|
|
27
|
-
if (program.config) {
|
|
28
|
-
this.config.loadConfig(program.config);
|
|
29
|
-
}
|
|
30
|
-
if (program.path) {
|
|
31
|
-
this.config.loadPath(program.path);
|
|
32
|
-
}
|
|
33
|
-
this.config.loadProgram(program);
|
|
34
|
-
this.data = new dataService_1.DataService(this.config);
|
|
35
|
-
}
|
|
36
|
-
async runCLI() {
|
|
37
|
-
let result = true;
|
|
38
|
-
if (this.data !== undefined && this.config !== undefined) {
|
|
39
|
-
if (fs.existsSync(this.config.output)) {
|
|
40
|
-
del.sync(this.config.output);
|
|
41
|
-
}
|
|
42
|
-
let render = true;
|
|
43
|
-
for (let i = 0; i < this.config.render.length; i++) {
|
|
44
|
-
let type = this.config.render[i];
|
|
45
|
-
if (type === "html") {
|
|
46
|
-
render = await new htmRenderlProvider_1.HtmlRenderProvider().render(this.data, this.config);
|
|
47
|
-
}
|
|
48
|
-
if (type === "json") {
|
|
49
|
-
render = await new jsonRenderProvider_1.JSONRenderProvider().render(this.data, this.config);
|
|
50
|
-
}
|
|
51
|
-
if (type === "atom") {
|
|
52
|
-
render = await new atomRenderProvider_1.AtomRenderProvider().render(this.data, this.config);
|
|
53
|
-
}
|
|
54
|
-
if (type === "images") {
|
|
55
|
-
render = await new imageRenderProvider_1.ImageRenderProvider().render(this.data, this.config);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
if (render) {
|
|
59
|
-
result = render;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
result = false;
|
|
64
|
-
}
|
|
65
|
-
return result;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
exports.Writr = Writr;
|
|
69
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,oDAAiD;AACjD,qCAAkC;AAClC,oEAAiE;AACjE,2BAA2B;AAC3B,+BAA+B;AAC/B,oEAAiE;AACjE,oEAAiE;AACjE,sEAAmE;AACnE,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAG/C,MAAa,KAAK;IAMd;QACI,IAAI,CAAC,GAAG,GAAG,IAAA,sBAAY,EAAC,EAAE,UAAU,EAAE,CAAC,IAAI,oBAAU,CAAC,OAAO,EAAE,CAAC,EAAC,CAAC,CAAC;IACvE,CAAC;IAED,QAAQ,CAAC,OAAuB;QAE5B,MAAM,OAAO,GAAG,aAAa,EAAE,CAAC;QAEhC,OAAO,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;QAEvC,OAAO,CAAC,MAAM,CAAC,mBAAmB,EAAE,0DAA0D,CAAC,CAAC;QAChG,OAAO,CAAC,MAAM,CAAC,qBAAqB,EAAE,4CAA4C,CAAC,CAAC;QACpF,OAAO,CAAC,MAAM,CAAC,qBAAqB,EAAE,6EAA6E,CAAC,CAAC;QACrH,OAAO,CAAC,MAAM,CAAC,qBAAqB,EAAE,2BAA2B,CAAC,CAAC;QAEnE,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IA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AE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;iBAC1E;gBACD,IAAG,IAAI,KAAK,MAAM,EAAE;oBAChB,MAAM,GAAG,MAAM,IAAI,uCAAkB,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;iBAC1E;gBACD,IAAG,IAAI,KAAK,QAAQ,EAAE;oBAClB,MAAM,GAAG,MAAM,IAAI,yCAAmB,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;iBAC3E;aACJ;YAED,IAAG,MAAM,EAAE;gBACP,MAAM,GAAG,MAAM,CAAC;aACnB;SAEJ;aAAM;YACH,MAAM,GAAG,KAAK,CAAC;SAClB;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AA1ED,sBA0EC"}
|
package/dist/post.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export declare class Post {
|
|
2
|
-
keywords: Array<string>;
|
|
3
|
-
tags: Array<string>;
|
|
4
|
-
content: string;
|
|
5
|
-
private _matter;
|
|
6
|
-
permalink_default: string;
|
|
7
|
-
permalink_date: string;
|
|
8
|
-
permalink_ordinal: string;
|
|
9
|
-
constructor();
|
|
10
|
-
get id(): string;
|
|
11
|
-
get date(): Date;
|
|
12
|
-
get title(): string;
|
|
13
|
-
set title(val: string);
|
|
14
|
-
get author(): string;
|
|
15
|
-
set author(val: string);
|
|
16
|
-
get url(): string;
|
|
17
|
-
set url(val: string);
|
|
18
|
-
get matter(): any;
|
|
19
|
-
set matter(val: any);
|
|
20
|
-
getBody(): Promise<any>;
|
|
21
|
-
get published(): boolean;
|
|
22
|
-
set published(val: boolean);
|
|
23
|
-
getDescription(): Promise<any>;
|
|
24
|
-
getSummary(): Promise<any>;
|
|
25
|
-
addTag(name: string): void;
|
|
26
|
-
addTags(names: Array<string>): void;
|
|
27
|
-
generateUrl(): void;
|
|
28
|
-
parseUrl(url: string): string;
|
|
29
|
-
toObject(): Promise<any>;
|
|
30
|
-
static create(obj: any): Post;
|
|
31
|
-
}
|
package/dist/post.js
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Post = void 0;
|
|
4
|
-
const luxon_1 = require("luxon");
|
|
5
|
-
const striptags = require("striptags");
|
|
6
|
-
const ecto_1 = require("ecto");
|
|
7
|
-
class Post {
|
|
8
|
-
constructor() {
|
|
9
|
-
this.keywords = [];
|
|
10
|
-
this.tags = [];
|
|
11
|
-
this.content = "";
|
|
12
|
-
this._matter = {};
|
|
13
|
-
this.permalink_default = ":title";
|
|
14
|
-
this.permalink_date = ":year/:month/:day/:title";
|
|
15
|
-
this.permalink_ordinal = ":year/:y_day/:title";
|
|
16
|
-
}
|
|
17
|
-
get id() {
|
|
18
|
-
return this.url;
|
|
19
|
-
}
|
|
20
|
-
get date() {
|
|
21
|
-
if (Object.prototype.toString.call(this.matter.date) !== "[object Date]") {
|
|
22
|
-
let newDate = luxon_1.DateTime.fromISO(this.matter.date).toJSDate();
|
|
23
|
-
return newDate;
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
return this.matter.date;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
get title() {
|
|
30
|
-
return this.matter.title;
|
|
31
|
-
}
|
|
32
|
-
set title(val) {
|
|
33
|
-
this.matter.title = val;
|
|
34
|
-
this.generateUrl();
|
|
35
|
-
}
|
|
36
|
-
get author() {
|
|
37
|
-
return this.matter.author;
|
|
38
|
-
}
|
|
39
|
-
set author(val) {
|
|
40
|
-
this.matter.author = val;
|
|
41
|
-
}
|
|
42
|
-
get url() {
|
|
43
|
-
if (!this.matter.url) {
|
|
44
|
-
this.generateUrl();
|
|
45
|
-
}
|
|
46
|
-
return this.matter.url;
|
|
47
|
-
}
|
|
48
|
-
set url(val) {
|
|
49
|
-
this.matter.url = val;
|
|
50
|
-
}
|
|
51
|
-
get matter() {
|
|
52
|
-
return this._matter;
|
|
53
|
-
}
|
|
54
|
-
set matter(val) {
|
|
55
|
-
this._matter = val;
|
|
56
|
-
}
|
|
57
|
-
async getBody() {
|
|
58
|
-
if (!this.matter.body) {
|
|
59
|
-
const ecto = new ecto_1.Ecto();
|
|
60
|
-
this.matter.body = await ecto.render(this.content, undefined, 'markdown');
|
|
61
|
-
}
|
|
62
|
-
return this.matter.body;
|
|
63
|
-
}
|
|
64
|
-
get published() {
|
|
65
|
-
if (this.matter.published === undefined) {
|
|
66
|
-
this.matter.published = true;
|
|
67
|
-
}
|
|
68
|
-
return this.matter.published;
|
|
69
|
-
}
|
|
70
|
-
set published(val) {
|
|
71
|
-
this.matter.published = val;
|
|
72
|
-
}
|
|
73
|
-
async getDescription() {
|
|
74
|
-
if (this.matter.description === undefined) {
|
|
75
|
-
this.matter.description = striptags(await this.getSummary());
|
|
76
|
-
}
|
|
77
|
-
return this.matter.description;
|
|
78
|
-
}
|
|
79
|
-
async getSummary() {
|
|
80
|
-
if (this.matter.description) {
|
|
81
|
-
this.matter.summary = this.matter.description;
|
|
82
|
-
}
|
|
83
|
-
if (!this.matter.summary) {
|
|
84
|
-
let body = await this.getBody();
|
|
85
|
-
let cheerio = require("cheerio");
|
|
86
|
-
let html = cheerio.load(body);
|
|
87
|
-
let summaryLength = 3;
|
|
88
|
-
this.matter.summary = "";
|
|
89
|
-
html("p").each((i, elem) => {
|
|
90
|
-
if (i < summaryLength) {
|
|
91
|
-
this.matter.summary = this.matter.summary + html.html(elem);
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
return this.matter.summary;
|
|
96
|
-
}
|
|
97
|
-
addTag(name) {
|
|
98
|
-
let exists = false;
|
|
99
|
-
if (name) {
|
|
100
|
-
this.tags.forEach((tag) => {
|
|
101
|
-
if (tag === name) {
|
|
102
|
-
exists = true;
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
if (!exists) {
|
|
106
|
-
this.tags.push(name);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
addTags(names) {
|
|
111
|
-
names.forEach((name) => {
|
|
112
|
-
if (name) {
|
|
113
|
-
this.addTag(name);
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
generateUrl() {
|
|
118
|
-
if (!this.matter.url) {
|
|
119
|
-
//set default
|
|
120
|
-
let url = this.permalink_default;
|
|
121
|
-
//check slug first
|
|
122
|
-
if (this.matter.slug) {
|
|
123
|
-
url = this.matter.slug;
|
|
124
|
-
}
|
|
125
|
-
//check permalink second
|
|
126
|
-
if (this.matter.permalink) {
|
|
127
|
-
url = this.matter.permalink;
|
|
128
|
-
}
|
|
129
|
-
this.matter.url = this.parseUrl(url);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
parseUrl(url) {
|
|
133
|
-
let date = luxon_1.DateTime.fromJSDate(this.date);
|
|
134
|
-
//title
|
|
135
|
-
let title = this._matter.title.toLowerCase().replace(/[^a-z0-9+]+/gi, " ").trim();
|
|
136
|
-
title = title.split(" ").join("-");
|
|
137
|
-
//do styles
|
|
138
|
-
if (url.toLowerCase().trim() === "default") {
|
|
139
|
-
url = this.permalink_default;
|
|
140
|
-
}
|
|
141
|
-
if (url.toLowerCase().trim() === "date") {
|
|
142
|
-
url = this.permalink_date;
|
|
143
|
-
}
|
|
144
|
-
if (url.toLowerCase().trim() === "ordinal") {
|
|
145
|
-
url = this.permalink_ordinal;
|
|
146
|
-
}
|
|
147
|
-
url = url.split(":year").join(date.toFormat("yyyy"));
|
|
148
|
-
url = url.split(":short_year").join(date.toFormat("yy"));
|
|
149
|
-
url = url.split(":month").join(date.toFormat("LL"));
|
|
150
|
-
url = url.split(":i_month").join(date.toFormat("L"));
|
|
151
|
-
url = url.split(":short_month").join(date.toFormat("LLL"));
|
|
152
|
-
url = url.split(":long_month").join(date.toFormat("LLLL"));
|
|
153
|
-
url = url.split(":day").join(date.toFormat("dd"));
|
|
154
|
-
url = url.split(":i_day").join(date.toFormat("d"));
|
|
155
|
-
url = url.split(":y_day").join(date.toFormat("o"));
|
|
156
|
-
url = url.split(":short_day").join(date.toFormat("ccc"));
|
|
157
|
-
url = url.split(":long_day").join(date.toFormat("cccc"));
|
|
158
|
-
url = url.split(":week").join(date.toFormat("W"));
|
|
159
|
-
url = url.split(":hour").join(date.toFormat("HH"));
|
|
160
|
-
url = url.split(":minute").join(date.toFormat("mm"));
|
|
161
|
-
url = url.split(":second").join(date.toFormat("ss"));
|
|
162
|
-
url = url.split(":title").join(title);
|
|
163
|
-
//url remove white spaces
|
|
164
|
-
url = url.split(" ").join("-");
|
|
165
|
-
//url remove `/`
|
|
166
|
-
if (url.startsWith("/")) {
|
|
167
|
-
url = url.substring(1);
|
|
168
|
-
}
|
|
169
|
-
return url;
|
|
170
|
-
}
|
|
171
|
-
async toObject() {
|
|
172
|
-
let result = {};
|
|
173
|
-
result.keywords = this.keywords;
|
|
174
|
-
result.tags = this.tags;
|
|
175
|
-
result.content = this.content;
|
|
176
|
-
result.id = this.id;
|
|
177
|
-
result.date = this.date;
|
|
178
|
-
result.title = this.title;
|
|
179
|
-
result.author = this.author;
|
|
180
|
-
result.url = this.url;
|
|
181
|
-
result.body = await this.getBody();
|
|
182
|
-
result.summary = await this.getSummary();
|
|
183
|
-
result.description = await this.getDescription();
|
|
184
|
-
result.metaData = this._matter;
|
|
185
|
-
result.matter = this._matter;
|
|
186
|
-
result.published = this.published;
|
|
187
|
-
return result;
|
|
188
|
-
}
|
|
189
|
-
static create(obj) {
|
|
190
|
-
let result = Object.assign(new Post(), obj);
|
|
191
|
-
return result;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
exports.Post = Post;
|
|
195
|
-
//# sourceMappingURL=post.js.map
|
package/dist/post.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,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OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC9B,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QACpB,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACxB,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAC1B,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC5B,MAAM,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QACtB,MAAM,CAAC,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QACnC,MAAM,CAAC,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QACzC,MAAM,CAAC,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;QACjD,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC;QAC/B,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAElC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,GAAQ;QACpB,IAAI,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC;QAE5C,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAlPD,oBAkPC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { DataService } from "../data/dataService";
|
|
2
|
-
import { Config } from "../config";
|
|
3
|
-
import { RenderProviderInterface } from "./renderProviderInterface";
|
|
4
|
-
export declare class AtomRenderProvider implements RenderProviderInterface {
|
|
5
|
-
log: any;
|
|
6
|
-
constructor();
|
|
7
|
-
render(data: DataService, config: Config): Promise<boolean>;
|
|
8
|
-
}
|