portosaurus 2.0.3 → 2.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 (91) hide show
  1. package/bin/portosaurus.mjs +14 -327
  2. package/package.json +16 -11
  3. package/src/cli/build.mjs +43 -0
  4. package/src/cli/dev.mjs +31 -0
  5. package/src/cli/init.mjs +135 -0
  6. package/src/cli/serve.mjs +30 -0
  7. package/src/core/buildDocuConfig.mjs +664 -0
  8. package/src/core/{themePlugin.mjs → plugins/themePlugin.mjs} +1 -1
  9. package/src/template/.github/workflows/deploy.yml +52 -0
  10. package/src/template/.nojekyll +0 -0
  11. package/src/template/README.md +58 -0
  12. package/src/template/blog/authors.yml +1 -1
  13. package/src/template/blog/welcome.md +1 -1
  14. package/src/template/config.js +40 -23
  15. package/src/template/package.json +20 -0
  16. package/src/template/static/img/svg/icon-blog.svg +2 -0
  17. package/src/template/static/img/svg/icon-note.svg +2 -0
  18. package/src/{components → theme/components}/AboutSection/index.js +22 -13
  19. package/src/{components → theme/components}/AboutSection/styles.module.css +59 -48
  20. package/src/{components → theme/components}/ContactSection/index.js +31 -24
  21. package/src/{components → theme/components}/ContactSection/styles.module.css +31 -26
  22. package/src/{components → theme/components}/ExperienceSection/index.js +12 -7
  23. package/src/{components → theme/components}/ExperienceSection/styles.module.css +23 -20
  24. package/src/{components → theme/components}/HeroSection/index.js +9 -11
  25. package/src/{components → theme/components}/HeroSection/styles.module.css +44 -32
  26. package/src/{components → theme/components}/NoteIndex/index.js +10 -3
  27. package/src/{components → theme/components}/Preview/components/PreviewHeader.js +14 -8
  28. package/src/{components → theme/components}/Preview/components/Triggers/Pv.js +32 -7
  29. package/src/{components → theme/components}/Preview/components/Triggers/SrcPv.js +1 -5
  30. package/src/theme/components/Preview/index.js +3 -0
  31. package/src/{components → theme/components}/ProjectsSection/index.js +279 -224
  32. package/src/{components → theme/components}/ProjectsSection/styles.module.css +21 -17
  33. package/src/{components → theme/components}/ScrollToTop/index.js +18 -21
  34. package/src/{components → theme/components}/ScrollToTop/styles.module.css +10 -9
  35. package/src/theme/components/SocialLinks/index.js +125 -0
  36. package/src/{components → theme/components}/SocialLinks/styles.module.css +9 -7
  37. package/src/{components → theme/components}/Tooltip/index.js +4 -1
  38. package/src/theme/config/iconMappings.js +465 -0
  39. package/src/theme/config/metaTags.js +239 -0
  40. package/src/theme/config/prism.js +179 -0
  41. package/src/theme/config/sidebar.js +17 -0
  42. package/src/{css → theme/css}/bootstrap.css +0 -1
  43. package/src/theme/css/catppuccin.css +618 -0
  44. package/src/{css → theme/css}/custom.css +3 -9
  45. package/src/{css → theme/css}/tasks.css +43 -37
  46. package/src/theme/{MDXComponents.js → overrides/MDXComponents.js} +3 -3
  47. package/src/theme/{Root.js → overrides/Root.js} +2 -4
  48. package/src/{pages → theme/pages}/index.js +23 -39
  49. package/src/theme/pages/notes.js +83 -0
  50. package/src/{pages → theme/pages}/tasks.js +115 -56
  51. package/src/{core/client-utils → theme/utils}/HashNavigation.js +60 -49
  52. package/src/{core/client-utils → theme/utils}/updateTitle.js +21 -25
  53. package/src/{core/build-utils → utils/build}/cssUtils.mjs +5 -3
  54. package/src/{core/build-utils → utils/build}/generateFavicon.mjs +44 -12
  55. package/src/{core/build-utils → utils/build}/generateRobotsTxt.mjs +4 -3
  56. package/src/{core/build-utils → utils/build}/iconExtractor.mjs +7 -3
  57. package/src/utils/build/imageDownloader.mjs +159 -0
  58. package/src/{core/build-utils → utils/build}/imageProcessor.mjs +5 -6
  59. package/src/utils/helpers.mjs +153 -0
  60. package/src/utils/logger.mjs +53 -0
  61. package/src/utils/packageManager.mjs +88 -0
  62. package/src/components/Preview/index.js +0 -3
  63. package/src/components/SocialLinks/index.js +0 -130
  64. package/src/config/iconMappings.js +0 -329
  65. package/src/config/metaTags.js +0 -240
  66. package/src/config/prism.js +0 -179
  67. package/src/config/sidebar.js +0 -20
  68. package/src/core/build-utils/imageDownloader.mjs +0 -98
  69. package/src/core/createDocuConf.mjs +0 -472
  70. package/src/core/defaults.mjs +0 -67
  71. package/src/core/logger.mjs +0 -17
  72. package/src/core/packageManager.mjs +0 -72
  73. package/src/css/catppuccin.css +0 -632
  74. package/src/pages/notes.js +0 -87
  75. /package/src/template/notes/{welcome.md → welcome.mdx} +0 -0
  76. /package/src/{components → theme/components}/NoteIndex/styles.module.css +0 -0
  77. /package/src/{components → theme/components}/Preview/components/FeedbackStates.js +0 -0
  78. /package/src/{components → theme/components}/Preview/components/FileTabs.js +0 -0
  79. /package/src/{components → theme/components}/Preview/components/Triggers/index.js +0 -0
  80. /package/src/{components → theme/components}/Preview/components/ViewerWindow.js +0 -0
  81. /package/src/{components → theme/components}/Preview/hooks/useDeepLinkHash.js +0 -0
  82. /package/src/{components → theme/components}/Preview/hooks/useDockLayout.js +0 -0
  83. /package/src/{components → theme/components}/Preview/hooks/useFileFetch.js +0 -0
  84. /package/src/{components → theme/components}/Preview/renderers/CodeRenderer.js +0 -0
  85. /package/src/{components → theme/components}/Preview/renderers/ImageRenderer.js +0 -0
  86. /package/src/{components → theme/components}/Preview/renderers/PdfRenderer.js +0 -0
  87. /package/src/{components → theme/components}/Preview/renderers/WebRenderer.js +0 -0
  88. /package/src/{components → theme/components}/Preview/state/index.js +0 -0
  89. /package/src/{components → theme/components}/Preview/styles.module.css +0 -0
  90. /package/src/{components → theme/components}/Preview/utils/index.js +0 -0
  91. /package/src/{components → theme/components}/Tooltip/styles.module.css +0 -0
