writr 1.9.12 → 2.0.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.
Files changed (133) hide show
  1. package/README.md +76 -135
  2. package/bin/writr.mjs +8 -0
  3. package/dist/builder.d.ts +33 -0
  4. package/dist/builder.js +181 -0
  5. package/dist/console.d.ts +22 -0
  6. package/dist/console.js +120 -0
  7. package/dist/github.d.ts +22 -0
  8. package/dist/github.js +74 -0
  9. package/dist/helpers/markdown.d.ts +10 -0
  10. package/dist/helpers/markdown.js +24 -0
  11. package/dist/helpers.d.ts +7 -0
  12. package/dist/helpers.js +58 -0
  13. package/dist/options.d.ts +12 -0
  14. package/dist/options.js +47 -0
  15. package/dist/writr.d.ts +23 -0
  16. package/dist/writr.js +153 -0
  17. package/init/favicon.svg +1 -0
  18. package/init/logo.png +0 -0
  19. package/init/variables.css +30 -0
  20. package/init/writr.config.cjs +10 -0
  21. package/package.json +44 -66
  22. package/template/css/highlight/highlight.min.js +1433 -0
  23. package/template/css/highlight/styles/base16/dracula.min.css +7 -0
  24. package/template/css/home.css +307 -0
  25. package/template/css/index.css +919 -0
  26. package/template/includes/footer.hbs +10 -0
  27. package/template/includes/header.hbs +17 -0
  28. package/template/includes/landing/content.hbs +63 -0
  29. package/template/includes/landing/hero.hbs +3 -0
  30. package/template/includes/scripts.hbs +4 -0
  31. package/template/index.hbs +16 -0
  32. package/template/releases.hbs +45 -0
  33. package/bin/writr.js +0 -7
  34. package/dist/cache.d.ts +0 -18
  35. package/dist/cache.js +0 -70
  36. package/dist/cache.js.map +0 -1
  37. package/dist/config.d.ts +0 -29
  38. package/dist/config.js +0 -104
  39. package/dist/config.js.map +0 -1
  40. package/dist/data/dataProviderInterface.d.ts +0 -12
  41. package/dist/data/dataProviderInterface.js +0 -2
  42. package/dist/data/dataProviderInterface.js.map +0 -1
  43. package/dist/data/dataService.d.ts +0 -19
  44. package/dist/data/dataService.js +0 -130
  45. package/dist/data/dataService.js.map +0 -1
  46. package/dist/data/fileDataProvider.d.ts +0 -20
  47. package/dist/data/fileDataProvider.js +0 -132
  48. package/dist/data/fileDataProvider.js.map +0 -1
  49. package/dist/generator.d.ts +0 -8
  50. package/dist/generator.js +0 -54
  51. package/dist/generator.js.map +0 -1
  52. package/dist/index.d.ts +0 -8
  53. package/dist/index.js +0 -80
  54. package/dist/index.js.map +0 -1
  55. package/dist/log.d.ts +0 -6
  56. package/dist/log.js +0 -13
  57. package/dist/log.js.map +0 -1
  58. package/dist/migrate/ghostMigrationProvider.d.ts +0 -9
  59. package/dist/migrate/ghostMigrationProvider.js +0 -65
  60. package/dist/migrate/ghostMigrationProvider.js.map +0 -1
  61. package/dist/migrate/jekyllMigrationProvider.d.ts +0 -4
  62. package/dist/migrate/jekyllMigrationProvider.js +0 -11
  63. package/dist/migrate/jekyllMigrationProvider.js.map +0 -1
  64. package/dist/migrate/mediumMigrationProvider.d.ts +0 -7
  65. package/dist/migrate/mediumMigrationProvider.js +0 -26
  66. package/dist/migrate/mediumMigrationProvider.js.map +0 -1
  67. package/dist/migrate/migrationProviderInterface.d.ts +0 -3
  68. package/dist/migrate/migrationProviderInterface.js +0 -2
  69. package/dist/migrate/migrationProviderInterface.js.map +0 -1
  70. package/dist/migrate/wordpressMigrationProvider.d.ts +0 -12
  71. package/dist/migrate/wordpressMigrationProvider.js +0 -103
  72. package/dist/migrate/wordpressMigrationProvider.js.map +0 -1
  73. package/dist/migrate.d.ts +0 -6
  74. package/dist/migrate.js +0 -34
  75. package/dist/migrate.js.map +0 -1
  76. package/dist/post.d.ts +0 -31
  77. package/dist/post.js +0 -189
  78. package/dist/post.js.map +0 -1
  79. package/dist/render/atomRenderProvider.d.ts +0 -8
  80. package/dist/render/atomRenderProvider.js +0 -51
  81. package/dist/render/atomRenderProvider.js.map +0 -1
  82. package/dist/render/htmRenderlProvider.d.ts +0 -14
  83. package/dist/render/htmRenderlProvider.js +0 -117
  84. package/dist/render/htmRenderlProvider.js.map +0 -1
  85. package/dist/render/imageRenderProvider.d.ts +0 -8
  86. package/dist/render/imageRenderProvider.js +0 -15
  87. package/dist/render/imageRenderProvider.js.map +0 -1
  88. package/dist/render/jsonRenderProvider.d.ts +0 -8
  89. package/dist/render/jsonRenderProvider.js +0 -24
  90. package/dist/render/jsonRenderProvider.js.map +0 -1
  91. package/dist/render/renderProviderInterface.d.ts +0 -5
  92. package/dist/render/renderProviderInterface.js +0 -2
  93. package/dist/render/renderProviderInterface.js.map +0 -1
  94. package/dist/serve.d.ts +0 -16
  95. package/dist/serve.js +0 -29
  96. package/dist/serve.js.map +0 -1
  97. package/dist/storage/fileStorageProvider.d.ts +0 -10
  98. package/dist/storage/fileStorageProvider.js +0 -62
  99. package/dist/storage/fileStorageProvider.js.map +0 -1
  100. package/dist/storage/storageProviderInterface.d.ts +0 -8
  101. package/dist/storage/storageProviderInterface.js +0 -2
  102. package/dist/storage/storageProviderInterface.js.map +0 -1
  103. package/dist/storage/storageService.d.ts +0 -12
  104. package/dist/storage/storageService.js +0 -28
  105. package/dist/storage/storageService.js.map +0 -1
  106. package/dist/tag.d.ts +0 -9
  107. package/dist/tag.js +0 -34
  108. package/dist/tag.js.map +0 -1
  109. package/dist/utils/parser.d.ts +0 -5
  110. package/dist/utils/parser.js +0 -37
  111. package/dist/utils/parser.js.map +0 -1
  112. package/dist/utils/setup.d.ts +0 -8
  113. package/dist/utils/setup.js +0 -75
  114. package/dist/utils/setup.js.map +0 -1
  115. package/init/article-complex.md +0 -40
  116. package/init/article-ejs.md +0 -40
  117. package/init/article-unpublished.md +0 -11
  118. package/init/article1-simple.md +0 -13
  119. package/init/article1.md +0 -11
  120. package/init/article2.md +0 -14
  121. package/init/big-content.md +0 -11
  122. package/init/config.json +0 -9
  123. package/init/images/Introducing Docula 1.png +0 -0
  124. package/init/images/Introducing Docula 2.jpeg +0 -0
  125. package/init/images/Introducing Docula 3.png +0 -0
  126. package/init/images/Introducing Docula 4.png +0 -0
  127. package/init/permalink-test.md +0 -13
  128. package/init/templates/index.hjs +0 -13
  129. package/init/templates/partials/header.hjs +0 -2
  130. package/init/templates/post.hjs +0 -19
  131. package/init/templates/post2.hjs +0 -17
  132. package/init/templates/post3.ejs +0 -7
  133. package/init/templates/tag.hjs +0 -9
