vowel 0.0.2 → 0.1.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 (82) hide show
  1. package/.prettierrc +8 -0
  2. package/.vscode/settings.json +3 -0
  3. package/README.md +123 -27
  4. package/bin.js +30 -0
  5. package/content/.cache.json +627 -0
  6. package/content/.obsidian/app.json +3 -0
  7. package/content/.obsidian/appearance.json +3 -0
  8. package/content/.obsidian/core-plugins-migration.json +30 -0
  9. package/content/.obsidian/core-plugins.json +20 -0
  10. package/content/.obsidian/workspace.json +168 -0
  11. package/content/about.md +3 -0
  12. package/content/assets/open-props.css +1630 -0
  13. package/content/assets/styles-2.css +128 -0
  14. package/content/assets/styles-3.css +275 -0
  15. package/content/docs/file-structure.md +31 -0
  16. package/content/docs/folder-settings.md +22 -0
  17. package/content/docs/home.md +8 -0
  18. package/content/docs/images.md +10 -0
  19. package/content/docs/pages.md +64 -0
  20. package/content/docs/quickstart.md +52 -0
  21. package/content/docs/run-build-deploy.md +20 -0
  22. package/content/docs/settings.md +4 -0
  23. package/content/docs/styling.md +10 -0
  24. package/content/docs/taxonomies.md +37 -0
  25. package/content/home.md +73 -0
  26. package/content/roadmap.md +81 -0
  27. package/content/settings.md +12 -0
  28. package/content/vercel.json +5 -0
  29. package/jsconfig.json +18 -0
  30. package/package.json +37 -19
  31. package/server.js +80 -0
  32. package/src/app.d.ts +12 -0
  33. package/src/app.html +12 -0
  34. package/src/lib/components/Breadcrumbs.svelte +19 -0
  35. package/src/lib/components/DefaultStyles.svelte +126 -0
  36. package/src/lib/components/FrontMatterTaxonomy.svelte +48 -0
  37. package/src/lib/components/Frontmatter.svelte +54 -0
  38. package/src/lib/components/FrontmatterProperty.svelte +72 -0
  39. package/src/lib/components/Markdown/Image.svelte +48 -0
  40. package/src/lib/components/Markdown/Link.svelte +10 -0
  41. package/src/lib/components/Markdown/LinkPreview.svelte +39 -0
  42. package/src/lib/components/Markdown/Text.svelte +6 -0
  43. package/src/lib/components/Markdown/index.svelte +84 -0
  44. package/src/lib/components/Markdown/validators.js +29 -0
  45. package/src/lib/components/Nav.svelte +39 -0
  46. package/src/lib/components/Page.svelte +59 -0
  47. package/src/lib/components/Sitemap.svelte +38 -0
  48. package/src/lib/components/index.js +9 -0
  49. package/src/lib/index.js +1 -0
  50. package/src/lib/utilities/buildURL.js +18 -0
  51. package/src/lib/utilities/checkFileExists.js +16 -0
  52. package/src/lib/utilities/createFolderClass.js +4 -0
  53. package/src/lib/utilities/createPageClass.js +4 -0
  54. package/src/lib/utilities/getFileLabel.js +18 -0
  55. package/src/lib/utilities/getFolder.js +16 -0
  56. package/src/lib/utilities/getFolderLabel.js +8 -0
  57. package/src/lib/utilities/getPage.js +24 -0
  58. package/src/lib/utilities/getPagesByFolder.js +93 -0
  59. package/src/lib/utilities/index.js +20 -0
  60. package/src/lib/utilities/isActiveLink.js +12 -0
  61. package/src/lib/utilities/isObject.js +8 -0
  62. package/src/lib/utilities/loadCache.js +28 -0
  63. package/src/lib/utilities/mutateMarkdownAST.js +59 -0
  64. package/src/lib/utilities/mutateMarkdownFrontmatter.js +115 -0
  65. package/src/lib/utilities/parseDate.js +43 -0
  66. package/src/lib/utilities/processMarkdownFiles.js +212 -0
  67. package/src/lib/utilities/readMarkdownFile.js +134 -0
  68. package/src/lib/utilities/regexPatterns.js +12 -0
  69. package/src/lib/utilities/resolveHomeDirPath.js +5 -0
  70. package/src/lib/utilities/writeCache.js +14 -0
  71. package/src/routes/[...path]/+layout.server.js +71 -0
  72. package/src/routes/[...path]/+page.server.js +22 -0
  73. package/src/routes/[...path]/+page.svelte +125 -0
  74. package/src/routes/feed.xml/+server.js +120 -0
  75. package/src/routes/robots.txt/+server.js +54 -0
  76. package/src/routes/sitemap.xml/+server.js +68 -0
  77. package/static/favicon.png +0 -0
  78. package/static/styles.css +0 -0
  79. package/svelte.config.js +32 -0
  80. package/vercel.json +5 -0
  81. package/vite.config.js +72 -0
  82. package/index.js +0 -28