@@ -1,179 +0,0 @@
1
- /**
2
- * Catppuccin theme for Prism.js
3
- **/
4
-
5
- // Catppuccin Mocha (dark theme)
6
- export const catppuccinMocha = {
7
- plain: {
8
- color: '#cdd6f4',
9
- backgroundColor: '#181825',
10
- },
11
- styles: [
12
- {
13
- types: ['comment', 'prolog', 'doctype', 'cdata'],
14
- style: {
15
- color: '#6c7086',
16
- fontStyle: 'italic',
17
- },
18
- },
19
- {
20
- types: ['namespace'],
21
- style: {
22
- opacity: 0.7,
23
- },
24
- },
25
- {
26
- types: ['string', 'char', 'attr-value'],
27
- style: {
28
- color: '#a6e3a1',
29
- },
30
- },
31
- {
32
- types: ['punctuation', 'operator'],
33
- style: {
34
- color: '#a6adc8',
35
- },
36
- },
37
- {
38
- types: [
39
- 'entity',
40
- 'url',
41
- 'symbol',
42
- 'number',
43
- 'boolean',
44
- 'variable',
45
- 'constant',
46
- 'property',
47
- 'regex',
48
- 'inserted',
49
- ],
50
- style: {
51
- color: '#fab387',
52
- },
53
- },
54
- {
55
- types: ['atrule', 'keyword', 'attr-name', 'selector'],
56
- style: {
57
- color: '#cba6f7',
58
- },
59
- },
60
- {
61
- types: ['function', 'deleted', 'tag'],
62
- style: {
63
- color: '#f38ba8',
64
- },
65
- },
66
- {
67
- types: ['function-variable'],
68
- style: {
69
- color: '#89b4fa',
70
- },
71
- },
72
- {
73
- types: ['class-name'],
74
- style: {
75
- color: '#f9e2af',
76
- },
77
- },
78
- {
79
- types: ['important', 'bold'],
80
- style: {
81
- fontWeight: 'bold',
82
- },
83
- },
84
- {
85
- types: ['italic'],
86
- style: {
87
- fontStyle: 'italic',
88
- },
89
- },
90
- ],
91
- };
92
-
93
- // Catppuccin Latte (light theme)
94
- export const catppuccinLatte = {
95
- plain: {
96
- color: '#4c4f69',
97
- backgroundColor: '#FAF9F6',
98
- },
99
- styles: [
100
- {
101
- types: ['comment', 'prolog', 'doctype', 'cdata'],
102
- style: {
103
- color: '#8c8fa1',
104
- fontStyle: 'italic',
105
- },
106
- },
107
- {
108
- types: ['namespace'],
109
- style: {
110
- opacity: 0.7,
111
- },
112
- },
113
- {
114
- types: ['string', 'char', 'attr-value'],
115
- style: {
116
- color: '#40a02b',
117
- },
118
- },
119
- {
120
- types: ['punctuation', 'operator'],
121
- style: {
122
- color: '#8c8fa1',
123
- },
124
- },
125
- {
126
- types: [
127
- 'entity',
128
- 'url',
129
- 'symbol',
130
- 'number',
131
- 'boolean',
132
- 'variable',
133
- 'constant',
134
- 'property',
135
- 'regex',
136
- 'inserted',
137
- ],
138
- style: {
139
- color: '#fe640b',
140
- },
141
- },
142
- {
143
- types: ['atrule', 'keyword', 'attr-name', 'selector'],
144
- style: {
145
- color: '#8839ef',
146
- },
147
- },
148
- {
149
- types: ['function', 'deleted', 'tag'],
150
- style: {
151
- color: '#d20f39',
152
- },
153
- },
154
- {
155
- types: ['function-variable'],
156
- style: {
157
- color: '#1e66f5',
158
- },
159
- },
160
- {
161
- types: ['class-name'],
162
- style: {
163
- color: '#df8e1d',
164
- },
165
- },
166
- {
167
- types: ['important', 'bold'],
168
- style: {
169
- fontWeight: 'bold',
170
- },
171
- },
172
- {
173
- types: ['italic'],
174
- style: {
175
- fontStyle: 'italic',
176
- },
177
- },
178
- ],
179
- };
@@ -1,20 +0,0 @@
1
-
2
- const sidebar = {
3
-
4
- notes: [
5
- {
6
- type: 'category',
7
- label: 'Notes',
8
- link: { type: 'doc', id: 'index' },
9
- items: [
10
- {
11
- type: 'autogenerated',
12
- dirName: '.'
13
- }
14
- ]
15
- }
16
- ]
17
- };
18
-
19
-
20
- module.exports = sidebar;
@@ -1,98 +0,0 @@
1
- import fs from "fs";
2
- import path from "path";
3
- import https from "https";
4
- import http from "http";
5
-
6
- /**
7
- * Downloads an image from a URL and saves it to a local file.
8
- * Handles redirects (up to 5 levels) and falls back to proxies if needed.
9
- */
10
- export async function downloadImage(url, destDir, fileName, options = {}) {
11
- const { proxies = [], redirectCount = 0 } = options;
12
-
13
- if (redirectCount > 5) {
14
- throw new Error("Too many redirects");
15
- }
16
-
17
- const destPath = path.join(destDir, fileName);
18
- fs.mkdirSync(destDir, { recursive: true });
19
-
20
- return new Promise((resolve, reject) => {
21
- const protocol = url.startsWith("https") ? https : http;
22
-
23
- protocol
24
- .get(url, (response) => {
25
- // Handle redirects
26
- if (
27
- [301, 302, 303, 307, 308].includes(response.statusCode) &&
28
- response.headers.location
29
- ) {
30
- const redirectUrl = new URL(
31
- response.headers.location,
32
- url,
33
- ).toString();
34
- console.log(
35
- `[INFO] Following redirect (${response.statusCode}) to: ${redirectUrl}`,
36
- );
37
- resolve(
38
- downloadImage(redirectUrl, destDir, fileName, {
39
- ...options,
40
- redirectCount: redirectCount + 1,
41
- }),
42
- );
43
- return;
44
- }
45
-
46
- // Handle errors and non-image content
47
- if (response.statusCode !== 200) {
48
- tryProxyFallback();
49
- return;
50
- }
51
-
52
- const contentType = response.headers["content-type"] || "";
53
- if (!contentType.startsWith("image/") && !url.includes("raw=true")) {
54
- console.warn(
55
- `[WARN] Expected image but got ${contentType} from ${url}`,
56
- );
57
- tryProxyFallback();
58
- return;
59
- }
60
-
61
- const file = fs.createWriteStream(destPath);
62
- response.pipe(file);
63
-
64
- file.on("finish", () => {
65
- file.close((err) => {
66
- if (err) reject(err);
67
- else resolve(destPath);
68
- });
69
- });
70
-
71
- file.on("error", (err) => {
72
- fs.unlink(destPath, () => reject(err));
73
- });
74
- })
75
- .on("error", (err) => {
76
- tryProxyFallback(err);
77
- });
78
-
79
- function tryProxyFallback(originalError) {
80
- if (proxies.length > 0) {
81
- const nextProxy = proxies[0];
82
- const remainingProxies = proxies.slice(1);
83
- const proxyUrl = `${nextProxy}${encodeURIComponent(url)}`;
84
- console.log(
85
- `[INFO] Download failed or invalid content. Retrying via proxy: ${nextProxy}`,
86
- );
87
- resolve(
88
- downloadImage(proxyUrl, destDir, fileName, {
89
- ...options,
90
- proxies: remainingProxies,
91
- }),
92
- );
93
- } else {
94
- reject(originalError || new Error(`Failed to download image: ${url}`));
95
- }
96
- }
97
- });
98
- }