jupyterlab-fold-all-code-extension 1.0.28__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_fold_all_code_extension-1.0.28/.claude/CLAUDE.md +23 -0
- jupyterlab_fold_all_code_extension-1.0.28/.claude/JOURNAL.md +20 -0
- jupyterlab_fold_all_code_extension-1.0.28/.claude/settings.local.json +33 -0
- jupyterlab_fold_all_code_extension-1.0.28/.copier-answers.yml +16 -0
- jupyterlab_fold_all_code_extension-1.0.28/.gitignore +128 -0
- jupyterlab_fold_all_code_extension-1.0.28/.prettierignore +6 -0
- jupyterlab_fold_all_code_extension-1.0.28/.yarnrc.yml +2 -0
- jupyterlab_fold_all_code_extension-1.0.28/CHANGELOG.md +5 -0
- jupyterlab_fold_all_code_extension-1.0.28/LICENSE +29 -0
- jupyterlab_fold_all_code_extension-1.0.28/Makefile +118 -0
- jupyterlab_fold_all_code_extension-1.0.28/PKG-INFO +86 -0
- jupyterlab_fold_all_code_extension-1.0.28/README.md +31 -0
- jupyterlab_fold_all_code_extension-1.0.28/RELEASE.md +80 -0
- jupyterlab_fold_all_code_extension-1.0.28/babel.config.js +1 -0
- jupyterlab_fold_all_code_extension-1.0.28/install.json +5 -0
- jupyterlab_fold_all_code_extension-1.0.28/jest.config.js +28 -0
- jupyterlab_fold_all_code_extension-1.0.28/jupyter-config/jupyter_nbconvert_config.d/jupyterlab_fold_all_code_extension.json +7 -0
- jupyterlab_fold_all_code_extension-1.0.28/jupyter-config/jupyter_nbconvert_config.json +7 -0
- jupyterlab_fold_all_code_extension-1.0.28/jupyter-config/jupyter_server_config.d/jupyterlab_fold_all_code_extension.json +7 -0
- jupyterlab_fold_all_code_extension-1.0.28/jupyterlab_fold_all_code_extension/__init__.py +50 -0
- jupyterlab_fold_all_code_extension-1.0.28/jupyterlab_fold_all_code_extension/_version.py +4 -0
- jupyterlab_fold_all_code_extension-1.0.28/jupyterlab_fold_all_code_extension/labextension/package.json +200 -0
- jupyterlab_fold_all_code_extension-1.0.28/jupyterlab_fold_all_code_extension/labextension/static/509.0122ff4784bcaaa2553c.js +1 -0
- jupyterlab_fold_all_code_extension-1.0.28/jupyterlab_fold_all_code_extension/labextension/static/728.908b95923664cc97b687.js +1 -0
- jupyterlab_fold_all_code_extension-1.0.28/jupyterlab_fold_all_code_extension/labextension/static/remoteEntry.dc1904884ec7c9c19a3e.js +1 -0
- jupyterlab_fold_all_code_extension-1.0.28/jupyterlab_fold_all_code_extension/labextension/static/style.js +4 -0
- jupyterlab_fold_all_code_extension-1.0.28/jupyterlab_fold_all_code_extension/labextension/static/third-party-licenses.json +16 -0
- jupyterlab_fold_all_code_extension-1.0.28/jupyterlab_fold_all_code_extension/preprocessor.py +47 -0
- jupyterlab_fold_all_code_extension-1.0.28/package-lock.json +15074 -0
- jupyterlab_fold_all_code_extension-1.0.28/package.json +195 -0
- jupyterlab_fold_all_code_extension-1.0.28/pyproject.toml +82 -0
- jupyterlab_fold_all_code_extension-1.0.28/setup.py +1 -0
- jupyterlab_fold_all_code_extension-1.0.28/src/__tests__/jupyterlab_fold_all_code_extension.spec.ts +9 -0
- jupyterlab_fold_all_code_extension-1.0.28/src/index.ts +130 -0
- jupyterlab_fold_all_code_extension-1.0.28/style/base.css +5 -0
- jupyterlab_fold_all_code_extension-1.0.28/style/index.css +1 -0
- jupyterlab_fold_all_code_extension-1.0.28/style/index.js +1 -0
- jupyterlab_fold_all_code_extension-1.0.28/tsconfig.json +26 -0
- jupyterlab_fold_all_code_extension-1.0.28/tsconfig.test.json +3 -0
- jupyterlab_fold_all_code_extension-1.0.28/ui-tests/README.md +167 -0
- jupyterlab_fold_all_code_extension-1.0.28/ui-tests/jupyter_server_test_config.py +12 -0
- jupyterlab_fold_all_code_extension-1.0.28/ui-tests/package.json +15 -0
- jupyterlab_fold_all_code_extension-1.0.28/ui-tests/playwright.config.js +14 -0
- jupyterlab_fold_all_code_extension-1.0.28/ui-tests/tests/jupyterlab_fold_all_code_extension.spec.ts +25 -0
- jupyterlab_fold_all_code_extension-1.0.28/ui-tests/yarn.lock +0 -0
- jupyterlab_fold_all_code_extension-1.0.28/yarn.lock +11015 -0
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
JupyterLab extension for folding and expanding all code cells in notebooks.
|
|
11
|
+
|
|
12
|
+
**Technology Stack**:
|
|
13
|
+
|
|
14
|
+
- TypeScript/JavaScript for frontend extension
|
|
15
|
+
- JupyterLab 4.x extension API
|
|
16
|
+
- Python packaging for distribution (pip/PyPI)
|
|
17
|
+
- npm packaging for JavaScript distribution
|
|
18
|
+
|
|
19
|
+
**Package Names**:
|
|
20
|
+
|
|
21
|
+
- npm: `jupyterlab_fold_all_code_extension`
|
|
22
|
+
- PyPI: `jupyterlab-fold-all-code-extension`
|
|
23
|
+
- GitHub repo: `stellarshenson/jupyterlab_fold_all_code_extension`
|
|
@@ -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**: Created new JupyterLab extension project `jupyterlab_fold_all_code_extension`<br>
|
|
8
|
+
**Result**: Project scaffolded using JupyterLab extension cookiecutter template. Extension provides functionality to fold and expand all code cells in notebooks, helping create clean notebooks for non-technical audiences. Initial structure includes TypeScript source in `src/index.ts`, Python package in `jupyterlab_fold_all_code_extension/`, GitHub Actions workflows for build/release, and Playwright-based UI tests. Package configured for dual distribution via npm (`jupyterlab_fold_all_code_extension`) and PyPI (`jupyterlab-fold-all-code-extension`). Created `.claude/CLAUDE.md` with project-specific configuration importing workspace-level rules. Updated `README.md` with standardized badges and simplified feature documentation.
|
|
9
|
+
|
|
10
|
+
2. **Task - Implement fold/expand and export**: Added fold/expand context menu items and nbconvert preprocessor for hiding folded code in exports<br>
|
|
11
|
+
**Result**: Implemented `src/index.ts` with `foldAllCodeCells()` and `expandAllCodeCells()` functions that set `cell.inputHidden` and `jupyter.source_hidden` metadata. Commands registered as `notebook:fold-all-code` and `notebook:expand-all-code` with context menu items on `.jp-Notebook` selector. Created `preprocessor.py` with `RemoveFoldedCodePreprocessor` that clears cell source when `jupyter.source_hidden=true`. Initial attempt using `jupyter_nbconvert_config.json` worked for CLI but not JupyterLab UI exports. Root cause: jupyter_server doesn't load nbconvert config files for "Export Notebook As" menu. Solution: converted extension to jupyter_server extension by adding `_jupyter_server_extension_points()` and `_load_jupyter_server_extension()` to `__init__.py`. The server extension modifies `Exporter.preprocessors.default_value` at startup to inject our preprocessor into all nbconvert exporters. Updated `jupyter_server_config.d/jupyterlab_fold_all_code_extension.json` to enable the server extension via `jpserver_extensions`. Export functionality now working - folded code cells hidden in HTML/PDF exports.
|
|
12
|
+
|
|
13
|
+
3. **Task - Fix JupyterLab 4.x API compatibility**: Fixed broken fold/expand commands due to metadata API changes<br>
|
|
14
|
+
**Result**: Commands were failing with `o.get is not a function` error. Root cause: JupyterLab 4.x changed the cell metadata API from `cell.model.metadata.get()/set()` (Map-like) to `cell.model.getMetadata()/setMetadata()/deleteMetadata()` (direct methods). Updated `setSourceHidden()` function in `src/index.ts` to use the new API. Also changed command IDs from `notebook:fold-all-code` to `jupyterlab_fold_all_code_extension:fold-all` to avoid potential conflicts with JupyterLab's reserved `notebook:` namespace. Both fold/expand context menu commands and export functionality now working correctly.
|
|
15
|
+
|
|
16
|
+
4. **Task - Implement CI/CD workflows**: Added GitHub Actions workflows for build, test, and release automation<br>
|
|
17
|
+
**Result**: Copied and adapted 6 workflow files from `jupyterlab_markdown_insert_content_extension` reference project. `build.yml` handles build/lint/test on push and PR, runs isolated installation tests, and executes Playwright integration tests. `check-release.yml` validates release configuration. `enforce-label.yml` enforces PR labels for changelog generation. `prep-release.yml` and `publish-release.yml` provide two-step release workflow using jupyter_releaser. `update-integration-tests.yml` allows updating Playwright snapshots via PR comment trigger. All extension name references updated from `jupyterlab_markdown_insert_content_extension` to `jupyterlab_fold_all_code_extension`.
|
|
18
|
+
|
|
19
|
+
5. **Task - Fix CI/CD workflow issues**: Resolved multiple workflow failures after initial CI/CD setup<br>
|
|
20
|
+
**Result**: Fixed three issues discovered during CI runs: (1) Prettier formatting - ran `jlpm prettier --write` on `.claude/CLAUDE.md`, `package-lock.json`, and `ui-tests/tests/jupyterlab_fold_all_code_extension.spec.ts` to fix code style issues. (2) Repository URL mismatch - jupyter_releaser check-npm failed because `package.json` had placeholder URLs. Updated `homepage`, `bugs.url`, and `repository.url` to point to `https://github.com/stellarshenson/jupyterlab_fold_all_code_extension`. (3) Python version incompatibility - `test_isolated` job used Python 3.9 but `pyproject.toml` requires `>=3.10`. Updated `build.yml` to use Python 3.10 in the test_isolated job.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"Bash(make install:*)",
|
|
5
|
+
"Bash(jupyter labextension list:*)",
|
|
6
|
+
"Bash(grep:*)",
|
|
7
|
+
"Bash(find:*)",
|
|
8
|
+
"WebSearch",
|
|
9
|
+
"WebFetch(domain:nbconvert.readthedocs.io)",
|
|
10
|
+
"WebFetch(domain:jupyterlab.readthedocs.io)",
|
|
11
|
+
"Bash(python -c:*)",
|
|
12
|
+
"WebFetch(domain:github.com)",
|
|
13
|
+
"WebFetch(domain:jupyter-server.readthedocs.io)",
|
|
14
|
+
"Bash(mkdir:*)",
|
|
15
|
+
"Bash(cat:*)",
|
|
16
|
+
"Bash(jupyter --paths:*)",
|
|
17
|
+
"Bash(jupyter nbconvert:*)",
|
|
18
|
+
"Bash(python3:*)",
|
|
19
|
+
"Bash(jupyter server extension:*)",
|
|
20
|
+
"Bash(git add:*)",
|
|
21
|
+
"Bash(git commit:*)",
|
|
22
|
+
"Bash(git push:*)",
|
|
23
|
+
"Bash(git remote add:*)",
|
|
24
|
+
"Bash(git remote:*)",
|
|
25
|
+
"Bash(jlpm clean:all:*)",
|
|
26
|
+
"Bash(jlpm build:prod:*)",
|
|
27
|
+
"Bash(pip uninstall:*)",
|
|
28
|
+
"Bash(pip install:*)",
|
|
29
|
+
"Bash(jlpm prettier:*)",
|
|
30
|
+
"Bash(jlpm run lint:check:*)"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
|
|
2
|
+
_commit: v4.5.1
|
|
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_fold_all_code_extension
|
|
11
|
+
project_short_description: Jupyterlab extension to fold and expand all code cells,
|
|
12
|
+
to help create nice notebook to share with non-technical audience
|
|
13
|
+
python_name: jupyterlab_fold_all_code_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_fold_all_code_extension/labextension
|
|
11
|
+
# Version file is handled by hatchling
|
|
12
|
+
jupyterlab_fold_all_code_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,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,86 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jupyterlab_fold_all_code_extension
|
|
3
|
+
Version: 1.0.28
|
|
4
|
+
Summary: Jupyterlab extension to fold and expand all code cells, to help create nice notebook to share with non-technical audience
|
|
5
|
+
Project-URL: Homepage, https://github.com/stellarshenson/jupyterlab_fold_all_code_extension
|
|
6
|
+
Project-URL: Bug Tracker, https://github.com/stellarshenson/jupyterlab_fold_all_code_extension/issues
|
|
7
|
+
Project-URL: Repository, https://github.com/stellarshenson/jupyterlab_fold_all_code_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.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_fold_all_code_extension
|
|
57
|
+
|
|
58
|
+
[](https://github.com/stellarshenson/jupyterlab_fold_all_code_extension/actions/workflows/build.yml)
|
|
59
|
+
[](https://www.npmjs.com/package/jupyterlab_fold_all_code_extension)
|
|
60
|
+
[](https://pypi.org/project/jupyterlab-fold-all-code-extension/)
|
|
61
|
+
[](https://pepy.tech/project/jupyterlab-fold-all-code-extension)
|
|
62
|
+
[](https://jupyterlab.readthedocs.io/en/stable/)
|
|
63
|
+
[](https://kolomolo.com)
|
|
64
|
+
|
|
65
|
+
Fold and expand all code cells in your notebooks with a single click. Perfect for creating clean notebooks to share with non-technical audiences.
|
|
66
|
+
|
|
67
|
+
## Features
|
|
68
|
+
|
|
69
|
+
- **Fold All Code** - Collapse all code cells in the active notebook
|
|
70
|
+
- **Expand All Code** - Restore visibility of all code cells
|
|
71
|
+
- **View menu integration** - Commands accessible from the View menu
|
|
72
|
+
- **Keyboard shortcuts** - Quick access via configurable keyboard shortcuts
|
|
73
|
+
|
|
74
|
+
## Installation
|
|
75
|
+
|
|
76
|
+
Requires JupyterLab 4.0.0 or higher.
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
pip install jupyterlab_fold_all_code_extension
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Uninstall
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pip uninstall jupyterlab_fold_all_code_extension
|
|
86
|
+
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# jupyterlab_fold_all_code_extension
|
|
2
|
+
|
|
3
|
+
[](https://github.com/stellarshenson/jupyterlab_fold_all_code_extension/actions/workflows/build.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/jupyterlab_fold_all_code_extension)
|
|
5
|
+
[](https://pypi.org/project/jupyterlab-fold-all-code-extension/)
|
|
6
|
+
[](https://pepy.tech/project/jupyterlab-fold-all-code-extension)
|
|
7
|
+
[](https://jupyterlab.readthedocs.io/en/stable/)
|
|
8
|
+
[](https://kolomolo.com)
|
|
9
|
+
|
|
10
|
+
Fold and expand all code cells in your notebooks with a single click. Perfect for creating clean notebooks to share with non-technical audiences.
|
|
11
|
+
|
|
12
|
+
## Features
|
|
13
|
+
|
|
14
|
+
- **Fold All Code** - Collapse all code cells in the active notebook
|
|
15
|
+
- **Expand All Code** - Restore visibility of all code cells
|
|
16
|
+
- **View menu integration** - Commands accessible from the View menu
|
|
17
|
+
- **Keyboard shortcuts** - Quick access via configurable keyboard shortcuts
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
Requires JupyterLab 4.0.0 or higher.
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
pip install jupyterlab_fold_all_code_extension
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Uninstall
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip uninstall jupyterlab_fold_all_code_extension
|
|
31
|
+
```
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Making a new release of jupyterlab_fold_all_code_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,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
|
+
};
|