docula 0.3.7 → 0.4.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 (181) hide show
  1. package/README.md +108 -39
  2. package/bin/docula.mjs +8 -0
  3. package/dist/builder.d.ts +34 -0
  4. package/dist/builder.js +182 -0
  5. package/dist/console.d.ts +22 -0
  6. package/dist/console.js +120 -0
  7. package/dist/docula.d.ts +22 -22
  8. package/dist/docula.js +125 -174
  9. package/dist/github.d.ts +22 -0
  10. package/dist/github.js +74 -0
  11. package/dist/helpers/markdown.d.ts +10 -0
  12. package/dist/helpers/markdown.js +24 -0
  13. package/dist/helpers.d.ts +7 -0
  14. package/dist/helpers.js +58 -0
  15. package/dist/options.d.ts +12 -0
  16. package/dist/options.js +47 -0
  17. package/init/docula.config.cjs +10 -0
  18. package/init/favicon.ico +0 -0
  19. package/init/logo.png +0 -0
  20. package/init/variables.css +30 -0
  21. package/package.json +58 -91
  22. package/{templates/default/assets/css/styles → template/css}/home.css +20 -18
  23. package/{init/_includes/assets/css/styles → template/css}/index.css +7 -0
  24. package/template/includes/footer.hbs +10 -0
  25. package/template/includes/header.hbs +17 -0
  26. package/template/includes/landing/content.hbs +63 -0
  27. package/template/includes/landing/hero.hbs +3 -0
  28. package/template/includes/scripts.hbs +4 -0
  29. package/template/index.hbs +16 -0
  30. package/template/releases.hbs +45 -0
  31. package/bin/docula.js +0 -7
  32. package/dist/config.d.ts +0 -21
  33. package/dist/config.d.ts.map +0 -1
  34. package/dist/config.js +0 -78
  35. package/dist/config.js.map +0 -1
  36. package/dist/docula-plugin.d.ts +0 -9
  37. package/dist/docula-plugin.d.ts.map +0 -1
  38. package/dist/docula-plugin.js +0 -2
  39. package/dist/docula-plugin.js.map +0 -1
  40. package/dist/docula.d.ts.map +0 -1
  41. package/dist/docula.js.map +0 -1
  42. package/dist/eleventy/filters.d.ts +0 -2
  43. package/dist/eleventy/filters.d.ts.map +0 -1
  44. package/dist/eleventy/filters.js +0 -10
  45. package/dist/eleventy/filters.js.map +0 -1
  46. package/dist/eleventy/global-data.d.ts +0 -3
  47. package/dist/eleventy/global-data.d.ts.map +0 -1
  48. package/dist/eleventy/global-data.js +0 -2
  49. package/dist/eleventy/global-data.js.map +0 -1
  50. package/dist/eleventy/shortcodes.d.ts +0 -4
  51. package/dist/eleventy/shortcodes.d.ts.map +0 -1
  52. package/dist/eleventy/shortcodes.js +0 -18
  53. package/dist/eleventy/shortcodes.js.map +0 -1
  54. package/dist/eleventy.d.ts +0 -24
  55. package/dist/eleventy.d.ts.map +0 -1
  56. package/dist/eleventy.js +0 -82
  57. package/dist/eleventy.js.map +0 -1
  58. package/dist/index.d.ts +0 -9
  59. package/dist/index.d.ts.map +0 -1
  60. package/dist/index.js +0 -67
  61. package/dist/index.js.map +0 -1
  62. package/dist/logger.d.ts +0 -4
  63. package/dist/logger.d.ts.map +0 -1
  64. package/dist/logger.js +0 -20
  65. package/dist/logger.js.map +0 -1
  66. package/dist/plugins/algolia.d.ts +0 -21
  67. package/dist/plugins/algolia.d.ts.map +0 -1
  68. package/dist/plugins/algolia.js +0 -54
  69. package/dist/plugins/algolia.js.map +0 -1
  70. package/dist/plugins/github.d.ts +0 -16
  71. package/dist/plugins/github.d.ts.map +0 -1
  72. package/dist/plugins/github.js +0 -68
  73. package/dist/plugins/github.js.map +0 -1
  74. package/dist/plugins/index.d.ts +0 -18
  75. package/dist/plugins/index.d.ts.map +0 -1
  76. package/dist/plugins/index.js +0 -16
  77. package/dist/plugins/index.js.map +0 -1
  78. package/dist/plugins/npm.d.ts +0 -14
  79. package/dist/plugins/npm.d.ts.map +0 -1
  80. package/dist/plugins/npm.js +0 -36
  81. package/dist/plugins/npm.js.map +0 -1
  82. package/dist/plugins/pagefind.d.ts +0 -10
  83. package/dist/plugins/pagefind.d.ts.map +0 -1
  84. package/dist/plugins/pagefind.js +0 -22
  85. package/dist/plugins/pagefind.js.map +0 -1
  86. package/dist/plugins/robots.d.ts +0 -14
  87. package/dist/plugins/robots.d.ts.map +0 -1
  88. package/dist/plugins/robots.js +0 -34
  89. package/dist/plugins/robots.js.map +0 -1
  90. package/dist/plugins/sitemap.d.ts +0 -11
  91. package/dist/plugins/sitemap.d.ts.map +0 -1
  92. package/dist/plugins/sitemap.js +0 -27
  93. package/dist/plugins/sitemap.js.map +0 -1
  94. package/dist/schemas.d.ts +0 -21
  95. package/dist/schemas.d.ts.map +0 -1
  96. package/dist/schemas.js +0 -25
  97. package/dist/schemas.js.map +0 -1
  98. package/dist/tools/__mocks__/inquirer-prompt.d.ts +0 -20
  99. package/dist/tools/__mocks__/inquirer-prompt.d.ts.map +0 -1
  100. package/dist/tools/__mocks__/inquirer-prompt.js +0 -19
  101. package/dist/tools/__mocks__/inquirer-prompt.js.map +0 -1
  102. package/dist/tools/__mocks__/path.d.ts +0 -5
  103. package/dist/tools/__mocks__/path.d.ts.map +0 -1
  104. package/dist/tools/__mocks__/path.js +0 -7
  105. package/dist/tools/__mocks__/path.js.map +0 -1
  106. package/dist/tools/inquirer-prompt.d.ts +0 -11
  107. package/dist/tools/inquirer-prompt.d.ts.map +0 -1
  108. package/dist/tools/inquirer-prompt.js +0 -139
  109. package/dist/tools/inquirer-prompt.js.map +0 -1
  110. package/dist/tools/path.d.ts +0 -4
  111. package/dist/tools/path.d.ts.map +0 -1
  112. package/dist/tools/path.js +0 -6
  113. package/dist/tools/path.js.map +0 -1
  114. package/dist/tools/tools.d.ts +0 -3
  115. package/dist/tools/tools.d.ts.map +0 -1
  116. package/dist/tools/tools.js +0 -10
  117. package/dist/tools/tools.js.map +0 -1
  118. package/dist/types/config.d.ts +0 -8
  119. package/dist/types/config.d.ts.map +0 -1
  120. package/dist/types/config.js +0 -2
  121. package/dist/types/config.js.map +0 -1
  122. package/init/_data/site.json +0 -5
  123. package/init/_includes/assets/css/styles/home.css +0 -305
  124. package/init/_includes/assets/css/styles/search/algolia.css +0 -125
  125. package/init/_includes/assets/css/styles/search/pagefind.css +0 -60
  126. package/init/_includes/assets/css/styles/variables.css +0 -30
  127. package/init/_includes/assets/images/docula-logo-horizontal.webp +0 -0
  128. package/init/_includes/assets/images/logo.svg +0 -10
  129. package/init/_includes/doc.njk +0 -22
  130. package/init/_includes/landing/landingHero.njk +0 -8
  131. package/init/_includes/landing/singlePage.njk +0 -24
  132. package/init/_includes/multipage/header.njk +0 -23
  133. package/init/_includes/multipage/homeHeader.njk +0 -20
  134. package/init/_includes/multipage/main.njk +0 -47
  135. package/init/_includes/multipage/scripts.njk +0 -47
  136. package/init/_includes/multipage/searchEngine.njk +0 -5
  137. package/init/_includes/multipage/searchModal.njk +0 -19
  138. package/init/_includes/multipage/sidebar.njk +0 -50
  139. package/init/_includes/search/algolia.njk +0 -98
  140. package/init/_includes/search/pagefind.njk +0 -66
  141. package/init/_includes/shared/footer.njk +0 -4
  142. package/init/_includes/shared/head.njk +0 -15
  143. package/init/_includes/shared/highlightScript.njk +0 -6
  144. package/init/_includes/shared/homeData.njk +0 -49
  145. package/init/api/Readme.md +0 -3
  146. package/init/docs/Readme.md +0 -83
  147. package/init/docs/docs.json +0 -13
  148. package/init/index.njk +0 -28
  149. package/init/releases.njk +0 -38
  150. package/init/search-index.md +0 -14
  151. package/init/versions.njk +0 -40
  152. package/templates/default/assets/css/highlight/highlight.min.js +0 -1433
  153. package/templates/default/assets/css/highlight/styles/base16/dracula.min.css +0 -7
  154. package/templates/default/assets/css/styles/index.css +0 -912
  155. package/templates/default/assets/css/styles/search/algolia.css +0 -125
  156. package/templates/default/assets/css/styles/search/pagefind.css +0 -60
  157. package/templates/default/assets/css/styles/variables.css +0 -30
  158. package/templates/default/assets/images/docula-logo-horizontal.webp +0 -0
  159. package/templates/default/assets/images/logo.svg +0 -10
  160. package/templates/default/doc.njk +0 -22
  161. package/templates/default/index.njk +0 -28
  162. package/templates/default/landing/landingHero.njk +0 -8
  163. package/templates/default/landing/singlePage.njk +0 -24
  164. package/templates/default/multipage/header.njk +0 -23
  165. package/templates/default/multipage/homeHeader.njk +0 -20
  166. package/templates/default/multipage/main.njk +0 -47
  167. package/templates/default/multipage/scripts.njk +0 -47
  168. package/templates/default/multipage/searchEngine.njk +0 -5
  169. package/templates/default/multipage/searchModal.njk +0 -19
  170. package/templates/default/multipage/sidebar.njk +0 -50
  171. package/templates/default/releases.njk +0 -38
  172. package/templates/default/search/algolia.njk +0 -98
  173. package/templates/default/search/pagefind.njk +0 -66
  174. package/templates/default/search-index.md +0 -14
  175. package/templates/default/shared/footer.njk +0 -4
  176. package/templates/default/shared/head.njk +0 -15
  177. package/templates/default/shared/highlightScript.njk +0 -6
  178. package/templates/default/shared/homeData.njk +0 -49
  179. package/templates/default/versions.njk +0 -40
  180. /package/{init/_includes/assets → template}/css/highlight/highlight.min.js +0 -0
  181. /package/{init/_includes/assets → template}/css/highlight/styles/base16/dracula.min.css +0 -0