package/.prettierrc ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "useTabs": true,
3
+ "singleQuote": true,
4
+ "trailingComma": "none",
5
+ "printWidth": 100,
6
+ "plugins": ["prettier-plugin-svelte"],
7
+ "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
8
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "files.autoSaveDelay": 1
3
+ }
package/README.md CHANGED
@@ -1,40 +1,136 @@
1
- # Vowel
1
+ ## MVP
2
2
 
3
- Tiny library for working with vowels.
3
+ - [x] Add all element types supported in Obsidian to markdown
4
+ - [x] Add rich link previews
5
+ - [x] Add RSS
6
+ - [x] Add robots.txt
7
+ - [x] AI
8
+ - [x] Search
9
+ - [x] Image
10
+ - [x] Typing
11
+ - [x] Add sitemap
12
+ - [x] Make taxonomies linkable in frontmatter (if a corresponding folder exists)
13
+ - [x] Add header metadata (meta tags)
14
+ - [x] CSS handling
15
+ - [x] Favicon handling
16
+ - [x] Docs
17
+ - [x] Build action
4
18
 
5
- ## Install
19
+ ## V2
6
20
 
7
- ```
8
- $ npm install vowel
9
- ```
21
+ - [x] Fallback homepages
22
+ - [ ] Create post list element (`#tags/blue`, `@tags/blue`, `~tags/blue`)
23
+ - [x] Better favicon and styles handling
24
+ - [ ] Ignore README files
25
+ - [ ] Add more header metadata
26
+ - [ ] Define folder settings
27
+ - [ ] Title
28
+ - [ ] Breadrumb
29
+ - [x] Define special page properties
30
+ - [x] Title
31
+ - [x] Description
32
+ - [x] Meta image
33
+ - [x] Date
34
+ - [ ] Modified date
35
+ - [ ] Tags
36
+ - [ ] Author/Authors
37
+ - [ ] Make file names kebab-cased for URLs and links
38
+ - [ ] Add hidden routes (`$`)
39
+ - [ ] Image alt text
40
+ - [ ] Code highlighter
41
+ - [x] Deploy action (Vercel)
42
+ - [ ] Add anchor links for headings
43
+ - [ ] Post TOC
44
+ - [ ] GitHub-style notes
45
+ - [ ] Add in-browser search
46
+ - [x] Figure out how to stop components from remounting on every change
47
+ - [ ] Make RSS optional
48
+ - [ ] Pagination
49
+ - [ ] Demote headings global option
50
+
51
+ ## Wish list
52
+
53
+ - [ ] Automatic file creation
54
+ - [ ] Image serving and optimization
55
+ - [ ] GUI
56
+ - [ ] More deploy actions
57
+ - [ ] Optional JSON interactivity (ratings, comments, SubPubHub)
58
+ - [ ] Redirects
59
+ - [ ] Advanced markdown
60
+ - [ ] Highlight
61
+ - [ ] Sanitize
62
+ - [ ] Tables
63
+ - [ ] Strike
64
+ - [ ] Task lists
65
+ - [ ] Footnotes
66
+ - [ ] Mermaid
67
+ - [ ] Math
68
+ - [ ] Wikilinks
69
+
70
+ ## Ideas
71
+
72
+ https://github.com/arobase-che/remark-attr
73
+ https://github.com/wataru-chocola/remark-definition-list
74
+ https://github.com/FinnRG/remark-mentions
75
+ https://github.com/remarkjs/remark-toc
76
+
77
+ - Docusaurus
78
+ - MkDocs
79
+ - Coolify
80
+ - NodeGui
81
+
82
+ https://www.nngroup.com/articles/breadcrumb-navigation-useful/
83
+ https://www.nngroup.com/articles/url-as-ui/
10
84
 
