jupyterlab-github-markdown-alerts-extension 1.0.4__tar.gz
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.
- jupyterlab_github_markdown_alerts_extension-1.0.4/.claude/CLAUDE.md +61 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/.claude/JOURNAL.md +29 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/.claude/settings.local.json +22 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/.copier-answers.yml +16 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/.gitignore +128 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/.prettierignore +6 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/.yarnrc.yml +1 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/CHANGELOG.md +5 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/LICENSE +29 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/Makefile +118 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/PKG-INFO +212 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/README.md +157 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/RELEASE.md +80 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/babel.config.js +1 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/install.json +5 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/jest.config.js +28 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/jupyterlab_github_markdown_alerts_extension/__init__.py +16 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/jupyterlab_github_markdown_alerts_extension/_version.py +4 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/jupyterlab_github_markdown_alerts_extension/labextension/package.json +202 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/jupyterlab_github_markdown_alerts_extension/labextension/schemas/jupyterlab_github_markdown_alerts_extension/package.json.orig +197 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/jupyterlab_github_markdown_alerts_extension/labextension/schemas/jupyterlab_github_markdown_alerts_extension/plugin.json +16 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/jupyterlab_github_markdown_alerts_extension/labextension/static/509.9ff03b11b48204057995.js +1 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/jupyterlab_github_markdown_alerts_extension/labextension/static/728.4c48081038fa55c9c6ed.js +1 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/jupyterlab_github_markdown_alerts_extension/labextension/static/remoteEntry.7987a850227479c09bb7.js +1 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/jupyterlab_github_markdown_alerts_extension/labextension/static/style.js +4 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/jupyterlab_github_markdown_alerts_extension/labextension/static/third-party-licenses.json +16 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/package-lock.json +10801 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/package.json +197 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/pyproject.toml +77 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/schema/plugin.json +16 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/setup.py +1 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/src/__tests__/jupyterlab_github_markdown_alerts_extension.spec.ts +9 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/src/index.ts +246 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/style/base.css +189 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/style/index.css +1 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/style/index.js +1 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/tsconfig.json +25 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/tsconfig.test.json +3 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/ui-tests/README.md +167 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/ui-tests/jupyter_server_test_config.py +12 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/ui-tests/package.json +15 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/ui-tests/playwright.config.js +14 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/ui-tests/tests/jupyterlab_github_markdown_alerts_extension.spec.ts +21 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/ui-tests/yarn.lock +0 -0
- jupyterlab_github_markdown_alerts_extension-1.0.4/yarn.lock +9896 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<!-- Import workspace-level CLAUDE.md configuration -->
|
|
2
|
+
<!-- See /home/lab/workspace/.claude/CLAUDE.md for complete rules -->
|
|
3
|
+
|
|
4
|
+
# Project-Specific Configuration
|
|
5
|
+
|
|
6
|
+
This file extends workspace-level configuration with project-specific rules.
|
|
7
|
+
|
|
8
|
+
## Project Context
|
|
9
|
+
|
|
10
|
+
**Project**: JupyterLab GitHub Markdown Alerts Extension
|
|
11
|
+
|
|
12
|
+
**Purpose**: A JupyterLab 4 extension that renders GitHub-style alert blocks in Markdown cells, supporting NOTE, TIP, IMPORTANT, WARNING, and CAUTION alert types.
|
|
13
|
+
|
|
14
|
+
**Technology Stack**:
|
|
15
|
+
- JupyterLab 4.x
|
|
16
|
+
- TypeScript 5.8
|
|
17
|
+
- CSS modules for styling
|
|
18
|
+
- Jest for unit testing
|
|
19
|
+
- Playwright/Galata for integration testing
|
|
20
|
+
- Hatchling for Python packaging
|
|
21
|
+
- Yarn (jlpm) for JavaScript package management
|
|
22
|
+
|
|
23
|
+
**Key Components**:
|
|
24
|
+
- `/src/index.ts` - Main extension entry point
|
|
25
|
+
- `/style/base.css` - Alert styling definitions
|
|
26
|
+
- `/style/index.css` - Style module entry
|
|
27
|
+
- `pyproject.toml` - Python package configuration
|
|
28
|
+
- `package.json` - JavaScript package configuration
|
|
29
|
+
|
|
30
|
+
**Alert Types Supported**:
|
|
31
|
+
```markdown
|
|
32
|
+
> [!NOTE]
|
|
33
|
+
> [!TIP]
|
|
34
|
+
> [!IMPORTANT]
|
|
35
|
+
> [!WARNING]
|
|
36
|
+
> [!CAUTION]
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Development Workflow**:
|
|
40
|
+
- Use `jlpm` for JavaScript operations (JupyterLab's pinned yarn)
|
|
41
|
+
- Development mode: `jupyter labextension develop . --overwrite`
|
|
42
|
+
- Watch mode: `jlpm watch` + `jupyter lab` in separate terminals
|
|
43
|
+
- Tests: `jlpm test` (unit), `ui-tests/` (integration)
|
|
44
|
+
|
|
45
|
+
**Naming Conventions**:
|
|
46
|
+
- Python package: `jupyterlab_github_markdown_alerts_extension` (underscores)
|
|
47
|
+
- NPM package: `jupyterlab_github_markdown_alerts_extension` (underscores, matching Python)
|
|
48
|
+
- CSS classes: kebab-case with `jp-` prefix for JupyterLab conventions
|
|
49
|
+
- TypeScript: PascalCase for interfaces (must start with `I`), camelCase for functions
|
|
50
|
+
|
|
51
|
+
**Build Process**:
|
|
52
|
+
- Development: `jlpm build` (with source maps)
|
|
53
|
+
- Production: `jlpm build:prod` (optimized)
|
|
54
|
+
- Clean: `jlpm clean:all` (removes all build artifacts)
|
|
55
|
+
|
|
56
|
+
**Publishing**:
|
|
57
|
+
- Python: PyPI via hatchling
|
|
58
|
+
- JavaScript: Bundled with Python package (labextension)
|
|
59
|
+
- See RELEASE.md for release process
|
|
60
|
+
|
|
61
|
+
**GitHub Repository**: TBD - needs repository URL configuration in package.json and pyproject.toml
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Claude Code Journal
|
|
2
|
+
|
|
3
|
+
This journal tracks substantive work on documents, diagrams, and documentation content.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
1. **Task - Implement GitHub markdown alerts extension**: Implemented complete JupyterLab 4 extension for rendering GitHub-style alert blocks (NOTE, TIP, IMPORTANT, WARNING, CAUTION) in markdown cells<br>
|
|
8
|
+
**Result**: Created TypeScript plugin with markdown parser integration (src/index.ts), comprehensive CSS styling with light/dark theme support (style/base.css), embedded SVG icons for all five alert types, and updated README.md with modus primaris documentation style. Extension successfully builds and integrates with JupyterLab's markdown renderer.
|
|
9
|
+
|
|
10
|
+
2. **Task - Fix markdown parsing within alerts**: Resolved issue where markdown formatting (bold, italic, links, etc.) was not being processed inside alert content blocks<br>
|
|
11
|
+
**Result**: Implemented two-phase processing approach using HTML comment markers (src/index.ts:87-122). Alert blocks are now marked with comments before markdown rendering, allowing the markdown parser to process formatting, then post-processed to wrap content in styled divs. This preserves all markdown features within alert content.
|
|
12
|
+
|
|
13
|
+
3. **Task - Match alerts.html structure exactly**: Corrected icon class names to match GitHub's actual HTML structure from alerts.html reference file<br>
|
|
14
|
+
**Result**: Updated IAlertConfig interface and ALERT_TYPES configuration to include iconClass property (src/index.ts:11-54). Icon classes now use GitHub's semantic names: octicon-info (NOTE), octicon-light-bulb (TIP), octicon-report (IMPORTANT), octicon-alert (WARNING), octicon-stop (CAUTION). Modified createIcon function to accept iconClass parameter.
|
|
15
|
+
|
|
16
|
+
4. **Task - Verify GitHub styling compliance**: Investigated GitHub's official documentation and Primer design system to validate CSS color values and styling approach<br>
|
|
17
|
+
**Result**: Confirmed existing CSS implementation (style/base.css) uses accurate GitHub color scheme. Light theme colors: blue (#0969da) for NOTE, green (#1a7f37) for TIP, purple (#8250df) for IMPORTANT, orange (#9a6700) for WARNING, red (#d1242f) for CAUTION. Dark theme uses adjusted colors for better contrast. Styling matches GitHub's visual appearance with 0.25rem left border, 6px border-radius, and appropriate padding.
|
|
18
|
+
|
|
19
|
+
5. **Task - Extract and match exact GitHub styling**: Analyzed alerts-full-page.html and extracted actual GitHub CSS rules from production stylesheets<br>
|
|
20
|
+
**Result**: Discovered significant styling differences. Updated style/base.css to match GitHub exactly: removed background-color (GitHub uses only left border without background tint), removed border-radius (GitHub has no rounded corners), changed border-width to .25em (not .25rem), updated padding to 0.5rem 1rem, changed font-weight to 500 (medium, not 600 semibold), set line-height to 1, removed margin-bottom from title, updated CAUTION color to #cf222e. Extension now matches GitHub's production styling precisely.
|
|
21
|
+
|
|
22
|
+
6. **Task - Add optional background colors setting**: Implemented JupyterLab settings system to allow users to optionally enable colored backgrounds for alerts<br>
|
|
23
|
+
**Result**: Created schema/plugin.json with showBackgrounds boolean setting (default: false). Added @jupyterlab/settingregistry dependency to package.json. Updated src/index.ts to read settings and conditionally apply markdown-alert-with-backgrounds CSS class. Added CSS rules in style/base.css for optional backgrounds with 10% opacity (light theme) and 15% opacity (dark theme). Settings accessible via Settings → Settings Editor → GitHub Markdown Alerts. Default behavior matches GitHub exactly with no backgrounds.
|
|
24
|
+
|
|
25
|
+
7. **Task - Fix icon rendering**: Resolved issue where SVG icons were not visible in rendered alerts due to JupyterLab's HTML sanitizer stripping inline SVG elements<br>
|
|
26
|
+
**Result**: Replaced inline SVG with img tags using base64-encoded data URIs (src/index.ts:60-90). Modified createIcon function to generate both light and dark theme icon versions with appropriate colors baked into each SVG. Added iconColor and iconColorDark properties to IAlertConfig. Implemented CSS theme switching in style/base.css using .octicon-light and .octicon-dark classes with body[data-jp-theme-light='false'] selector for dark theme detection. Icons now render correctly with proper colors matching GitHub's theme-specific palette.
|
|
27
|
+
|
|
28
|
+
8. **Task - Finalize extension for release**: Updated documentation, removed temporary files, bumped version, and aligned GitHub workflows with production standards<br>
|
|
29
|
+
**Result**: Integrated ALERTS.md content into README.md with alert examples and settings documentation. Removed standalone ALERTS.md file. Bumped version from 0.1.6 to 1.0.1 in package.json (pyproject.toml inherits version via hatch nodejs source). Updated .github/workflows/build.yml to match reference implementation: removed lint and test steps (not yet implemented), updated Python version to 3.12 for test_isolated job. Extension ready for production release with complete GitHub-style alert rendering, theme support, and optional background colors. Added debug logging to src/index.ts for troubleshooting markdown rendering pipeline (console.log statements in markdownParser.render function).
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(mkdir:*)",
|
|
5
|
+
"Bash(jlpm install:*)",
|
|
6
|
+
"Bash(jlpm build:*)",
|
|
7
|
+
"WebFetch(domain:docs.github.com)",
|
|
8
|
+
"WebFetch(domain:github.com)",
|
|
9
|
+
"WebFetch(domain:primer.style)",
|
|
10
|
+
"Bash(curl:*)",
|
|
11
|
+
"Bash(cat:*)",
|
|
12
|
+
"Bash(git add:*)",
|
|
13
|
+
"Bash(git commit:*)",
|
|
14
|
+
"Bash(git push:*)",
|
|
15
|
+
"Bash(git reset:*)",
|
|
16
|
+
"Bash(git tag:*)",
|
|
17
|
+
"Bash(git rm:*)"
|
|
18
|
+
],
|
|
19
|
+
"deny": [],
|
|
20
|
+
"ask": []
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
|
|
2
|
+
_commit: v4.5.0
|
|
3
|
+
_src_path: https://github.com/jupyterlab/extension-template
|
|
4
|
+
author_email: konrad.jelen@gmail.com
|
|
5
|
+
author_name: Stellars Henson
|
|
6
|
+
has_ai_rules: false
|
|
7
|
+
has_binder: false
|
|
8
|
+
has_settings: false
|
|
9
|
+
kind: frontend
|
|
10
|
+
labextension_name: jupyterlab_github_markdown_alerts_extension
|
|
11
|
+
project_short_description: Jupyterlab extension to render alerts tips like they are
|
|
12
|
+
rendered in github in markdown
|
|
13
|
+
python_name: jupyterlab_github_markdown_alerts_extension
|
|
14
|
+
repository: ''
|
|
15
|
+
test: true
|
|
16
|
+
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
*.bundle.*
|
|
2
|
+
lib/
|
|
3
|
+
node_modules/
|
|
4
|
+
*.log
|
|
5
|
+
.eslintcache
|
|
6
|
+
.stylelintcache
|
|
7
|
+
*.egg-info/
|
|
8
|
+
.ipynb_checkpoints
|
|
9
|
+
*.tsbuildinfo
|
|
10
|
+
jupyterlab_github_markdown_alerts_extension/labextension
|
|
11
|
+
# Version file is handled by hatchling
|
|
12
|
+
jupyterlab_github_markdown_alerts_extension/_version.py
|
|
13
|
+
|
|
14
|
+
# Integration tests
|
|
15
|
+
ui-tests/test-results/
|
|
16
|
+
ui-tests/playwright-report/
|
|
17
|
+
|
|
18
|
+
# Created by https://www.gitignore.io/api/python
|
|
19
|
+
# Edit at https://www.gitignore.io/?templates=python
|
|
20
|
+
|
|
21
|
+
### Python ###
|
|
22
|
+
# Virtual environments
|
|
23
|
+
.venv
|
|
24
|
+
|
|
25
|
+
# Byte-compiled / optimized / DLL files
|
|
26
|
+
__pycache__/
|
|
27
|
+
*.py[cod]
|
|
28
|
+
*$py.class
|
|
29
|
+
|
|
30
|
+
# C extensions
|
|
31
|
+
*.so
|
|
32
|
+
|
|
33
|
+
# Distribution / packaging
|
|
34
|
+
.Python
|
|
35
|
+
build/
|
|
36
|
+
develop-eggs/
|
|
37
|
+
dist/
|
|
38
|
+
downloads/
|
|
39
|
+
eggs/
|
|
40
|
+
.eggs/
|
|
41
|
+
lib/
|
|
42
|
+
lib64/
|
|
43
|
+
parts/
|
|
44
|
+
sdist/
|
|
45
|
+
var/
|
|
46
|
+
wheels/
|
|
47
|
+
pip-wheel-metadata/
|
|
48
|
+
share/python-wheels/
|
|
49
|
+
.installed.cfg
|
|
50
|
+
*.egg
|
|
51
|
+
MANIFEST
|
|
52
|
+
|
|
53
|
+
# PyInstaller
|
|
54
|
+
# Usually these files are written by a python script from a template
|
|
55
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
56
|
+
*.manifest
|
|
57
|
+
*.spec
|
|
58
|
+
|
|
59
|
+
# Installer logs
|
|
60
|
+
pip-log.txt
|
|
61
|
+
pip-delete-this-directory.txt
|
|
62
|
+
|
|
63
|
+
# Unit test / coverage reports
|
|
64
|
+
htmlcov/
|
|
65
|
+
.tox/
|
|
66
|
+
.nox/
|
|
67
|
+
.coverage
|
|
68
|
+
.coverage.*
|
|
69
|
+
.cache
|
|
70
|
+
nosetests.xml
|
|
71
|
+
coverage/
|
|
72
|
+
coverage.xml
|
|
73
|
+
*.cover
|
|
74
|
+
.hypothesis/
|
|
75
|
+
.pytest_cache/
|
|
76
|
+
|
|
77
|
+
# Translations
|
|
78
|
+
*.mo
|
|
79
|
+
*.pot
|
|
80
|
+
|
|
81
|
+
# Scrapy stuff:
|
|
82
|
+
.scrapy
|
|
83
|
+
|
|
84
|
+
# Sphinx documentation
|
|
85
|
+
docs/_build/
|
|
86
|
+
|
|
87
|
+
# PyBuilder
|
|
88
|
+
target/
|
|
89
|
+
|
|
90
|
+
# pyenv
|
|
91
|
+
.python-version
|
|
92
|
+
|
|
93
|
+
# celery beat schedule file
|
|
94
|
+
celerybeat-schedule
|
|
95
|
+
|
|
96
|
+
# SageMath parsed files
|
|
97
|
+
*.sage.py
|
|
98
|
+
|
|
99
|
+
# Spyder project settings
|
|
100
|
+
.spyderproject
|
|
101
|
+
.spyproject
|
|
102
|
+
|
|
103
|
+
# Rope project settings
|
|
104
|
+
.ropeproject
|
|
105
|
+
|
|
106
|
+
# Mr Developer
|
|
107
|
+
.mr.developer.cfg
|
|
108
|
+
.project
|
|
109
|
+
.pydevproject
|
|
110
|
+
|
|
111
|
+
# mkdocs documentation
|
|
112
|
+
/site
|
|
113
|
+
|
|
114
|
+
# mypy
|
|
115
|
+
.mypy_cache/
|
|
116
|
+
.dmypy.json
|
|
117
|
+
dmypy.json
|
|
118
|
+
|
|
119
|
+
# Pyre type checker
|
|
120
|
+
.pyre/
|
|
121
|
+
|
|
122
|
+
# End of https://www.gitignore.io/api/python
|
|
123
|
+
|
|
124
|
+
# OSX files
|
|
125
|
+
.DS_Store
|
|
126
|
+
|
|
127
|
+
# Yarn cache
|
|
128
|
+
.yarn/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
nodeLinker: node-modules
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025, Stellars Henson
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Makefile for Jupyterlab extensions version 1.26
|
|
2
|
+
# author: Stellars Henson <konrad.jelen@gmail.com>
|
|
3
|
+
# License: MIT Open Source License
|
|
4
|
+
|
|
5
|
+
.PHONY: build install clean uninstall publish dependencies mrproper increment_version install_dependencies check_dependencies upgrade help
|
|
6
|
+
.DEFAULT_GOAL := help
|
|
7
|
+
|
|
8
|
+
# Read current version from package.json (only if node is available)
|
|
9
|
+
VERSION := $(shell command -v node >/dev/null 2>&1 && node -p "require('./package.json').version" || echo "0.0.0")
|
|
10
|
+
|
|
11
|
+
## increment project version
|
|
12
|
+
increment_version:
|
|
13
|
+
@echo "Current version: $(VERSION)"
|
|
14
|
+
@bash -c 'CURRENT_VERSION=$(VERSION); \
|
|
15
|
+
IFS="." read -r major minor patch <<< "$$CURRENT_VERSION"; \
|
|
16
|
+
NEW_PATCH=$$((patch + 1)); \
|
|
17
|
+
NEW_VERSION="$$major.$$minor.$$NEW_PATCH"; \
|
|
18
|
+
echo "New version: $$NEW_VERSION"; \
|
|
19
|
+
sed -i "s/\"version\": \"$$CURRENT_VERSION\"/\"version\": \"$$NEW_VERSION\"/" package.json; '
|
|
20
|
+
|
|
21
|
+
## build packages
|
|
22
|
+
build: clean increment_version check_dependencies
|
|
23
|
+
npm install
|
|
24
|
+
yarn install
|
|
25
|
+
python -m build
|
|
26
|
+
|
|
27
|
+
## install package
|
|
28
|
+
install: build
|
|
29
|
+
pip install dist/*.whl --force-reinstall
|
|
30
|
+
|
|
31
|
+
## clean builds and installables
|
|
32
|
+
clean: uninstall check_dependencies
|
|
33
|
+
@command -v npm >/dev/null 2>&1 && npm run clean || true
|
|
34
|
+
@command -v npm >/dev/null 2>&1 && npm run clean:labextension || true
|
|
35
|
+
rm -rf dist lib || true
|
|
36
|
+
|
|
37
|
+
## uninstall package
|
|
38
|
+
uninstall: check_dependencies
|
|
39
|
+
pip uninstall -y dist/*.whl 2>/dev/null || true
|
|
40
|
+
|
|
41
|
+
## check if required dependencies are installed
|
|
42
|
+
check_dependencies:
|
|
43
|
+
@echo "Checking dependencies..."
|
|
44
|
+
@MISSING=""; \
|
|
45
|
+
command -v node >/dev/null 2>&1 || MISSING="$$MISSING node"; \
|
|
46
|
+
command -v npm >/dev/null 2>&1 || MISSING="$$MISSING npm"; \
|
|
47
|
+
command -v yarn >/dev/null 2>&1 || MISSING="$$MISSING yarn"; \
|
|
48
|
+
command -v twine >/dev/null 2>&1 || MISSING="$$MISSING twine"; \
|
|
49
|
+
if [ -n "$$MISSING" ]; then \
|
|
50
|
+
echo "Missing dependencies:$$MISSING"; \
|
|
51
|
+
echo "Installing missing dependencies..."; \
|
|
52
|
+
$(MAKE) install_dependencies; \
|
|
53
|
+
else \
|
|
54
|
+
echo "All dependencies are installed."; \
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
## publish package to public repository
|
|
58
|
+
publish: check_dependencies install
|
|
59
|
+
npm publish --access public
|
|
60
|
+
twine upload dist/*
|
|
61
|
+
|
|
62
|
+
## install all required build dependencies
|
|
63
|
+
install_dependencies:
|
|
64
|
+
conda install -y nodejs yarn --update-all
|
|
65
|
+
pip install twine
|
|
66
|
+
npm install rimraf
|
|
67
|
+
|
|
68
|
+
## upgrade all npm and yarn dependencies
|
|
69
|
+
upgrade: check_dependencies
|
|
70
|
+
jlpm up
|
|
71
|
+
|
|
72
|
+
## cleanup all build and metabuild artefacts
|
|
73
|
+
mrproper: clean uninstall
|
|
74
|
+
rm -rf node_modules .yarn || true
|
|
75
|
+
|
|
76
|
+
## prints the list of available commands
|
|
77
|
+
help:
|
|
78
|
+
@echo ""
|
|
79
|
+
@echo "$$(tput bold)Available rules:$$(tput sgr0)"
|
|
80
|
+
@sed -n -e "/^## / { \
|
|
81
|
+
h; \
|
|
82
|
+
s/.*//; \
|
|
83
|
+
:doc" \
|
|
84
|
+
-e "H; \
|
|
85
|
+
n; \
|
|
86
|
+
s/^## //; \
|
|
87
|
+
t doc" \
|
|
88
|
+
-e "s/:.*//; \
|
|
89
|
+
G; \
|
|
90
|
+
s/\\n## /---/; \
|
|
91
|
+
s/\\n/ /g; \
|
|
92
|
+
p; \
|
|
93
|
+
}" ${MAKEFILE_LIST} \
|
|
94
|
+
| LC_ALL='C' sort --ignore-case \
|
|
95
|
+
| awk -F '---' \
|
|
96
|
+
-v ncol=$$(tput cols) \
|
|
97
|
+
-v indent=19 \
|
|
98
|
+
-v col_on="$$(tput setaf 6)" \
|
|
99
|
+
-v col_off="$$(tput sgr0)" \
|
|
100
|
+
'{ \
|
|
101
|
+
printf "%s%*s%s ", col_on, -indent, $$1, col_off; \
|
|
102
|
+
n = split($$2, words, " "); \
|
|
103
|
+
line_length = ncol - indent; \
|
|
104
|
+
for (i = 1; i <= n; i++) { \
|
|
105
|
+
line_length -= length(words[i]) + 1; \
|
|
106
|
+
if (line_length <= 0) { \
|
|
107
|
+
line_length = ncol - indent - length(words[i]) - 1; \
|
|
108
|
+
printf "\n%*s ", -indent, " "; \
|
|
109
|
+
} \
|
|
110
|
+
printf "%s ", words[i]; \
|
|
111
|
+
} \
|
|
112
|
+
printf "\n"; \
|
|
113
|
+
}'
|
|
114
|
+
@echo ""
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
# EOF
|
|
118
|
+
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jupyterlab_github_markdown_alerts_extension
|
|
3
|
+
Version: 1.0.4
|
|
4
|
+
Summary: Jupyterlab extension to render alerts tips like they are rendered in github in markdown
|
|
5
|
+
Project-URL: Homepage, https://github.com/stellarshenson/jupyterlab_github_markdown_alerts_extension
|
|
6
|
+
Project-URL: Bug Tracker, https://github.com/stellarshenson/jupyterlab_github_markdown_alerts_extension/issues
|
|
7
|
+
Project-URL: Repository, https://github.com/stellarshenson/jupyterlab_github_markdown_alerts_extension.git
|
|
8
|
+
Author-email: Stellars Henson <konrad.jelen@gmail.com>
|
|
9
|
+
License: BSD 3-Clause License
|
|
10
|
+
|
|
11
|
+
Copyright (c) 2025, Stellars Henson
|
|
12
|
+
All rights reserved.
|
|
13
|
+
|
|
14
|
+
Redistribution and use in source and binary forms, with or without
|
|
15
|
+
modification, are permitted provided that the following conditions are met:
|
|
16
|
+
|
|
17
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
18
|
+
list of conditions and the following disclaimer.
|
|
19
|
+
|
|
20
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
21
|
+
this list of conditions and the following disclaimer in the documentation
|
|
22
|
+
and/or other materials provided with the distribution.
|
|
23
|
+
|
|
24
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
25
|
+
contributors may be used to endorse or promote products derived from
|
|
26
|
+
this software without specific prior written permission.
|
|
27
|
+
|
|
28
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
29
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
30
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
31
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
32
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
33
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
34
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
35
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
36
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
37
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
38
|
+
License-File: LICENSE
|
|
39
|
+
Keywords: jupyter,jupyterlab,jupyterlab-extension
|
|
40
|
+
Classifier: Framework :: Jupyter
|
|
41
|
+
Classifier: Framework :: Jupyter :: JupyterLab
|
|
42
|
+
Classifier: Framework :: Jupyter :: JupyterLab :: 4
|
|
43
|
+
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions
|
|
44
|
+
Classifier: Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt
|
|
45
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
46
|
+
Classifier: Programming Language :: Python
|
|
47
|
+
Classifier: Programming Language :: Python :: 3
|
|
48
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
49
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
50
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
51
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
52
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
53
|
+
Requires-Python: >=3.9
|
|
54
|
+
Description-Content-Type: text/markdown
|
|
55
|
+
|
|
56
|
+
# JupyterLab GitHub Markdown Alerts Extension
|
|
57
|
+
|
|
58
|
+
[](/actions/workflows/build.yml)
|
|
59
|
+
|
|
60
|
+
A JupyterLab 4 extension that renders GitHub-style alert blocks in Markdown cells, providing visual emphasis for notes, tips, warnings, and other important information.
|
|
61
|
+
|
|
62
|
+
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.
|
|
63
|
+
|
|
64
|
+
**Key Features**:
|
|
65
|
+
- Five alert types - NOTE, TIP, IMPORTANT, WARNING, CAUTION
|
|
66
|
+
- Automatic theme adaptation - colors adjust for light and dark modes
|
|
67
|
+
- GitHub-compatible syntax - works with standard GitHub markdown alert notation
|
|
68
|
+
- Icon integration - each alert type displays with its corresponding icon
|
|
69
|
+
- Zero configuration - works immediately after installation
|
|
70
|
+
|
|
71
|
+
## Requirements
|
|
72
|
+
|
|
73
|
+
- JupyterLab >= 4.0.0
|
|
74
|
+
|
|
75
|
+
## Usage
|
|
76
|
+
|
|
77
|
+
Create alert blocks in markdown cells using GitHub's alert syntax. Start with a blockquote containing the alert type, followed by content lines:
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
> [!NOTE]
|
|
81
|
+
> Useful information that users should know, even when skimming content.
|
|
82
|
+
|
|
83
|
+
> [!TIP]
|
|
84
|
+
> Helpful advice for doing things better or more easily.
|
|
85
|
+
|
|
86
|
+
> [!IMPORTANT]
|
|
87
|
+
> Key information users need to know to achieve their goal.
|
|
88
|
+
|
|
89
|
+
> [!WARNING]
|
|
90
|
+
> Urgent info that needs immediate user attention to avoid problems.
|
|
91
|
+
|
|
92
|
+
> [!CAUTION]
|
|
93
|
+
> Advises about risks or negative outcomes of certain actions.
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Each alert type renders with distinct colors and icons matching GitHub's design. Multi-line content is supported by continuing the blockquote format.
|
|
97
|
+
|
|
98
|
+
**Alert Examples**:
|
|
99
|
+
|
|
100
|
+
> [!NOTE]
|
|
101
|
+
> Useful information that users should know, even when skimming content.
|
|
102
|
+
|
|
103
|
+
> [!TIP]
|
|
104
|
+
> Helpful advice for doing things better or more easily.
|
|
105
|
+
|
|
106
|
+
> [!IMPORTANT]
|
|
107
|
+
> Key information users need to know to achieve their goal.
|
|
108
|
+
|
|
109
|
+
> [!WARNING]
|
|
110
|
+
> Urgent info that needs immediate user attention to avoid problems.
|
|
111
|
+
|
|
112
|
+
> [!CAUTION]
|
|
113
|
+
> Advises about risks or negative outcomes of certain actions.
|
|
114
|
+
|
|
115
|
+
## Settings
|
|
116
|
+
|
|
117
|
+
The extension provides optional settings accessible through JupyterLab's Settings Editor:
|
|
118
|
+
|
|
119
|
+
- **Show Alert Backgrounds** - Enable subtle colored backgrounds for alerts (disabled by default to match GitHub exactly)
|
|
120
|
+
|
|
121
|
+
To access settings: Settings → Settings Editor → GitHub Markdown Alerts
|
|
122
|
+
|
|
123
|
+
## Install
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
pip install jupyterlab_github_markdown_alerts_extension
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Uninstall
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
pip uninstall jupyterlab_github_markdown_alerts_extension
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Contributing
|
|
136
|
+
|
|
137
|
+
### Development install
|
|
138
|
+
|
|
139
|
+
Note: You will need NodeJS to build the extension package.
|
|
140
|
+
|
|
141
|
+
The `jlpm` command is JupyterLab's pinned version of
|
|
142
|
+
[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use
|
|
143
|
+
`yarn` or `npm` in lieu of `jlpm` below.
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# Clone the repo to your local environment
|
|
147
|
+
# Change directory to the jupyterlab_github_markdown_alerts_extension directory
|
|
148
|
+
|
|
149
|
+
# Set up a virtual environment and install package in development mode
|
|
150
|
+
python -m venv .venv
|
|
151
|
+
source .venv/bin/activate
|
|
152
|
+
pip install --editable "."
|
|
153
|
+
|
|
154
|
+
# Link your development version of the extension with JupyterLab
|
|
155
|
+
jupyter labextension develop . --overwrite
|
|
156
|
+
|
|
157
|
+
# Rebuild extension Typescript source after making changes
|
|
158
|
+
# IMPORTANT: Unlike the steps above which are performed only once, do this step
|
|
159
|
+
# every time you make a change.
|
|
160
|
+
jlpm build
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
# Watch the source directory in one terminal, automatically rebuilding when needed
|
|
167
|
+
jlpm watch
|
|
168
|
+
# Run JupyterLab in another terminal
|
|
169
|
+
jupyter lab
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).
|
|
173
|
+
|
|
174
|
+
By default, the `jlpm build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
jupyter lab build --minimize=False
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Development uninstall
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
pip uninstall jupyterlab_github_markdown_alerts_extension
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
In development mode, you will also need to remove the symlink created by `jupyter labextension develop`
|
|
187
|
+
command. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions`
|
|
188
|
+
folder is located. Then you can remove the symlink named `jupyterlab_github_markdown_alerts_extension` within that folder.
|
|
189
|
+
|
|
190
|
+
### Testing the extension
|
|
191
|
+
|
|
192
|
+
#### Frontend tests
|
|
193
|
+
|
|
194
|
+
This extension is using [Jest](https://jestjs.io/) for JavaScript code testing.
|
|
195
|
+
|
|
196
|
+
To execute them, execute:
|
|
197
|
+
|
|
198
|
+
```sh
|
|
199
|
+
jlpm
|
|
200
|
+
jlpm test
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
#### Integration tests
|
|
204
|
+
|
|
205
|
+
This extension uses [Playwright](https://playwright.dev/docs/intro) for the integration tests (aka user level tests).
|
|
206
|
+
More precisely, the JupyterLab helper [Galata](https://github.com/jupyterlab/jupyterlab/tree/master/galata) is used to handle testing the extension in JupyterLab.
|
|
207
|
+
|
|
208
|
+
More information are provided within the [ui-tests](./ui-tests/README.md) README.
|
|
209
|
+
|
|
210
|
+
### Packaging the extension
|
|
211
|
+
|
|
212
|
+
See [RELEASE](RELEASE.md)
|