jupyterlab-git-syntax-extension 1.0.6__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.
Files changed (46) hide show
  1. jupyterlab_git_syntax_extension-1.0.6/.claude/CLAUDE.md +49 -0
  2. jupyterlab_git_syntax_extension-1.0.6/.claude/JOURNAL.md +20 -0
  3. jupyterlab_git_syntax_extension-1.0.6/.copier-answers.yml +16 -0
  4. jupyterlab_git_syntax_extension-1.0.6/.gitignore +128 -0
  5. jupyterlab_git_syntax_extension-1.0.6/.prettierignore +6 -0
  6. jupyterlab_git_syntax_extension-1.0.6/.resources/gitignore-syntax-highlighting.png +0 -0
  7. jupyterlab_git_syntax_extension-1.0.6/.yarnrc.yml +2 -0
  8. jupyterlab_git_syntax_extension-1.0.6/CHANGELOG.md +5 -0
  9. jupyterlab_git_syntax_extension-1.0.6/LICENSE +29 -0
  10. jupyterlab_git_syntax_extension-1.0.6/Makefile +126 -0
  11. jupyterlab_git_syntax_extension-1.0.6/PKG-INFO +103 -0
  12. jupyterlab_git_syntax_extension-1.0.6/README.md +48 -0
  13. jupyterlab_git_syntax_extension-1.0.6/RELEASE.md +80 -0
  14. jupyterlab_git_syntax_extension-1.0.6/babel.config.js +1 -0
  15. jupyterlab_git_syntax_extension-1.0.6/install.json +5 -0
  16. jupyterlab_git_syntax_extension-1.0.6/jest.config.js +28 -0
  17. jupyterlab_git_syntax_extension-1.0.6/junit.xml +45 -0
  18. jupyterlab_git_syntax_extension-1.0.6/jupyterlab_git_syntax_extension/__init__.py +16 -0
  19. jupyterlab_git_syntax_extension-1.0.6/jupyterlab_git_syntax_extension/_version.py +4 -0
  20. jupyterlab_git_syntax_extension-1.0.6/jupyterlab_git_syntax_extension/labextension/package.json +204 -0
  21. jupyterlab_git_syntax_extension-1.0.6/jupyterlab_git_syntax_extension/labextension/static/200.fbca87403fcfaeeebc52.js +1 -0
  22. jupyterlab_git_syntax_extension-1.0.6/jupyterlab_git_syntax_extension/labextension/static/728.484defc75a337949b294.js +1 -0
  23. jupyterlab_git_syntax_extension-1.0.6/jupyterlab_git_syntax_extension/labextension/static/remoteEntry.906a423986be554c3fea.js +1 -0
  24. jupyterlab_git_syntax_extension-1.0.6/jupyterlab_git_syntax_extension/labextension/static/style.js +4 -0
  25. jupyterlab_git_syntax_extension-1.0.6/jupyterlab_git_syntax_extension/labextension/static/third-party-licenses.json +16 -0
  26. jupyterlab_git_syntax_extension-1.0.6/package-lock.json +15340 -0
  27. jupyterlab_git_syntax_extension-1.0.6/package.json +199 -0
  28. jupyterlab_git_syntax_extension-1.0.6/pyproject.toml +77 -0
  29. jupyterlab_git_syntax_extension-1.0.6/setup.py +1 -0
  30. jupyterlab_git_syntax_extension-1.0.6/src/__tests__/jupyterlab_git_syntax_extension.spec.ts +310 -0
  31. jupyterlab_git_syntax_extension-1.0.6/src/gitattributes-mode.ts +74 -0
  32. jupyterlab_git_syntax_extension-1.0.6/src/gitconfig-mode.ts +149 -0
  33. jupyterlab_git_syntax_extension-1.0.6/src/gitignore-mode.ts +60 -0
  34. jupyterlab_git_syntax_extension-1.0.6/src/index.ts +61 -0
  35. jupyterlab_git_syntax_extension-1.0.6/style/base.css +5 -0
  36. jupyterlab_git_syntax_extension-1.0.6/style/index.css +1 -0
  37. jupyterlab_git_syntax_extension-1.0.6/style/index.js +1 -0
  38. jupyterlab_git_syntax_extension-1.0.6/tsconfig.json +25 -0
  39. jupyterlab_git_syntax_extension-1.0.6/tsconfig.test.json +3 -0
  40. jupyterlab_git_syntax_extension-1.0.6/ui-tests/README.md +167 -0
  41. jupyterlab_git_syntax_extension-1.0.6/ui-tests/jupyter_server_test_config.py +12 -0
  42. jupyterlab_git_syntax_extension-1.0.6/ui-tests/package.json +15 -0
  43. jupyterlab_git_syntax_extension-1.0.6/ui-tests/playwright.config.js +14 -0
  44. jupyterlab_git_syntax_extension-1.0.6/ui-tests/tests/jupyterlab_git_syntax_extension.spec.ts +23 -0
  45. jupyterlab_git_syntax_extension-1.0.6/ui-tests/yarn.lock +0 -0
  46. jupyterlab_git_syntax_extension-1.0.6/yarn.lock +11011 -0
