writr 1.9.11 → 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 (52) 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/init/article-complex.md +0 -40
  35. package/init/article-ejs.md +0 -40
  36. package/init/article-unpublished.md +0 -11
  37. package/init/article1-simple.md +0 -13
  38. package/init/article1.md +0 -11
  39. package/init/article2.md +0 -14
  40. package/init/big-content.md +0 -11
  41. package/init/config.json +0 -9
  42. package/init/images/Introducing Docula 1.png +0 -0
  43. package/init/images/Introducing Docula 2.jpeg +0 -0
  44. package/init/images/Introducing Docula 3.png +0 -0
  45. package/init/images/Introducing Docula 4.png +0 -0
  46. package/init/permalink-test.md +0 -13
  47. package/init/templates/index.hjs +0 -13
  48. package/init/templates/partials/header.hjs +0 -2
  49. package/init/templates/post.hjs +0 -19
  50. package/init/templates/post2.hjs +0 -17
  51. package/init/templates/post3.ejs +0 -7
  52. package/init/templates/tag.hjs +0 -9
@@ -0,0 +1,10 @@
1
+ <footer>
2
+ Powered by
3
+ <a href="https://writr.org/" target="_blank" rel="noopener noreferrer"><img
4
+ src="/logo.svg"
5
+ alt="Writr logo"
6
+ width="122"
7
+ height="32"
8
+ />
9
+ </a>
10
+ </footer>
@@ -0,0 +1,17 @@
1
+ <meta charset="UTF-8" />
2
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
3
+ <link rel="stylesheet" href="/css/variables.css" />
4
+ <link rel="stylesheet" href="/css/index.css" />
5
+ <link rel="stylesheet" href="/css/home.css" />
6
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
7
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
8
+ <link
9
+ href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap"
10
+ rel="stylesheet"
11
+ />
12
+ <link
13
+ rel="stylesheet"
14
+ href="https://cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.2.3/gh-fork-ribbon.min.css"
15
+ />
16
+ <link rel="stylesheet" href="/css/highlight/styles/base16/dracula.min.css" />
17
+ <link rel="icon" href="/favicon.ico" />
@@ -0,0 +1,63 @@
1
+ <article class="home-container">
2
+ <div class="content">{{{content}}}</div>
3
+
4
+ {{#if github}}
5
+ {{#if github.contributors}}
6
+ <div class="content-container">
7
+ <h2 class="home-title">Contributors</h2>
8
+ <div class="facepile-container">
9
+ <div class="facepile">
10
+ {{#each github.contributors}}
11
+ <a
12
+ href="{{html_url}}"
13
+ target="_blank"
14
+ title="{{login}}"
15
+ rel="noopener noreferrer"
16
+ >
17
+ <img src="{{avatar_url}}" alt="{{login}}" />
18
+ </a>
19
+ {{/each}}
20
+ </div>
21
+ </div>
22
+ </div>
23
+ {{/if}}
24
+
25
+ {{#if github.releases}}
26
+ <div class="content-container">
27
+ <h2 class="home-title">Latest's Releases</h2>
28
+ {{#each github.releases as |release|}}
29
+ {{#if (lt @index 3)}}
30
+ <div class="release">
31
+ <div class="release-header">
32
+ <a
33
+ class="release-title"
34
+ href="{{release.html_url}}"
35
+ target="_blank"
36
+ rel="noopener noreferrer"
37
+ >{{release.name}}</a>
38
+ <span class="release-date">{{#moment
39
+ release.published_at "MMMM DD, yyyy"
40
+ }}{{/moment}}
41
+ </span>
42
+ </div>
43
+ <div class="release-body">
44
+ {{#if release.body}}
45
+ {{#markdown}}{{release.body}}{{/markdown}}
46
+ {{/if}}
47
+ </div>
48
+ </div>
49
+ {{/if}}
50
+ {{/each}}
51
+
52
+ {{#if (gt github.releases.length 6)}}
53
+ <div>
54
+ <a class="release-btn" href="/releases">
55
+ All Releases
56
+ <span>→</span>
57
+ </a>
58
+ </div>
59
+ {{/if}}
60
+ </div>
61
+ {{/if}}
62
+ {{/if}}
63
+ </article>
@@ -0,0 +1,3 @@
1
+ <header class="home-hero">
2
+ <img src="/logo.svg" alt="logo" />
3
+ </header>
@@ -0,0 +1,4 @@
1
+ <script src="/css/highlight/highlight.min.js"></script>
2
+ <script>
3
+ document.addEventListener('DOMContentLoaded', () => { hljs.highlightAll() });
4
+ </script>
@@ -0,0 +1,16 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ {{> header }}
5
+ <title>{{ siteTitle }}</title>
6
+ </head>
7
+
8
+ <body>
9
+ {{> landing/hero }}
10
+ <a class="github-fork-ribbon" href="https://github.com/jaredwray/writr" data-ribbon="Fork me on GitHub" title="Fork me on GitHub">Fork me on GitHub</a>
11
+ {{> landing/content }}
12
+ {{> footer}}
13
+
14
+ {{> scripts }}
15
+ </body>
16
+ </html>
@@ -0,0 +1,45 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ {{> header }}
5
+ <title>{{siteTitle}} Releases</title>
6
+ </head>
7
+
8
+ <body>
9
+ {{> landing/hero }}
10
+ <a class="github-fork-ribbon" href="https://github.com/jaredwray/writr" data-ribbon="Fork me on GitHub" title="Fork me on GitHub">Fork me on GitHub</a>
11
+ <main class="home-container">
12
+ <div class="content-container versions-container">
13
+ <h2 class="home-title">Releases</h2>
14
+ {{#if github}}
15
+ {{#if github.releases}}
16
+ {{#each github.releases as |release|}}
17
+ <div class="release">
18
+ <div class="release-header">
19
+ <a
20
+ class="release-title"
21
+ href="{{release.html_url}}"
22
+ target="_blank"
23
+ rel="noopener noreferrer"
24
+ >{{release.name}}</a>
25
+ <span class="release-date">{{#moment
26
+ release.published_at "MMMM DD, yyyy"
27
+ }}{{/moment}}
28
+ </span>
29
+ </div>
30
+ <div class="release-body">
31
+ {{#if release.body}}
32
+ {{#markdown}}{{release.body}}{{/markdown}}
33
+ {{/if}}
34
+ </div>
35
+ </div>
36
+ {{/each}}
37
+ {{/if}}
38
+ {{/if}}
39
+ </div>
40
+ </main>
41
+ {{> footer}}
42
+
43
+ {{> scripts }}
44
+ </body>
45
+ </html>
package/bin/writr.js DELETED
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env ts-node --esm --inspect --experimental-specifier-resolution=node --es-module-specifier-resolution=node
2
-
3
- import {Writr} from "../dist/index.js";
4
-
5
- const writr = new Writr();
6
-
7
- writr.parseCLI(process);
@@ -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>