@@ -1,139 +0,0 @@
1
- import inquirer from 'inquirer';
2
- import { urlRegex } from './tools.js';
3
- export const getGithubInfo = async () => inquirer.prompt([
4
- {
5
- type: 'input',
6
- name: 'author',
7
- message: 'What is your GitHub username?',
8
- }, {
9
- type: 'input',
10
- name: 'repo',
11
- message: 'What is your GitHub repository\'s name?',
12
- },
13
- ]);
14
- export const validateUrl = (value) => {
15
- const trimmed = value.trim();
16
- if (trimmed.length > 0 && urlRegex.test(trimmed)) {
17
- return true;
18
- }
19
- return 'Please enter a complete URL.';
20
- };
21
- export const getSiteUrl = async () => {
22
- const siteAnswer = await inquirer.prompt([
23
- {
24
- type: 'input',
25
- name: 'url',
26
- message: 'What is the URL of your site?',
27
- validate: validateUrl,
28
- },
29
- ]);
30
- return siteAnswer.url;
31
- };
32
- export const getUserPlugins = async () => {
33
- const userPlugins = await inquirer.prompt([
34
- {
35
- type: 'checkbox',
36
- name: 'plugins',
37
- message: 'Select the plugins you want to use',
38
- choices: [
39
- {
40
- name: 'github',
41
- value: 'github',
42
- }, {
43
- name: 'robots.txt',
44
- value: 'robots',
45
- }, {
46
- name: 'sitemap.xml',
47
- value: 'sitemap',
48
- },
49
- ],
50
- },
51
- ]);
52
- return userPlugins.plugins;
53
- };
54
- export const getSearchEngine = async () => {
55
- const searchEngine = await inquirer.prompt([
56
- {
57
- type: 'list',
58
- name: 'engine',
59
- message: 'Which search engine do you want to use?',
60
- choices: ['Algolia', 'Pagefind'],
61
- default: 'Pagefind',
62
- filter(value) {
63
- return value.toLowerCase();
64
- },
65
- },
66
- ]);
67
- return searchEngine.engine;
68
- };
69
- export const getAlgoliaInfo = async () => inquirer.prompt([
70
- {
71
- type: 'input',
72
- name: 'appId',
73
- message: 'What is your Algolia application ID?',
74
- },
75
- {
76
- type: 'input',
77
- name: 'apiKey',
78
- message: 'What is your Algolia API key?',
79
- },
80
- {
81
- type: 'input',
82
- name: 'indexName',
83
- message: 'What is your Algolia index name?',
84
- },
85
- ]);
86
- export const getSiteType = async () => {
87
- const siteType = await inquirer.prompt([
88
- {
89
- type: 'list',
90
- name: 'type',
91
- message: 'What type of site do you want to build?',
92
- choices: ['Landing', 'Multi page'],
93
- default: 'Multi page',
94
- filter(value) {
95
- return value.toLowerCase();
96
- },
97
- },
98
- ]);
99
- return siteType.type;
100
- };
101
- export const buildLandingPage = async () => {
102
- let githubInfo;
103
- const siteUrl = await getSiteUrl();
104
- const plugins = await getUserPlugins();
105
- if (plugins.includes('github')) {
106
- githubInfo = await getGithubInfo();
107
- }
108
- return {
109
- siteUrl,
110
- plugins,
111
- ...(githubInfo && { github: githubInfo }),
112
- };
113
- };
114
- export const buildMultipageSite = async () => {
115
- let githubInfo;
116
- let algoliaInfo;
117
- const siteUrl = await getSiteUrl();
118
- const searchEngine = await getSearchEngine();
119
- const plugins = await getUserPlugins();
120
- if (searchEngine === 'algolia') {
121
- algoliaInfo = await getAlgoliaInfo();
122
- }
123
- if (plugins.includes('github')) {
124
- githubInfo = await getGithubInfo();
125
- }
126
- return {
127
- siteUrl,
128
- searchEngine,
129
- plugins: [...plugins, searchEngine],
130
- ...(githubInfo && { github: githubInfo }),
131
- ...(algoliaInfo && { algolia: algoliaInfo }),
132
- };
133
- };
134
- export const setPlugins = async () => {
135
- const siteType = await getSiteType();
136
- const config = await (siteType.includes('landing') ? buildLandingPage() : buildMultipageSite());
137
- return { siteType, ...config };
138
- };
139
- //# sourceMappingURL=inquirer-prompt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inquirer-prompt.js","sourceRoot":"","sources":["../../src/tools/inquirer-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,IAAqC,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC;IACzF;QACC,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,+BAA+B;KACxC,EAAE;QACF,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,yCAAyC;KAClD;CACD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAa,EAAoB,EAAE;IAC9D,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAClD,OAAO,IAAI,CAAC;IACb,CAAC;IAED,OAAO,8BAA8B,CAAC;AACvC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,IAAqB,EAAE;IACrD,MAAM,UAAU,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;QACxC;YACC,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,KAAK;YACX,OAAO,EAAE,+BAA+B;YACxC,QAAQ,EAAE,WAAW;SACrB;KACD,CAAC,CAAC;IACH,OAAO,UAAU,CAAC,GAAG,CAAC;AACvB,CAAC,CAAC;AAEF,MAAM,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AAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QAChC,UAAU,GAAG,MAAM,aAAa,EAAE,CAAC;IACpC,CAAC;IAED,OAAO;QACN,OAAO;QACP,YAAY;QACZ,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,YAAY,CAAC;QACnC,GAAG,CAAC,UAAU,IAAI,EAAC,MAAM,EAAE,UAAU,EAAC,CAAC;QACvC,GAAG,CAAC,WAAW,IAAI,EAAC,OAAO,EAAE,WAAW,EAAC,CAAC;KAC1C,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,IAAsC,EAAE;IACtE,MAAM,QAAQ,GAAG,MAAM,WAAW,EAAE,CAAC;IACrC,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAEhG,OAAO,EAAC,QAAQ,EAAE,GAAG,MAAM,EAAC,CAAC;AAC9B,CAAC,CAAC","sourcesContent":["import inquirer from 'inquirer';\nimport {urlRegex} from './tools.js';\n\nexport const getGithubInfo = async (): Promise<Record<string, string>> => inquirer.prompt([\n\t{\n\t\ttype: 'input',\n\t\tname: 'author',\n\t\tmessage: 'What is your GitHub username?',\n\t}, {\n\t\ttype: 'input',\n\t\tname: 'repo',\n\t\tmessage: 'What is your GitHub repository\\'s name?',\n\t},\n]);\n\nexport const validateUrl = (value: string): boolean | string => {\n\tconst trimmed = value.trim();\n\tif (trimmed.length > 0 && urlRegex.test(trimmed)) {\n\t\treturn true;\n\t}\n\n\treturn 'Please enter a complete URL.';\n};\n\nexport const getSiteUrl = async (): Promise<string> => {\n\tconst siteAnswer = await inquirer.prompt([\n\t\t{\n\t\t\ttype: 'input',\n\t\t\tname: 'url',\n\t\t\tmessage: 'What is the URL of your site?',\n\t\t\tvalidate: validateUrl,\n\t\t},\n\t]);\n\treturn siteAnswer.url;\n};\n\nexport const getUserPlugins = async (): Promise<string[]> => {\n\tconst userPlugins = await inquirer.prompt([\n\t\t{\n\t\t\ttype: 'checkbox',\n\t\t\tname: 'plugins',\n\t\t\tmessage: 'Select the plugins you want to use',\n\t\t\tchoices: [\n\t\t\t\t{\n\t\t\t\t\tname: 'github',\n\t\t\t\t\tvalue: 'github',\n\t\t\t\t}, {\n\t\t\t\t\tname: 'robots.txt',\n\t\t\t\t\tvalue: 'robots',\n\t\t\t\t}, {\n\t\t\t\t\tname: 'sitemap.xml',\n\t\t\t\t\tvalue: 'sitemap',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t]);\n\treturn userPlugins.plugins;\n};\n\nexport const getSearchEngine = async (): Promise<'algolia' | 'pagefind'> => {\n\tconst searchEngine = await inquirer.prompt([\n\t\t{\n\t\t\ttype: 'list',\n\t\t\tname: 'engine',\n\t\t\tmessage: 'Which search engine do you want to use?',\n\t\t\tchoices: ['Algolia', 'Pagefind'],\n\t\t\tdefault: 'Pagefind',\n\t\t\tfilter(value: string): string {\n\t\t\t\treturn value.toLowerCase();\n\t\t\t},\n\t\t},\n\t]);\n\treturn searchEngine.engine;\n};\n\nexport const getAlgoliaInfo = async (): Promise<Record<string, string>> => inquirer.prompt([\n\t{\n\t\ttype: 'input',\n\t\tname: 'appId',\n\t\tmessage: 'What is your Algolia application ID?',\n\t},\n\t{\n\t\ttype: 'input',\n\t\tname: 'apiKey',\n\t\tmessage: 'What is your Algolia API key?',\n\t},\n\t{\n\t\ttype: 'input',\n\t\tname: 'indexName',\n\t\tmessage: 'What is your Algolia index name?',\n\t},\n]);\n\nexport const getSiteType = async (): Promise<'landing' | 'multipage'> => {\n\tconst siteType = await inquirer.prompt([\n\t\t{\n\t\t\ttype: 'list',\n\t\t\tname: 'type',\n\t\t\tmessage: 'What type of site do you want to build?',\n\t\t\tchoices: ['Landing', 'Multi page'],\n\t\t\tdefault: 'Multi page',\n\t\t\tfilter(value: string): string {\n\t\t\t\treturn value.toLowerCase();\n\t\t\t},\n\t\t},\n\t]);\n\treturn siteType.type;\n};\n\nexport const buildLandingPage = async (): Promise<Record<string, unknown>> => {\n\tlet githubInfo: Record<string, string> | undefined;\n\tconst siteUrl = await getSiteUrl();\n\tconst plugins = await getUserPlugins();\n\n\tif (plugins.includes('github')) {\n\t\tgithubInfo = await getGithubInfo();\n\t}\n\n\treturn {\n\t\tsiteUrl,\n\t\tplugins,\n\t\t...(githubInfo && {github: githubInfo}),\n\t};\n};\n\nexport const buildMultipageSite = async (): Promise<Record<string, unknown>> => {\n\tlet githubInfo: Record<string, string> | undefined;\n\tlet algoliaInfo: Record<string, string> | undefined;\n\tconst siteUrl = await getSiteUrl();\n\tconst searchEngine = await getSearchEngine();\n\tconst plugins = await getUserPlugins();\n\n\tif (searchEngine === 'algolia') {\n\t\talgoliaInfo = await getAlgoliaInfo();\n\t}\n\n\tif (plugins.includes('github')) {\n\t\tgithubInfo = await getGithubInfo();\n\t}\n\n\treturn {\n\t\tsiteUrl,\n\t\tsearchEngine,\n\t\tplugins: [...plugins, searchEngine],\n\t\t...(githubInfo && {github: githubInfo}),\n\t\t...(algoliaInfo && {algolia: algoliaInfo}),\n\t};\n};\n\nexport const setPlugins = async (): Promise<Record<string, unknown>> => {\n\tconst siteType = await getSiteType();\n\tconst config = await (siteType.includes('landing') ? buildLandingPage() : buildMultipageSite());\n\n\treturn {siteType, ...config};\n};\n"]}
@@ -1,4 +0,0 @@
1
- export declare const getFileName: () => string;
2
- export declare const getSitePath: () => string;
3
- export declare const getConfigPath: () => string;
4
- //# sourceMappingURL=path.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/tools/path.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,cAAuC,CAAC;AAEhE,eAAO,MAAM,WAAW,cAAgC,CAAC;AACzD,eAAO,MAAM,aAAa,cAAuC,CAAC"}
@@ -1,6 +0,0 @@
1
- import { fileURLToPath } from 'node:url';
2
- export const getFileName = () => fileURLToPath(import.meta.url);
3
- // eslint-disable-next-line n/prefer-global/process
4
- export const getSitePath = () => `${process.cwd()}/site`;
5
- export const getConfigPath = () => `${getSitePath()}/config.json`;
6
- //# sourceMappingURL=path.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"path.js","sourceRoot":"","sources":["../../src/tools/path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AAEvC,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChE,mDAAmD;AACnD,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC;AACzD,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,GAAG,WAAW,EAAE,cAAc,CAAC","sourcesContent":["import {fileURLToPath} from 'node:url';\n\nexport const getFileName = () => fileURLToPath(import.meta.url);\n// eslint-disable-next-line n/prefer-global/process\nexport const getSitePath = () => `${process.cwd()}/site`;\nexport const getConfigPath = () => `${getSitePath()}/config.json`;\n\n"]}
@@ -1,3 +0,0 @@
1
- export declare const reportError: (error: unknown) => void;
2
- export declare const urlRegex: RegExp;
3
- //# sourceMappingURL=tools.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/tools/tools.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,UAAW,OAAO,KAAG,IAO5C,CAAC;AAEF,eAAO,MAAM,QAAQ,QAA6E,CAAC"}
@@ -1,10 +0,0 @@
1
- import logger from '../logger.js';
2
- export const reportError = (error) => {
3
- let message = String(error);
4
- if (error instanceof Error) {
5
- message = error.message;
6
- }
7
- logger.error(message);
8
- };
9
- export const urlRegex = /^(http(s)?:\/\/.)[-\w@:%.+~#=]{2,256}\.[a-z]{2,6}\b([-\w@:%+.~#?&/=]*)$/g;
10
- //# sourceMappingURL=tools.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/tools/tools.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAc,EAAQ,EAAE;IACnD,IAAI,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5B,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC5B,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IACzB,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;AACvB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,0EAA0E,CAAC","sourcesContent":["import logger from '../logger.js';\n\nexport const reportError = (error: unknown): void => {\n\tlet message = String(error);\n\tif (error instanceof Error) {\n\t\tmessage = error.message;\n\t}\n\n\tlogger.error(message);\n};\n\nexport const urlRegex = /^(http(s)?:\\/\\/.)[-\\w@:%.+~#=]{2,256}\\.[a-z]{2,6}\\b([-\\w@:%+.~#?&/=]*)$/g;\n\n"]}
@@ -1,8 +0,0 @@
1
- import type DoculaPlugins from '../plugins/index.js';
2
- import { type PluginConfig, type PluginInstance } from '../plugins/index.js';
3
- export { type PluginConfig, type PluginInstance } from '../plugins/index.js';
4
- export type PluginName = keyof typeof DoculaPlugins;
5
- export type PluginInstances = Record<string, PluginInstance>;
6
- export type Plugins = PluginName[];
7
- export type PluginConfigs = Record<PluginName, PluginConfig>;
8
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAC,KAAK,YAAY,EAAE,KAAK,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAE3E,OAAO,EAAC,KAAK,YAAY,EAAE,KAAK,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAE3E,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,aAAa,CAAC;AAEpD,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAE7D,MAAM,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;AAEnC,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"","sourcesContent":["import type DoculaPlugins from '../plugins/index.js';\nimport {type PluginConfig, type PluginInstance} from '../plugins/index.js';\n\nexport {type PluginConfig, type PluginInstance} from '../plugins/index.js';\n\nexport type PluginName = keyof typeof DoculaPlugins;\n\nexport type PluginInstances = Record<string, PluginInstance>;\n\nexport type Plugins = PluginName[];\n\nexport type PluginConfigs = Record<PluginName, PluginConfig>;\n\n"]}
@@ -1,5 +0,0 @@
1
- {
2
- "authorName": "Jared Wray",
3
- "footer": "License MIT and Copyright",
4
- "name": "Docula"
5
- }
@@ -1,305 +0,0 @@
1
- .header-logo {
2
- margin-right: 30px;
3
- }
4
-
5
- .home-header {
6
- position: sticky;
7
- background-color: var(--home-background);
8
- border-bottom: 1px solid var(--border);
9
- }
10
-
11
- .home-hero {
12
- padding: 56px 0 72px;
13
- background-color: var(--home-background)
14
- }
15
-
16
- .home-container {
17
- margin: 32px 32px 48px;
18
- color: var(--color-text);
19
- }
20
-
21
- .home-container h1 {
22
- font-weight: 500;
23
- font-size: 28px;
24
- }
25
-
26
- .home-title {
27
- text-align: center;
28
- margin-bottom: 32px;
29
- font-size: 30px;
30
- background: linear-gradient(30deg, var(--color-primary) 40%, var(--color-secondary-dark) 70%);
31
- background-clip: text;
32
- -webkit-background-clip: text;
33
- color: transparent;
34
- }
35
-
36
- .home-docs-button {
37
- padding: 12px 24px;
38
- border: 2px solid var(--color-secondary-dark);
39
- border-radius: 8px;
40
- color: var(--color-secondary-dark);
41
- font-weight: 600;
42
- }
43
-
44
- .home-hero {
45
- text-align: center;
46
- }
47
-
48
- .home-hero img {
49
- width: 100%;
50
- max-width: 120px;
51
- }
52
-
53
- .content-container {
54
- margin: 96px 0;
55
- }
56
-
57
- .facepile-container {
58
- display: flex;
59
- flex-wrap: wrap;
60
- justify-content: center;
61
- }
62
-
63
- .facepile {
64
- line-height: 2;
65
- padding: 0 0 0 25px;
66
- }
67
-
68
- .facepile > a {
69
- display: inline-block;
70
- margin-left: -25px;
71
- transition: opacity .3s;
72
- opacity: .9;
73
- color: var(--background);
74
- }
75
-
76
- .facepile img {
77
- border-radius: 50%;
78
- width: calc(30px + 5vw);
79
- height: calc(30px + 5vw);
80
- max-width: 60px;
81
- max-height: 60px;
82
- margin-bottom: 6px;
83
- background-color: #ffffff;
84
- border: 2px solid;
85
- transition: border .3s;
86
- object-fit: cover;
87
- vertical-align: middle;
88
- display: inline-block;
89
- }
90
-
91
-
92
- .facepile > a:hover {
93
- opacity: 1;
94
- position: relative;
95
- z-index: 1;
96
- }
97
-
98
- .release {
99
- overflow: hidden;
100
- width: 100%;
101
- line-break: anywhere;
102
- margin-top: 32px;
103
- color: var(--color-text);
104
- }
105
-
106
- .release-header {
107
- margin-bottom: 16px;
108
- }
109
-
110
- .release-title {
111
- font-size: 22px;
112
- color: var(--color-primary);
113
- font-weight: 700;
114
- transition: color .3s;
115
- display: block;
116
- }
117
-
118
- .release-title:hover {
119
- color: var(--color-secondary-dark);
120
- }
121
-
122
- .release-date {
123
- font-size: 12px;
124
- }
125
-
126
- .release-btn {
127
- padding: 12px;
128
- border-radius: 8px;
129
- border: 2px solid var(--color-secondary);
130
- color: var(--color-secondary);
131
- width: fit-content;
132
- margin-top: 32px;
133
- display: block;
134
- }
135
-
136
- .release-btn span {
137
- margin-left: 8px;
138
- font-size: 12px;
139
- transition: margin-left .3s;
140
- }
141
-
142
- .release-btn:hover span {
143
- margin-left: 16px;
144
- }
145
-
146
- .release-body p {
147
- margin: 8px 0;
148
- }
149
-
150
- .release-body pre {
151
- margin-bottom: 32px;
152
- }
153
-
154
- .release-body h1 {
155
- font-size: 22px;
156
- margin-bottom: 16px;
157
- }
158
-
159
- .release-body h2 {
160
- font-size: 18px;
161
- margin-top: 28px;
162
- margin-bottom: 16px;
163
- }
164
-
165
- .release-body ul {
166
- padding-left: 16px;
167
- }
168
-
169
- .release-body ul > li {
170
- margin-bottom: 12px;
171
- }
172
-
173
- .release-body ul > li a {
174
- text-decoration: underline;
175
- }
176
-
177
- footer {
178
- height: 64px;
179
- display: flex;
180
- justify-content: center;
181
- align-items: center;
182
- border-top: 1px solid var(--border);
183
- }
184
-
185
- footer img {
186
- margin-left: 8px;
187
- margin-top: 4px;
188
- }
189
-
190
- @media screen and (min-width: 640px) {
191
- .home-hero {
192
- padding: 64px 0 72px;
193
- }
194
-
195
- .home-container {
196
- margin-left: 64px;
197
- margin-right: 64px;
198
- }
199
- }
200
-
201
-
202
- @media screen and (min-width: 768px) {
203
- .home-hero {
204
- padding: 72px 0;
205
- }
206
-
207
- .header-logo {
208
- margin-right: 56px;
209
- }
210
-
211
- .home-hero img {
212
- max-width: 180px;
213
- }
214
-
215
- .content-container {
216
- margin: 96px 0;
217
- }
218
-
219
- .versions-container {
220
- margin: 72px 0;
221
- }
222
-
223
- .release {
224
- margin-bottom: 64px;
225
- }
226
- }
227
-
228
-
229
- @media screen and (min-width: 992px) {
230
- .home-container {
231
- margin: 72px auto 56px;
232
- max-width: 70%;
233
- }
234
-
235
- .home-container h1 {
236
- font-size: 32px;
237
- }
238
-
239
- .home-docs-button {
240
- font-size: 24px;
241
- }
242
-
243
- .home-hero {
244
- padding: 120px 0;
245
- }
246
-
247
- .nav {
248
- padding-right: 56px;
249
- width: 100%;
250
- justify-content: space-between;
251
- }
252
-
253
- .header-content {
254
- height: 72px;
255
- }
256
-
257
- .home-hero img {
258
- max-width: 250px;
259
- }
260
-
261
- .home-title {
262
- margin-bottom: 64px;
263
- font-size: 48px;
264
- }
265
-
266
- .content-container {
267
- margin: 120px 0;
268
- }
269
-
270
- .release-btn {
271
- margin-top: 0;
272
- }
273
-
274
- footer {
275
- height: 76px;
276
- }
277
-
278
- footer img {
279
- height: 40px;
280
- width: auto;
281
- }
282
- }
283
-
284
- @media screen and (min-width: 1200px) {
285
- .home-container {
286
- max-width: 950px;
287
- }
288
-
289
- .content-container {
290
- margin: 160px 0;
291
- }
292
-
293
- .versions-container {
294
- margin: 120px 0;
295
- }
296
-
297
- .facepile > a {
298
- margin-left: -30px;
299
- }
300
-
301
- .facepile img {
302
- max-width: 70px;
303
- max-height: 70px;
304
- }
305
- }
@@ -1,125 +0,0 @@
1
- #hits {
2
- height: calc(100vh - 72px);
3
- position: fixed;
4
- top: 72px;
5
- overflow-y: auto;
6
- background-color: var(--search-input-background);
7
- width: 100%;
8
- }
9
-
10
- #hits > div {
11
- padding: 0 24px;
12
- }
13
-
14
- .search-box {
15
- display: flex;
16
- width: 100%;
17
- border-color: var(--search-input-background);
18
- background-color: var(--search-input-background);
19
- border: none;
20
- border-bottom: 1px solid var(--border);
21
- height: 72px;
22
- }
23
-
24
- .search-box input {
25
- border-color: var(--search-input-background);
26
- border: none !important;
27
- border-bottom: 1px solid var(--border);
28
- font-size: 18px;
29
- height: 71px !important;
30
- }
31
-
32
- .ais-SearchBox {
33
- position: relative;
34
- flex: 0.8;
35
- }
36
-
37
- .close-modal--btn {
38
- flex: 0.2;
39
- display: flex;
40
- justify-content: center;
41
- align-items: center;
42
- font-size: 13px;
43
- border-left: 1px solid var(--border);
44
- margin: 10px 0;
45
- cursor: pointer;
46
- opacity: 0.6;
47
- }
48
-
49
- .ais-SearchBox-submit, .ais-SearchBox-reset {
50
- position: absolute;
51
- top: 24px;
52
- cursor: pointer;
53
- opacity: 0.6;
54
- }
55
-
56
- .ais-SearchBox-submit svg {
57
- fill: currentColor;
58
- width: 16px;
59
- height: 16px;
60
- }
61
-
62
- .ais-SearchBox-reset svg {
63
- fill: currentColor;
64
- width: 10px;
65
- height: 10px;
66
- }
67
-
68
- .ais-SearchBox-submit {
69
- left: 16px
70
- }
71
-
72
- .ais-SearchBox-reset {
73
- right: 16px;
74
- }
75
-
76
- .search-result {
77
- padding: 0;
78
- margin-top: 24px;
79
- }
80
-
81
- .search-result hr {
82
- margin: 46px 0;
83
- opacity: 0.3
84
- }
85
-
86
- @media screen and (min-width: 640px) {
87
- .ais-SearchBox {
88
- flex: 0.9;
89
- }
90
-
91
- .close-modal--btn {
92
- flex: 0.1;
93
- }
94
- }
95
-
96
- @media screen and (min-width: 992px) {
97
- #hits {
98
- height: calc(780px - 72px);
99
- position: fixed;
100
- }
101
-
102
- #hits > div {
103
- padding: 0 48px;
104
- }
105
-
106
- .search-container {
107
- height: 780px;
108
- }
109
-
110
- .search-box {
111
- justify-content: center;
112
- }
113
-
114
- .ais-SearchBox-submit, .ais-SearchBox-reset {
115
- top: 16px;
116
- }
117
-
118
- .ais-SearchBox {
119
- flex: 0.8;
120
- }
121
-
122
- .close-modal--btn {
123
- justify-content: flex-end;
124
- }
125
- }