jupyterlab_github_markdown_alerts_extension 1.0.5 → 1.0.7
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/README.md +3 -0
- package/lib/index.js +3 -9
- package/package.json +1 -1
- package/src/index.ts +4 -10
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# JupyterLab GitHub Markdown Alerts Extension
|
|
2
2
|
|
|
3
3
|
[](https://github.com/stellarshenson/jupyterlab_github_markdown_alerts_extension/actions/workflows/build.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/jupyterlab_github_markdown_alerts_extension)
|
|
4
5
|
[](https://pypi.org/project/jupyterlab-github-markdown-alerts-extension/)
|
|
5
6
|
[](https://pepy.tech/project/jupyterlab-github-markdown-alerts-extension)
|
|
6
7
|
[](https://jupyterlab.readthedocs.io/en/stable/)
|
|
@@ -9,6 +10,8 @@ A JupyterLab 4 extension that renders GitHub-style alert blocks in Markdown cell
|
|
|
9
10
|
|
|
10
11
|
This extension brings GitHub's alert syntax to JupyterLab, allowing you to create styled callout blocks using simple markdown notation. Alerts automatically adapt to light and dark themes, matching GitHub's visual design.
|
|
11
12
|
|
|
13
|
+

|
|
14
|
+
|
|
12
15
|
**Key Features**:
|
|
13
16
|
- Five alert types - NOTE, TIP, IMPORTANT, WARNING, CAUTION
|
|
14
17
|
- Automatic theme adaptation - colors adjust for light and dark modes
|
package/lib/index.js
CHANGED
|
@@ -113,12 +113,10 @@ function postProcessAlerts(html, showBackgrounds) {
|
|
|
113
113
|
const backgroundClass = showBackgrounds
|
|
114
114
|
? ' markdown-alert-with-backgrounds'
|
|
115
115
|
: '';
|
|
116
|
-
|
|
116
|
+
return (`<div class="markdown-alert ${config.className}${backgroundClass}" dir="auto">` +
|
|
117
117
|
`<p class="markdown-alert-title" dir="auto">${icon}${config.title}</p>` +
|
|
118
118
|
content +
|
|
119
|
-
`</div
|
|
120
|
-
console.log('Alert HTML generated:', alertHtml);
|
|
121
|
-
return alertHtml;
|
|
119
|
+
`</div>`);
|
|
122
120
|
});
|
|
123
121
|
return result;
|
|
124
122
|
}
|
|
@@ -155,12 +153,8 @@ const plugin = {
|
|
|
155
153
|
const originalRender = markdownParser.render.bind(markdownParser);
|
|
156
154
|
markdownParser.render = async (content) => {
|
|
157
155
|
const processedContent = processAlerts(content);
|
|
158
|
-
console.log('Processed content:', processedContent);
|
|
159
156
|
const renderedHtml = await originalRender(processedContent);
|
|
160
|
-
|
|
161
|
-
const finalHtml = postProcessAlerts(renderedHtml, showBackgrounds);
|
|
162
|
-
console.log('Final HTML:', finalHtml);
|
|
163
|
-
return finalHtml;
|
|
157
|
+
return postProcessAlerts(renderedHtml, showBackgrounds);
|
|
164
158
|
};
|
|
165
159
|
console.log('JupyterLab extension jupyterlab_github_markdown_alerts_extension is activated!');
|
|
166
160
|
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -172,14 +172,12 @@ function postProcessAlerts(html: string, showBackgrounds: boolean): string {
|
|
|
172
172
|
? ' markdown-alert-with-backgrounds'
|
|
173
173
|
: '';
|
|
174
174
|
|
|
175
|
-
|
|
175
|
+
return (
|
|
176
176
|
`<div class="markdown-alert ${config.className}${backgroundClass}" dir="auto">` +
|
|
177
177
|
`<p class="markdown-alert-title" dir="auto">${icon}${config.title}</p>` +
|
|
178
178
|
content +
|
|
179
|
-
`</div
|
|
180
|
-
|
|
181
|
-
console.log('Alert HTML generated:', alertHtml);
|
|
182
|
-
return alertHtml;
|
|
179
|
+
`</div>`
|
|
180
|
+
);
|
|
183
181
|
}
|
|
184
182
|
);
|
|
185
183
|
return result;
|
|
@@ -229,12 +227,8 @@ const plugin: JupyterFrontEndPlugin<void> = {
|
|
|
229
227
|
|
|
230
228
|
markdownParser.render = async (content: string): Promise<string> => {
|
|
231
229
|
const processedContent = processAlerts(content);
|
|
232
|
-
console.log('Processed content:', processedContent);
|
|
233
230
|
const renderedHtml = await originalRender(processedContent);
|
|
234
|
-
|
|
235
|
-
const finalHtml = postProcessAlerts(renderedHtml, showBackgrounds);
|
|
236
|
-
console.log('Final HTML:', finalHtml);
|
|
237
|
-
return finalHtml;
|
|
231
|
+
return postProcessAlerts(renderedHtml, showBackgrounds);
|
|
238
232
|
};
|
|
239
233
|
|
|
240
234
|
console.log(
|