11
- ## Usage
85
+ CSS Frameworks:
12
86
 
13
- ```js
14
- const vowel = require('vowel');
87
+ - Open Props
88
+ - Pico
89
+ - Milligram
90
+ - Spectre
15
91
 
16
- const { vowels } = vowel;
17
- //=> ['a', 'e', 'i', 'o', 'u']
92
+ ## Docs
18
93
 
19
- const { isVowel } = vowel;
20
- isVowel('o');
21
- //=> true
94
+ Welcome to Vowel! This project is under development.
22
95
 
23
- const { includesVowel } = vowel;
24
- includesVowel('rhythms');
25
- //=> false
96
+ Vowel is a Really Simple Static Site Generator. Write Markdown files, and Vowel will generate a website for you. Eventually, you will also be able to write a `style.css` file to style your website. When complete, Vowel will generate:
26
97
 
27
- const { startsWithVowel } = vowel;
28
- startsWithVowel('xylophone');
29
- //=> false
98
+ - An RSS feed
99
+ - A sitemap
100
+ - Rich link previews (internal and external)
101
+ - Post lists
102
+ - Navigation
103
+ - Optimized images
104
+ - Metadata
105
+ - And more
30
106
 
31
- const { endsWithVowel } = vowel;
32
- endsWithVowel('persiflage');
33
- //=> true
107
+ Each file in Vowel is a page. Index pages are called `home.md`.
108
+
109
+ ```
110
+ .
111
+ ├── home.md
112
+ ├── settings.md
113
+ ├── about.md
114
+ └── posts/
115
+ ├── home.md
116
+ ├── red-car.md
117
+ ├── blue-true.md
118
+ └── green-van.md
34
119
  ```
35
120
 
36
- #
121
+ In the above project, `/home.md` is the website homepage. `about.md` is `/about`, `/posts/home.md` is the blog homepage, `/blog`, and `/posts/red-car.md` is a blog post, `/posts/red-car`.
122
+
123
+ Every folder must have an index page. That means that there are two ways to represent a page:
124
+
125
+ - `/example-page.md`
126
+ - `/example-page/home.md`
127
+ Both of the above will generate the `/example-page` URL. You cannot have both files.
128
+
129
+ At the root of a project, a `settings.md` file defines global configurations, like your site title. It can have the following properties:
130
+
131
+ - `title`: Website title
132
+ - `breadcrumb`: The root breadcrumb
133
+
134
+ Each folder can also have a `settings.md` file, with the following properties:
37
135
 
38
- <p align="center">
39
- <a href="http://paco.sh"><img src="https://raw.githubusercontent.com/pacocoursey/pacocoursey.github.io/master/footer.png" height="300"></a>
40
- </p>
136
+ - `breadcrumb`: The breadcrumb for the folder
package/bin.js ADDED
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { execSync, spawn } from 'child_process';
4
+ import path from 'node:path';
5
+ import url from 'node:url';
6
+
7
+ // Directory where the module is
8
+ const binURL = import.meta.url;
9
+ const binFilePath = url.fileURLToPath(binURL);
10
+ const binDirName = path.dirname(binFilePath);
11
+
12
+ // Directory where the command was called
13
+ const homeDir = process.cwd();
14
+
15
+ // Args: File to run, home directory,
16
+ const child = spawn('node', ['./server.js', homeDir, process.argv[2] === 'build'], {
17
+ cwd: binDirName
18
+ });
19
+
20
+ child.stdout.on('data', (data) => {
21
+ console.log(`${data}`);
22
+ });
23
+
24
+ child.stderr.on('data', (data) => {
25
+ console.error(`${data}`);
26
+ });
27
+
28
+ child.on('close', (code) => {
29
+ console.log(`child process exited with code ${code}`);
30
+ });