@@ -1,62 +0,0 @@
1
- import fs from "fs-extra";
2
- import { ConsoleMessage } from "../log.js";
3
- export class FileStorageProvider {
4
- async get(path) {
5
- let result;
6
- try {
7
- let buffer = await fs.readFile(path);
8
- result = buffer.toString();
9
- }
10
- catch (error) {
11
- new ConsoleMessage().error(error.message);
12
- }
13
- return result;
14
- }
15
- async set(path, data) {
16
- if (!path || !data)
17
- return false;
18
- await this.ensureFilePath(path);
19
- await fs.writeFile(path, data);
20
- return true;
21
- }
22
- async delete(path) {
23
- let result = false;
24
- try {
25
- await fs.remove(path);
26
- result = true;
27
- }
28
- catch (error) {
29
- new ConsoleMessage().error(error.message);
30
- }
31
- return result;
32
- }
33
- async copy(src, dest) {
34
- let result = false;
35
- try {
36
- await fs.ensureDir(dest);
37
- await fs.copy(src, dest);
38
- result = true;
39
- }
40
- catch (error) {
41
- new ConsoleMessage().error(error.message);
42
- }
43
- return result;
44
- }
45
- exists(path) {
46
- return new Promise((resolve) => {
47
- fs.exists(path, exist => {
48
- resolve(exist);
49
- });
50
- });
51
- }
52
- async ensureFilePath(path) {
53
- let pathList = path.split("/");
54
- pathList.pop();
55
- let dir = pathList.join("/");
56
- await fs.ensureDir(dir);
57
- }
58
- readDir(path) {
59
- return fs.readdirSync(path);
60
- }
61
- }
62
- //# sourceMappingURL=fileStorageProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fileStorageProvider.js","sourceRoot":"","sources":["../../src/storage/fileStorageProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,MAAM,OAAO,mBAAmB;IAE5B,KAAK,CAAC,GAAG,CAAC,IAAY;QACl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;SAC7C;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,MAAM,CAAC,IAAY;QACf,OAAO,IAAI,OAAO,CAAU,CAAC,OAAO,EAAE,EAAE;YACpC,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;gBACpB,OAAO,CAAC,KAAK,CAAC,CAAC;YACnB,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,IAAW;QAC5B,IAAI,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/B,QAAQ,CAAC,GAAG,EAAE,CAAC;QAEf,IAAI,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAE7B,MAAM,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,CAAC,IAAY;QAChB,OAAO,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IAC/B,CAAC;CACJ"}
@@ -1,8 +0,0 @@
1
- export interface StorageProviderInterface {
2
- get(path: string): Promise<string | undefined>;
3
- set(path: string, data: string): Promise<boolean>;
4
- delete(path: string): Promise<boolean>;
5
- copy(src: string, dest: string): Promise<boolean>;
6
- exists(path: string): Promise<boolean>;
7
- readDir(path: string): string[];
8
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=storageProviderInterface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"storageProviderInterface.js","sourceRoot":"","sources":["../../src/storage/storageProviderInterface.ts"],"names":[],"mappings":""}
@@ -1,12 +0,0 @@
1
- import { StorageProviderInterface } from "./storageProviderInterface.js";
2
- export declare class StorageService implements StorageProviderInterface {
3
- provider: StorageProviderInterface;
4
- constructor();
5
- get(path: string): Promise<string | undefined>;
6
- set(path: string, data: string): Promise<boolean>;
7
- delete(path: string): Promise<boolean>;
8
- exists(path: string): Promise<boolean>;
9
- copy(src: string, dest: string): Promise<boolean>;
10
- getProvider(): StorageProviderInterface;
11
- readDir(path: string): string[];
12
- }
@@ -1,28 +0,0 @@
1
- import { FileStorageProvider } from "./fileStorageProvider.js";
2
- export class StorageService {
3
- constructor() {
4
- this.provider = new FileStorageProvider();
5
- }
6
- async get(path) {
7
- return this.getProvider().get(path);
8
- }
9
- async set(path, data) {
10
- return this.getProvider().set(path, data);
11
- }
12
- async delete(path) {
13
- return this.getProvider().delete(path);
14
- }
15
- async exists(path) {
16
- return this.getProvider().exists(path);
17
- }
18
- async copy(src, dest) {
19
- return this.getProvider().copy(src, dest);
20
- }
21
- getProvider() {
22
- return this.provider;
23
- }
24
- readDir(path) {
25
- return this.getProvider().readDir(path);
26
- }
27
- }
28
- //# sourceMappingURL=storageService.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"storageService.js","sourceRoot":"","sources":["../../src/storage/storageService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAG/D,MAAM,OAAO,cAAc;IAIvB;QACI,IAAI,CAAC,QAAQ,GAAG,IAAI,mBAAmB,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"}
package/dist/tag.d.ts DELETED
@@ -1,9 +0,0 @@
1
- import { Post } from "./post.js";
2
- export declare class Tag {
3
- name: string;
4
- posts: Array<Post>;
5
- constructor(name: string);
6
- get id(): string;
7
- toObject(): Promise<any>;
8
- static create(obj: any): Tag;
9
- }
package/dist/tag.js DELETED
@@ -1,34 +0,0 @@
1
- import { Post } from "./post.js";
2
- export class Tag {
3
- constructor(name) {
4
- this.name = "";
5
- this.posts = new Array();
6
- this.name = name.trim();
7
- }
8
- get id() {
9
- let result = this.name.toLowerCase().replace(/[^a-z0-9+]+/gi, " ").trim();
10
- result = result.split(" ").join("-");
11
- return result;
12
- }
13
- async toObject() {
14
- let result = {};
15
- result.name = this.name;
16
- result.id = this.id;
17
- result.posts = [];
18
- for (const post of this.posts) {
19
- result.posts.push(await post.toObject());
20
- }
21
- return result;
22
- }
23
- static create(obj) {
24
- let result = new Tag(obj.name);
25
- if (obj.posts) {
26
- for (let i = 0; i < obj.posts.length; i++) {
27
- let p = Post.create(obj.posts[i]);
28
- result.posts.push(p);
29
- }
30
- }
31
- return result;
32
- }
33
- }
34
- //# sourceMappingURL=tag.js.map
package/dist/tag.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"tag.js","sourceRoot":"","sources":["../src/tag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,OAAO,GAAG;IAId,YAAY,IAAY;QAHxB,SAAI,GAAW,E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AM,CAAC;IAChB,CAAC;CACF"}
@@ -1,5 +0,0 @@
1
- export declare class Parser {
2
- htmlToMd(html: string): string;
3
- generateMdHeaders({ title, slug, date, categories, tags }: Record<string, any>): string;
4
- slugify(text: string): string;
5
- }
@@ -1,37 +0,0 @@
1
- import { NodeHtmlMarkdown } from "node-html-markdown";
2
- export class Parser {
3
- htmlToMd(html) {
4
- if (!html)
5
- return '';
6
- return new NodeHtmlMarkdown().translate(html);
7
- }
8
- generateMdHeaders({ title, slug, date, categories, tags }) {
9
- let header = '---\n';
10
- if (title)
11
- header += `title: ${title}\n`;
12
- if (slug)
13
- header += `url: ${slug}\n`;
14
- if (date)
15
- header += `date: ${(new Date(date)).toISOString().slice(0, 10)}\n`;
16
- if (categories)
17
- header += `categories: ${typeof categories === 'string' ? categories : categories.join(', ')}\n`;
18
- if (tags)
19
- header += `tags: ${typeof tags === 'string' ? tags : tags.join(', ')}\n`;
20
- header += '---\n\n';
21
- return header;
22
- }
23
- slugify(text) {
24
- const from = "ãàáäâẽèéëêìíïîõòóöôùúüûñç·/_,:;";
25
- const to = "aaaaaeeeeeiiiiooooouuuunc------";
26
- const newText = text.split('').map((letter, i) => letter.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i)));
27
- return newText
28
- .toString() // Cast to string
29
- .toLowerCase() // Convert the string to lowercase letters
30
- .trim() // Remove whitespace from both sides of a string
31
- .replace(/\s+/g, '-') // Replace spaces with -
32
- .replace(/&/g, '-y-') // Replace & with 'and'
33
- .replace(/[^\w\-]+/g, '') // Remove all non-word chars
34
- .replace(/\-\-+/g, '-'); // Replace multiple - with single -
35
- }
36
- }
37
- //# sourceMappingURL=parser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/utils/parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAEpD,MAAM,OAAO,MAAM;IAEjB,QAAQ,CAAC,IAAY;QACnB,IAA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AAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAE/E,OAAO,OAAO;aACX,QAAQ,EAAE,CAAqB,iBAAiB;aAChD,WAAW,EAAE,CAAkB,0CAA0C;aACzE,IAAI,EAAE,CAAyB,gDAAgD;aAC/E,OAAO,CAAC,MAAM,EAAE,GAAG,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"}
@@ -1,8 +0,0 @@
1
- export declare class Setup {
2
- private readonly name;
3
- private readonly gitignoreContent;
4
- private readonly packageJsonContent;
5
- constructor(name?: string);
6
- init(): Promise<void>;
7
- new(): Promise<void>;
8
- }
@@ -1,75 +0,0 @@
1
- import fs from "fs-extra";
2
- import inquirer from "inquirer";
3
- import { Parser } from "./parser.js";
4
- export class Setup {
5
- constructor(name = 'default') {
6
- this.name = name;
7
- this.gitignoreContent = "### Node ###\n" +
8
- "# Logs\n" +
9
- "logs\n" +
10
- "*.log\n" +
11
- "npm-debug.log*\n" +
12
- "yarn-debug.log*\n" +
13
- "yarn-error.log*\n" +
14
- "lerna-debug.log*\n" +
15
- "# Dependency directories\n" +
16
- "node_modules/\n" +
17
- "jspm_packages/\n" +
18
- "# Optional npm cache directory\n" +
19
- ".npm\n";
20
- this.packageJsonContent = {
21
- name: this.name,
22
- version: "0.0.1",
23
- description: "",
24
- keywords: [],
25
- license: "ISC",
26
- author: "",
27
- scripts: {
28
- test: "echo \"Error: no test specified\" && exit 1"
29
- },
30
- };
31
- }
32
- ;
33
- async init() {
34
- try {
35
- fs.mkdirSync(this.name);
36
- fs.outputFileSync(`./${this.name}/.gitignore`, this.gitignoreContent);
37
- fs.outputFileSync(`./${this.name}/package.json`, JSON.stringify(this.packageJsonContent, null, 2));
38
- fs.copySync(`${__dirname}/../../init`, `./${this.name}/blog`);
39
- }
40
- catch (error) {
41
- throw new Error('Directory already exists');
42
- }
43
- }
44
- async new() {
45
- try {
46
- const questions = [
47
- {
48
- name: 'title',
49
- message: 'What is the title of the post?',
50
- },
51
- {
52
- name: 'categories',
53
- message: 'Please enter the categories of the post separated by commas',
54
- },
55
- {
56
- name: 'tags',
57
- message: 'Please enter the tags of the post separated by commas',
58
- },
59
- {
60
- name: 'date',
61
- message: 'Please enter the date of the post in the format YYYY-MM-DD',
62
- default: new Date().toLocaleDateString('en-CA'),
63
- },
64
- ];
65
- const response = await inquirer.prompt(questions);
66
- response.slug = new Parser().slugify(response.title);
67
- const headerContent = new Parser().generateMdHeaders(response);
68
- await fs.outputFileSync(`${response.slug}.md`, headerContent);
69
- }
70
- catch (error) {
71
- throw new Error('Error creating new file');
72
- }
73
- }
74
- }
75
- //# sourceMappingURL=setup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"setup.js","sourceRoot":"","sources":["../../src/utils/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAEnC,MAAM,OAAO,KAAK;IAMhB,YAAY,OAAe,SAAS;QAElC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,gBAAgB,GAAG,gBAAgB;YACtC,UAAU;YACV,QAAQ;YACR,SAAS;YACT,kBAAkB;YAClB,mBAAmB;YACnB,mBAAmB;YACnB,oBAAoB;YACpB,4BAA4B;YAC5B,iBAAiB;YACjB,kBAAkB;YAClB,kCAAkC;YAClC,QAAQ,CAAC;QACX,IAAI,CAAC,kBAAkB,GAAG;YACxB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,OAAO;YAChB,WAAW,EAAE,EAAE;YACf,QAAQ,EAAE,EAAE;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CAAC,CAAC;YAErD,MAAM,aAAa,GAAG,IAAI,MAAM,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"}
@@ -1,40 +0,0 @@
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
- ![](images/Docula_%20Persistent%20Links%20and%20Styles%201.jpeg)
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
- ![](images/Docula_%20Persistent%20Links%20and%20Styles%202.png)
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
-
@@ -1,40 +0,0 @@
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
- ![](images/Docula_%20Persistent%20Links%20and%20Styles%201.jpeg)
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
- ![](images/Docula_%20Persistent%20Links%20and%20Styles%202.png)
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
-
@@ -1,11 +0,0 @@
1
- ---
2
- title: Tesla Unpublished
3
- author: Elon Musk
4
- date: 2016-08-12
5
- keywords: tesla, model 3, elon, musk
6
- categories: muskified, nice3
7
- tags: tesla, model 3,Whale,cool, unpublished
8
- published: false
9
- ---
10
-
11
- How now brown cow.
@@ -1,13 +0,0 @@
1
- ---
2
- title: 'Article Simple'
3
- date: 2018-15-01
4
- ---
5
-
6
- ![](Images/Docula_%20Persistent%20Links%20and%20Styles%201.jpeg)
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 DELETED
@@ -1,11 +0,0 @@
1
- ---
2
- title: Article One
3
- author: John Smith
4
- url: the-largest-whale
5
- date: 2019-03-12
6
- keywords: large, Whale
7
- categories: ["foo", "mouse"]
8
- tags: Whale,ocean,Candle,blast
9
- ---
10
-
11
- My life as a blogger is really cool
package/init/article2.md DELETED
@@ -1,14 +0,0 @@
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
@@ -1,11 +0,0 @@
1
- ---
2
- {
3
- "title": "Big Content",
4
- "author": "Mr. Big",
5
- "url": "big-content-is-real",
6
- "date": "2017-11-08",
7
- "publishedAt": "",
8
- "keywords": "big, content, house",
9
- "tags": "aerospace, facts"
10
- }
11
- ---
package/init/config.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "output" : "./blog_output",
3
- "render": [ "html" , "json", "atom", "images"],
4
- "path": "./blog",
5
- "title": "Example Blog",
6
- "url": "https://writr.io/blog",
7
- "authorName": "Jared Wray",
8
- "authorEmail": "me@jaredwray.com"
9
- }
@@ -1,13 +0,0 @@
1
- ---
2
- title: 'Article Perm'
3
- date: 2018-12-04
4
- permalink: '/foo/crazy/url/article-perm'
5
- ---
6
-
7
- ![](images/Docula_%20Persistent%20Links%20and%20Styles%201.jpeg)
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
-
@@ -1,13 +0,0 @@
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"}}
@@ -1,2 +0,0 @@
1
-
2
- Header: {{post.title}}
@@ -1,19 +0,0 @@
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>
@@ -1,17 +0,0 @@
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>
@@ -1,7 +0,0 @@
1
- <h1>Post 3</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>
@@ -1,9 +0,0 @@
1
-
2
-
3
- <p>Tag:
4
- {{tag.name}}<br /></p>
5
-
6
- <ul>
7
- {{#each tag.posts}}
8
- <li>{{title}} - {{author}}</li>{{/each}}
9
- </ul>