vowel 0.2.5 → 0.3.1

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vowel",
3
3
  "type": "module",
4
- "version": "0.2.5",
4
+ "version": "0.3.1",
5
5
  "bin": "bin.js",
6
6
  "main": "index.js",
7
7
  "scripts": {
@@ -47,6 +47,7 @@
47
47
  "postcss": "^8.5.9",
48
48
  "rehype": "^13.0.2",
49
49
  "rehype-document": "^7.0.3",
50
+ "rehype-github-alert": "^1.0.0",
50
51
  "rehype-parse": "^9.0.1",
51
52
  "rehype-preset-minify": "^7.0.1",
52
53
  "rehype-slug": "^6.0.0",
@@ -66,8 +67,8 @@
66
67
  "unist-util-visit": "^5.0.0",
67
68
  "unist-util-visit-parents": "^6.0.0",
68
69
  "url-metadata": "^5.4.1",
69
- "voot": "^0.0.5",
70
- "votive": "^0.0.6",
70
+ "voot": "^0.1.0",
71
+ "votive": "^0.1.0",
71
72
  "xast-util-sitemap": "^2.0.0",
72
73
  "xast-util-to-xml": "^4.0.0",
73
74
  "xml": "^1.0.1",
@@ -13,6 +13,7 @@ import { gfmFootnoteFromMarkdown } from "mdast-util-gfm-footnote"
13
13
  import { gfmStrikethrough } from 'micromark-extension-gfm-strikethrough'
14
14
  import { gfmStrikethroughFromMarkdown } from 'mdast-util-gfm-strikethrough'
15
15
  import { gfmTable } from 'micromark-extension-gfm-table'
16
+ import rehypeGithubAlert from "rehype-github-alert"
16
17
  import { gfmTableFromMarkdown } from 'mdast-util-gfm-table'
17
18
  import { h } from 'hastscript'
18
19
  import { normalizeHeadings } from 'mdast-normalize-headings'
@@ -903,9 +904,8 @@ function writeHTML(destination, database, config) {
903
904
  treeContent
904
905
  ])
905
906
 
906
- /* URL handling */
907
907
  visit(treeMain, (node, index, parent) => {
908
- if (node.type === "text" && parent.tagName === 'p' && parent.children.length === 1) {
908
+ /* URLs */ if (node.type === "text" && parent.tagName === 'p' && parent.children.length === 1) {
909
909
  const validURL = testURL(node.value)
910
910
  if (validURL) {
911
911
  const metadata = database.url.get(node.value)
@@ -918,6 +918,35 @@ function writeHTML(destination, database, config) {
918
918
  ]
919
919
  }
920
920
  }
921
+ } /* GFM Alerts */ else if (node.tagName === "blockquote") {
922
+ if (node.children[1]
923
+ && node.children[1].tagName === "p"
924
+ && node.children[1].children.length === 1
925
+ && node.children[1].children[0].type === "text"
926
+ ) {
927
+ const matches = node.children[1].children[0].value.match(/^\[!(\w+)\]$/)
928
+
929
+ if (matches) {
930
+ const [_, alertLabel] = matches
931
+
932
+ node.tagName = "aside"
933
+ node.properties = {
934
+ class: `alert ${alertLabel}`
935
+ }
936
+
937
+ node.children.splice(0, 2, {
938
+ type: "element",
939
+ tagName: "h1",
940
+ children: [
941
+ {
942
+ value: toTitleCase(alertLabel),
943
+ type: "text"
944
+ }
945
+ ]
946
+ })
947
+ }
948
+
949
+ }
921
950
  }
922
951
  })
923
952
 
@@ -1027,7 +1056,6 @@ function writeHTML(destination, database, config) {
1027
1056
  ]
1028
1057
  )
1029
1058
 
1030
-
1031
1059
  const data = unified()
1032
1060
  .use(rehypePresetMinify)
1033
1061
  .use(rehypeStringify)
package/404.md DELETED
@@ -1,3 +0,0 @@
1
- # Page not found
2
-
3
- Want to create your own 404 page with Vowel? Write a 404.md file.
@@ -1,11 +0,0 @@
1
- > Why do I have a folder named ".vercel" in my project?
2
- The ".vercel" folder is created when you link a directory to a Vercel project.
3
-
4
- > What does the "project.json" file contain?
5
- The "project.json" file contains:
6
- - The ID of the Vercel project that you linked ("projectId")
7
- - The ID of the user or team your Vercel project is owned by ("orgId")
8
-
9
- > Should I commit the ".vercel" folder?
10
- No, you should not share the ".vercel" folder with anyone.
11
- Upon creation, it will be automatically added to your ".gitignore" file.
@@ -1 +0,0 @@
1
- {"projectId":"prj_4CUiAmqACnAFX1cjGqW5om7DbK4E","orgId":"team_CpFUbX79Msg6m5IOy2BzFxEE"}