@@ -0,0 +1,49 @@
1
+ <!-- @import /home/lab/workspace/.claude/CLAUDE.md -->
2
+
3
+ # Project-Specific Configuration
4
+
5
+ This file imports workspace-level configuration from `/home/lab/workspace/.claude/CLAUDE.md`.
6
+ All workspace rules apply. Project-specific rules below strengthen or extend them.
7
+
8
+ The workspace `/home/lab/workspace/.claude/` directory contains additional instruction files
9
+ (MERMAID.md, NOTEBOOK.md, DATASCIENCE.md, GIT.md, and others) referenced by CLAUDE.md.
10
+ Consult workspace CLAUDE.md and the .claude directory to discover all applicable standards.
11
+
12
+ ## Required Workspace Skills
13
+
14
+ Skills are located in `/home/lab/workspace/.claude/skills/`. The following skills MUST be used for this project:
15
+
16
+ - **`jupyterlab-extension`** - JupyterLab extension development guidelines, CI/CD workflows, common caveats, TypeScript compatibility, syntax highlighting patterns
17
+ - **`playwright`** - browser automation for taking screenshots, UI testing, and visual verification of the extension in JupyterLab
18
+
19
+ ## Mandatory Bans (Reinforced)
20
+
21
+ The following workspace rules are STRICTLY ENFORCED for this project:
22
+
23
+ - **No automatic git tags** - only create tags when user explicitly requests
24
+ - **No automatic version changes** - only modify version in package.json/pyproject.toml/etc. when user explicitly requests
25
+ - **No automatic publishing** - never run `make publish`, `npm publish`, `twine upload`, or similar without explicit user request
26
+ - **No manual package installs if Makefile exists** - use `make install` or equivalent Makefile targets, not direct `pip install`/`uv install`/`npm install`
27
+ - **No automatic git commits or pushes** - only when user explicitly requests
28
+
29
+ ## Project Context
30
+
31
+ JupyterLab extension that adds syntax highlighting to git configuration files (.gitignore, .gitmodules, .gitattributes, .gitconfig, etc.) within the JupyterLab editor. Built with TypeScript frontend, Python packaging via hatchling, and the standard JupyterLab extension toolchain (jlpm, jupyter-builder).
32
+
33
+ - **npm package**: `jupyterlab_git_syntax_extension`
34
+ - **PyPI package**: `jupyterlab-git-syntax-extension`
35
+ - **GitHub owner**: `stellarshenson`
36
+ - **JupyterLab**: 4.x
37
+ - **Python**: >= 3.10
38
+
39
+ ## Makefile Version Synchronization
40
+
41
+ **MANDATORY**: At the start of every session involving build or Makefile operations, compare the version header in the local `Makefile` against the shared utils Makefile at `private/jupyterlab/@utils/jupyterlab-extensions/Makefile`. If the shared version is newer, update the local Makefile immediately before proceeding with any build tasks. The version is declared in line 1 as `# Makefile for Jupyterlab extensions version X.XX`.
42
+
43
+ ## Package Metadata Files
44
+
45
+ **MANDATORY**: `package.json` and `package-lock.json` must always be committed to the repository. Never add these to `.gitignore`. After any build or install operation that modifies them, ensure they are staged for the next commit.
46
+
47
+ ## Installation
48
+
49
+ **MANDATORY**: Always use `make install` to install packages. Never use direct `pip install`, `npm install`, `jlpm install`, or similar commands unless no Makefile target exists for the operation.
@@ -0,0 +1,20 @@
1
+ # Claude Code Journal
2
+
3
+ This journal tracks substantive work on documents, diagrams, and documentation content.
4
+
5
+ ---
6
+
7
+ 1. **Task - Project initialization** (v0.1.0): Initialized `jupyterlab_git_syntax_extension` as a new JupyterLab extension project with Claude Code configuration, documentation, and git repository<br>
8
+ **Result**: Created `.claude/CLAUDE.md` importing workspace-level configuration with project-specific rules for Makefile version synchronization against `private/jupyterlab/@utils/jupyterlab-extensions/Makefile`, mandatory `package.json`/`package-lock.json` tracking, and `make install` enforcement. Updated `README.md` with full badge set (GitHub Actions, npm, PyPI, downloads, JupyterLab 4, KOLOMOLO, PayPal), metapackage tip, feature list covering syntax highlighting for `.gitignore`, `.gitmodules`, `.gitattributes`, `.gitconfig` files, and trimmed all content below Uninstall section. Created `.claude/JOURNAL.md`. Initialized git repository with `git init -b main` and initial import commit.
9
+
10
+ 2. **Task - Implement syntax highlighting** (v0.1.1): Implemented full syntax highlighting for git configuration files using CodeMirror 6 StreamParser pattern from terraform extension<br>
11
+ **Result**: Created three StreamParser modules: `src/gitignore-mode.ts` tokenizing comments, negation `!`, globs (`**`, `*`, `?`), character classes `[...]`, path separators, and escaped characters; `src/gitconfig-mode.ts` tokenizing INI-style sections with `[section "subsection"]` headers, `key = value` pairs, booleans (`true`/`false`/`yes`/`no`/`on`/`off` as `atom`), numbers with size suffixes, quoted strings, comments (`#`/`;`), and backslash continuation lines; `src/gitattributes-mode.ts` tokenizing file patterns, `[attr]` macro definitions, set/unset (`-`)/unspecify (`!`) attributes, and `attr=value` pairs. Rewrote `src/index.ts` to register three languages (`gitignore`, `gitconfig`, `gitattributes`) with `IEditorLanguageRegistry` and four file types in the document registry. Added `@codemirror/language`, `@jupyterlab/codemirror`, `@jupyterlab/ui-components` to `package.json` dependencies. Wrote 19 unit tests in `src/__tests__/jupyterlab_git_syntax_extension.spec.ts` using a MockStringStream class covering all three parsers. Updated UI test activation message to match new `[jupyterlab_git_syntax_extension]` prefix. Build via `make install` succeeded, all tests pass, TypeScript compiles cleanly.
12
+
13
+ 3. **Task - Fix icon override issue** (v0.1.5): Removed `app.docRegistry.addFileType()` calls that were overriding icons set by `jupyterlab_vscode_icons_extension`<br>
14
+ **Result**: The four `addFileType()` calls in `src/index.ts` were creating competing file type entries that replaced the vscode-icons git file icon (`file-type-git`) with JupyterLab's default icon. Removed all `addFileType()` calls since `languages.addLanguage()` already handles MIME type, extension, and filename pattern associations needed for syntax highlighting - file type registration is only needed for icons, which the vscode icons extension provides. Also removed unused `@jupyterlab/ui-components` dependency from `package.json`. Added a regression test (test 20) in the unit test suite that reads `index.ts` source, strips comments, and asserts no `addFileType(` calls exist in code - this prevents the issue from being reintroduced. All 20 tests pass, `make install` succeeds.
15
+
16
+ 4. **Task - README and skill migration** (v0.1.5): Updated README with detailed feature descriptions and migrated `JUPYTERLAB_EXTENSION.md` to a workspace skill<br>
17
+ **Result**: Rewrote `README.md` with per-parser feature bullet points (gitignore globs/negation, gitconfig INI sections/booleans/numbers, gitattributes macros/set/unset), a supported files table mapping languages to filenames and MIME types, and an icon-safe design note referencing `jupyterlab_vscode_icons_extension`. Migrated `/home/lab/workspace/.claude/JUPYTERLAB_EXTENSION.md` to `/home/lab/workspace/.claude/skills/jupyterlab-extension/SKILL.md` with YAML frontmatter specifying trigger conditions (explicit request, working on JupyterLab extension, planning mode). Updated references in both workspace and home `CLAUDE.md` files to point to the skill. Updated `private/jupyterlab/new-jupyterlab-extension.sh` init prompt to tell Claude about the skill and to reference it in new project CLAUDE.md files.
18
+
19
+ 5. **Task - Screenshot and skill references** (v1.0.5): Added syntax highlighting screenshot to README and configured required workspace skills in project CLAUDE.md<br>
20
+ **Result**: Used the playwright skill to connect to the running JupyterHub instance with `JUPYTERHUB_API_TOKEN` auth header, navigated to the project's `.gitignore` file in JupyterLab, and captured a screenshot of the editor panel showing syntax highlighting (comments in green/italic, patterns in regular text). Saved screenshot to `.resources/gitignore-syntax-highlighting.png` and embedded it in `README.md` below the description. Added a "Required Workspace Skills" section to `.claude/CLAUDE.md` listing `jupyterlab-extension` and `playwright` skills with their locations at `/home/lab/workspace/.claude/skills/`. Updated `private/jupyterlab/new-jupyterlab-extension.sh` to instruct Claude to reference both workspace skills in new project CLAUDE.md files.
@@ -0,0 +1,16 @@
1
+ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2
+ _commit: v4.5.2
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_git_syntax_extension
11
+ project_short_description: Jupyterlab extension to add syntax highlighting to various
12
+ git files such as gitmodules, gitignore etc
13
+ python_name: jupyterlab_git_syntax_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_git_syntax_extension/labextension
11
+ # Version file is handled by hatchling
12
+ jupyterlab_git_syntax_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,6 @@
1
+ node_modules
2
+ **/node_modules
3
+ **/lib
4
+ **/package.json
5
+ !/package.json
6
+ jupyterlab_git_syntax_extension
@@ -0,0 +1,2 @@
1
+ nodeLinker: node-modules
2
+ enableScripts: false
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ <!-- <START NEW CHANGELOG ENTRY> -->
4
+
5
+ <!-- <END NEW CHANGELOG ENTRY> -->
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2026, 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,126 @@
1
+ # Makefile for Jupyterlab extensions version 1.30
2
+ # changelog: check twine in check_dependencies, ensure publish doesn't fail on missing twine
3
+ # author: Stellars Henson <konrad.jelen@gmail.com>
4
+ # License: MIT Open Source License
5
+
6
+ .PHONY: build install clean uninstall publish dependencies mrproper increment_version install_dependencies check_dependencies upgrade help test
7
+ .DEFAULT_GOAL := help
8
+
9
+ # Read current version from package.json (only if node is available)
10
+ VERSION := $(shell command -v node >/dev/null 2>&1 && node -p "require('./package.json').version" || echo "0.0.0")
11
+
12
+ ## increment project version
13
+ increment_version:
14
+ @echo "Current version: $(VERSION)"
15
+ @bash -c 'CURRENT_VERSION=$(VERSION); \
16
+ IFS="." read -r major minor patch <<< "$$CURRENT_VERSION"; \
17
+ NEW_PATCH=$$((patch + 1)); \
18
+ NEW_VERSION="$$major.$$minor.$$NEW_PATCH"; \
19
+ echo "New version: $$NEW_VERSION"; \
20
+ sed -i "s/\"version\": \"$$CURRENT_VERSION\"/\"version\": \"$$NEW_VERSION\"/" package.json; '
21
+
22
+ ## build packages
23
+ build: clean increment_version check_dependencies
24
+ npm install
25
+ jlpm install
26
+ npx prettier --write package-lock.json package.json
27
+ python -m build
28
+
29
+ ## install package
30
+ install: build
31
+ pip install dist/*.whl --force-reinstall
32
+
33
+ ## run tests
34
+ test: check_dependencies
35
+ jlpm test
36
+
37
+ ## clean builds and installables
38
+ clean: uninstall check_dependencies
39
+ @command -v npm >/dev/null 2>&1 && npm run clean || true
40
+ @command -v npm >/dev/null 2>&1 && npm run clean:labextension || true
41
+ rm -rf dist lib || true
42
+
43
+ ## uninstall package
44
+ uninstall: check_dependencies
45
+ pip uninstall -y dist/*.whl 2>/dev/null || true
46
+
47
+ ## check if required dependencies are installed
48
+ check_dependencies:
49
+ @echo "Checking dependencies..."
50
+ @MISSING=""; \
51
+ command -v node >/dev/null 2>&1 || MISSING="$$MISSING node"; \
52
+ command -v npm >/dev/null 2>&1 || MISSING="$$MISSING npm"; \
53
+ python -m twine --version >/dev/null 2>&1 || MISSING="$$MISSING twine"; \
54
+ if [ -n "$$MISSING" ]; then \
55
+ echo "Missing dependencies:$$MISSING"; \
56
+ echo "Installing missing dependencies..."; \
57
+ $(MAKE) install_dependencies; \
58
+ else \
59
+ echo "All dependencies are installed."; \
60
+ fi
61
+
62
+ ## publish package to public repository
63
+ publish: check_dependencies install
64
+ npm publish --access public
65
+ python -m twine upload dist/*
66
+ git add package.json package-lock.json
67
+ git commit -m "chore: post-publish $$(node -p "require('./package.json').version") package metadata"
68
+ git push
69
+
70
+ ## install all required build dependencies
71
+ install_dependencies:
72
+ pip install nodeenv twine
73
+ nodeenv --node=lts --prebuilt -p
74
+ npm install -g yarn rimraf
75
+
76
+ ## upgrade all npm and yarn dependencies
77
+ upgrade: check_dependencies
78
+ jlpm up
79
+
80
+ ## cleanup all build and metabuild artefacts
81
+ mrproper: clean uninstall
82
+ rm -rf node_modules .yarn || true
83
+
84
+ ## prints the list of available commands
85
+ help:
86
+ @echo ""
87
+ @echo "$$(tput bold)Available rules:$$(tput sgr0)"
88
+ @sed -n -e "/^## / { \
89
+ h; \
90
+ s/.*//; \
91
+ :doc" \
92
+ -e "H; \
93
+ n; \
94
+ s/^## //; \
95
+ t doc" \
96
+ -e "s/:.*//; \
97
+ G; \
98
+ s/\\n## /---/; \
99
+ s/\\n/ /g; \
100
+ p; \
101
+ }" ${MAKEFILE_LIST} \
102
+ | LC_ALL='C' sort --ignore-case \
103
+ | awk -F '---' \
104
+ -v ncol=$$(tput cols) \
105
+ -v indent=19 \
106
+ -v col_on="$$(tput setaf 6)" \
107
+ -v col_off="$$(tput sgr0)" \
108
+ '{ \
109
+ printf "%s%*s%s ", col_on, -indent, $$1, col_off; \
110
+ n = split($$2, words, " "); \
111
+ line_length = ncol - indent; \
112
+ for (i = 1; i <= n; i++) { \
113
+ line_length -= length(words[i]) + 1; \
114
+ if (line_length <= 0) { \
115
+ line_length = ncol - indent - length(words[i]) - 1; \
116
+ printf "\n%*s ", -indent, " "; \
117
+ } \
118
+ printf "%s ", words[i]; \
119
+ } \
120
+ printf "\n"; \
121
+ }'
122
+ @echo ""
123
+
124
+
125
+ # EOF
126
+
@@ -0,0 +1,103 @@
1
+ Metadata-Version: 2.4
2
+ Name: jupyterlab_git_syntax_extension
3
+ Version: 1.0.6
4
+ Summary: Jupyterlab extension to add syntax highlighting to various git files such as gitmodules, gitignore etc
5
+ Project-URL: Homepage, https://github.com/stellarshenson/jupyterlab_git_syntax_extension
6
+ Project-URL: Bug Tracker, https://github.com/stellarshenson/jupyterlab_git_syntax_extension/issues
7
+ Project-URL: Repository, https://github.com/stellarshenson/jupyterlab_git_syntax_extension.git
8
+ Author-email: Stellars Henson <konrad.jelen@gmail.com>
9
+ License: BSD 3-Clause License
10
+
11
+ Copyright (c) 2026, 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.10
49
+ Classifier: Programming Language :: Python :: 3.11
50
+ Classifier: Programming Language :: Python :: 3.12
51
+ Classifier: Programming Language :: Python :: 3.13
52
+ Classifier: Programming Language :: Python :: 3.14
53
+ Requires-Python: >=3.10
54
+ Description-Content-Type: text/markdown
55
+
56
+ # jupyterlab_git_syntax_extension
57
+
58
+ [![GitHub Actions](https://github.com/stellarshenson/jupyterlab_git_syntax_extension/actions/workflows/build.yml/badge.svg)](https://github.com/stellarshenson/jupyterlab_git_syntax_extension/actions/workflows/build.yml)
59
+ [![npm version](https://img.shields.io/npm/v/jupyterlab_git_syntax_extension.svg)](https://www.npmjs.com/package/jupyterlab_git_syntax_extension)
60
+ [![PyPI version](https://img.shields.io/pypi/v/jupyterlab-git-syntax-extension.svg)](https://pypi.org/project/jupyterlab-git-syntax-extension/)
61
+ [![Total PyPI downloads](https://static.pepy.tech/badge/jupyterlab-git-syntax-extension)](https://pepy.tech/project/jupyterlab-git-syntax-extension)
62
+ [![JupyterLab 4](https://img.shields.io/badge/JupyterLab-4-orange.svg)](https://jupyterlab.readthedocs.io/en/stable/)
63
+ [![Brought To You By KOLOMOLO](https://img.shields.io/badge/Brought%20To%20You%20By-KOLOMOLO-00ffff?style=flat)](https://kolomolo.com)
64
+ [![Donate PayPal](https://img.shields.io/badge/Donate-PayPal-blue?style=flat)](https://www.paypal.com/donate/?hosted_button_id=B4KPBJDLLXTSA)
65
+
66
+ > [!TIP]
67
+ > This extension is part of the [stellars_jupyterlab_extensions](https://github.com/stellarshenson/stellars_jupyterlab_extensions) metapackage. Install all Stellars extensions at once: `pip install stellars_jupyterlab_extensions`
68
+
69
+ Syntax highlighting for git configuration files in JupyterLab. Open `.gitignore`, `.gitmodules`, `.gitattributes`, `.gitconfig` and other git files with proper syntax colouring instead of plain text.
70
+
71
+ ![Gitignore syntax highlighting in JupyterLab](.resources/gitignore-syntax-highlighting.png)
72
+
73
+ ## Features
74
+
75
+ - **Gitignore highlighting** - comments, negation patterns (`!`), glob wildcards (`*`, `**`, `?`), character classes (`[...]`), path separators
76
+ - **Gitconfig / Gitmodules highlighting** - INI-style section headers (`[remote "origin"]`), key-value pairs, booleans (`true`/`false`/`yes`/`no`/`on`/`off`), numbers with size suffixes, comments (`#`, `;`), continuation lines
77
+ - **Gitattributes highlighting** - file patterns, macro definitions (`[attr]`), set/unset/unspecify attributes, attribute values
78
+ - **Automatic file detection** - files matched by name (`.gitignore`, `.gitconfig`, `.gitmodules`, `.gitattributes`) and extension
79
+ - **Icon-safe** - registers only language support, does not override file type icons set by other extensions (e.g. [jupyterlab_vscode_icons_extension](https://github.com/stellarshenson/jupyterlab_vscode_icons_extension))
80
+
81
+ ## Supported Files
82
+
83
+ | Language | Files | MIME Type |
84
+ | -------------- | ------------------------------------- | ---------------------- |
85
+ | Gitignore | `.gitignore` | `text/x-gitignore` |
86
+ | Git Config | `.gitconfig`, `.gitmodules`, `config` | `text/x-gitconfig` |
87
+ | Git Attributes | `.gitattributes` | `text/x-gitattributes` |
88
+
89
+ ## Requirements
90
+
91
+ - JupyterLab >= 4.0.0
92
+
93
+ ## Install
94
+
95
+ ```bash
96
+ pip install jupyterlab_git_syntax_extension
97
+ ```
98
+
99
+ ## Uninstall
100
+
101
+ ```bash
102
+ pip uninstall jupyterlab_git_syntax_extension
103
+ ```
@@ -0,0 +1,48 @@
1
+ # jupyterlab_git_syntax_extension
2
+
3
+ [![GitHub Actions](https://github.com/stellarshenson/jupyterlab_git_syntax_extension/actions/workflows/build.yml/badge.svg)](https://github.com/stellarshenson/jupyterlab_git_syntax_extension/actions/workflows/build.yml)
4
+ [![npm version](https://img.shields.io/npm/v/jupyterlab_git_syntax_extension.svg)](https://www.npmjs.com/package/jupyterlab_git_syntax_extension)
5
+ [![PyPI version](https://img.shields.io/pypi/v/jupyterlab-git-syntax-extension.svg)](https://pypi.org/project/jupyterlab-git-syntax-extension/)
6
+ [![Total PyPI downloads](https://static.pepy.tech/badge/jupyterlab-git-syntax-extension)](https://pepy.tech/project/jupyterlab-git-syntax-extension)
7
+ [![JupyterLab 4](https://img.shields.io/badge/JupyterLab-4-orange.svg)](https://jupyterlab.readthedocs.io/en/stable/)
8
+ [![Brought To You By KOLOMOLO](https://img.shields.io/badge/Brought%20To%20You%20By-KOLOMOLO-00ffff?style=flat)](https://kolomolo.com)
9
+ [![Donate PayPal](https://img.shields.io/badge/Donate-PayPal-blue?style=flat)](https://www.paypal.com/donate/?hosted_button_id=B4KPBJDLLXTSA)
10
+
11
+ > [!TIP]
12
+ > This extension is part of the [stellars_jupyterlab_extensions](https://github.com/stellarshenson/stellars_jupyterlab_extensions) metapackage. Install all Stellars extensions at once: `pip install stellars_jupyterlab_extensions`
13
+
14
+ Syntax highlighting for git configuration files in JupyterLab. Open `.gitignore`, `.gitmodules`, `.gitattributes`, `.gitconfig` and other git files with proper syntax colouring instead of plain text.
15
+
16
+ ![Gitignore syntax highlighting in JupyterLab](.resources/gitignore-syntax-highlighting.png)
17
+
18
+ ## Features
19
+
20
+ - **Gitignore highlighting** - comments, negation patterns (`!`), glob wildcards (`*`, `**`, `?`), character classes (`[...]`), path separators
21
+ - **Gitconfig / Gitmodules highlighting** - INI-style section headers (`[remote "origin"]`), key-value pairs, booleans (`true`/`false`/`yes`/`no`/`on`/`off`), numbers with size suffixes, comments (`#`, `;`), continuation lines
22
+ - **Gitattributes highlighting** - file patterns, macro definitions (`[attr]`), set/unset/unspecify attributes, attribute values
23
+ - **Automatic file detection** - files matched by name (`.gitignore`, `.gitconfig`, `.gitmodules`, `.gitattributes`) and extension
24
+ - **Icon-safe** - registers only language support, does not override file type icons set by other extensions (e.g. [jupyterlab_vscode_icons_extension](https://github.com/stellarshenson/jupyterlab_vscode_icons_extension))
25
+
26
+ ## Supported Files
27
+
28
+ | Language | Files | MIME Type |
29
+ | -------------- | ------------------------------------- | ---------------------- |
30
+ | Gitignore | `.gitignore` | `text/x-gitignore` |
31
+ | Git Config | `.gitconfig`, `.gitmodules`, `config` | `text/x-gitconfig` |
32
+ | Git Attributes | `.gitattributes` | `text/x-gitattributes` |
33
+
34
+ ## Requirements
35
+
36
+ - JupyterLab >= 4.0.0
37
+
38
+ ## Install
39
+
40
+ ```bash
41
+ pip install jupyterlab_git_syntax_extension
42
+ ```
43
+
44
+ ## Uninstall
45
+
46
+ ```bash
47
+ pip uninstall jupyterlab_git_syntax_extension
48
+ ```
@@ -0,0 +1,80 @@
1
+ # Making a new release of jupyterlab_git_syntax_extension
2
+
3
+ The extension can be published to `PyPI` and `npm` manually or using the [Jupyter Releaser](https://github.com/jupyter-server/jupyter_releaser).
4
+
5
+ ## Manual release
6
+
7
+ ### Python package
8
+
9
+ This extension can be distributed as Python packages. All of the Python
10
+ packaging instructions are in the `pyproject.toml` file to wrap your extension in a
11
+ Python package. Before generating a package, you first need to install some tools:
12
+
13
+ ```bash
14
+ pip install build twine hatch
15
+ ```
16
+
17
+ Bump the version using `hatch`. By default this will create a tag.
18
+ See the docs on [hatch-nodejs-version](https://github.com/agoose77/hatch-nodejs-version#semver) for details.
19
+
20
+ ```bash
21
+ hatch version <new-version>
22
+ ```
23
+
24
+ Make sure to clean up all the development files before building the package:
25
+
26
+ ```bash
27
+ jlpm clean:all
28
+ ```
29
+
30
+ You could also clean up the local git repository:
31
+
32
+ ```bash
33
+ git clean -dfX
34
+ ```
35
+
36
+ To create a Python source package (`.tar.gz`) and the binary package (`.whl`) in the `dist/` directory, do:
37
+
38
+ ```bash
39
+ python -m build
40
+ ```
41
+
42
+ > `python setup.py sdist bdist_wheel` is deprecated and will not work for this package.
43
+
44
+ Then to upload the package to PyPI, do:
45
+
46
+ ```bash
47
+ twine upload dist/*
48
+ ```
49
+
50
+ ### NPM package
51
+
52
+ To publish the frontend part of the extension as a NPM package, do:
53
+
54
+ ```bash
55
+ npm login
56
+ npm publish --access public
57
+ ```
58
+
59
+ ## Automated releases with the Jupyter Releaser
60
+
61
+ The extension repository should already be compatible with the Jupyter Releaser. But
62
+ the GitHub repository and the package managers need to be properly set up. Please
63
+ follow the instructions of the Jupyter Releaser [checklist](https://jupyter-releaser.readthedocs.io/en/latest/how_to_guides/convert_repo_from_repo.html).
64
+
65
+ Here is a summary of the steps to cut a new release:
66
+
67
+ - Go to the Actions panel
68
+ - Run the "Step 1: Prep Release" workflow
69
+ - Check the draft changelog
70
+ - Run the "Step 2: Publish Release" workflow
71
+
72
+ > [!NOTE]
73
+ > Check out the [workflow documentation](https://jupyter-releaser.readthedocs.io/en/latest/get_started/making_release_from_repo.html)
74
+ > for more information.
75
+
76
+ ## Publishing to `conda-forge`
77
+
78
+ If the package is not on conda forge yet, check the documentation to learn how to add it: https://conda-forge.org/docs/maintainer/adding_pkgs.html
79
+
80
+ Otherwise a bot should pick up the new version publish to PyPI, and open a new PR on the feedstock repository automatically.
@@ -0,0 +1 @@
1
+ module.exports = require('@jupyterlab/testutils/lib/babel.config');
@@ -0,0 +1,5 @@
1
+ {
2
+ "packageManager": "python",
3
+ "packageName": "jupyterlab_git_syntax_extension",
4
+ "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab_git_syntax_extension"
5
+ }
@@ -0,0 +1,28 @@
1
+ const jestJupyterLab = require('@jupyterlab/testutils/lib/jest-config');
2
+
3
+ const esModules = [
4
+ '@codemirror',
5
+ '@jupyter/ydoc',
6
+ '@jupyterlab/',
7
+ 'lib0',
8
+ 'nanoid',
9
+ 'vscode-ws-jsonrpc',
10
+ 'y-protocols',
11
+ 'y-websocket',
12
+ 'yjs'
13
+ ].join('|');
14
+
15
+ const baseConfig = jestJupyterLab(__dirname);
16
+
17
+ module.exports = {
18
+ ...baseConfig,
19
+ automock: false,
20
+ collectCoverageFrom: [
21
+ 'src/**/*.{ts,tsx}',
22
+ '!src/**/*.d.ts',
23
+ '!src/**/.ipynb_checkpoints/*'
24
+ ],
25
+ coverageReporters: ['lcov', 'text'],
26
+ testRegex: 'src/.*/.*.spec.ts[x]?$',
27
+ transformIgnorePatterns: [`/node_modules/(?!${esModules}).+`]
28
+ };