markmap-anywidget 0.1.0__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.
@@ -0,0 +1,105 @@
1
+ Metadata-Version: 2.3
2
+ Name: markmap-anywidget
3
+ Version: 0.1.0
4
+ Summary: anywidget to make interactive mindmaps from markdown using markmap in interactive computing environments
5
+ Author: Daniel Fahey
6
+ Author-email: Daniel Fahey <daniel.fahey@proton.me>
7
+ License: MIT
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Framework :: Jupyter
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Topic :: Scientific/Engineering :: Visualization
16
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
+ Classifier: Topic :: Text Processing :: Markup :: Markdown
18
+ Requires-Dist: anywidget[dev]>=0.9.18
19
+ Requires-Dist: marimo>=0.15.1
20
+ Requires-Dist: watchdog>=6.0.0
21
+ Requires-Python: >=3.13
22
+ Project-URL: Bug Tracker, https://github.com/daniel-fahey/markmap_anywidget/issues
23
+ Project-URL: Homepage, https://github.com/daniel-fahey/markmap_anywidget
24
+ Project-URL: Repository, https://github.com/daniel-fahey/markmap_anywidget
25
+ Description-Content-Type: text/markdown
26
+
27
+ # markmap_anywidget
28
+
29
+ A simple [anywidget](https://github.com/manzt/anywidget) implementation of [markmap](https://markmap.js.org/) for Jupyter and marimo notebooks.
30
+
31
+ ## Installation
32
+
33
+ ```bash
34
+ # Using pip
35
+ pip install markmap_anywidget
36
+
37
+ # Using uv
38
+ uv add markmap_anywidget
39
+ ```
40
+
41
+ ## Usage with marimo
42
+
43
+ See the [`marimo` documentation](https://docs.marimo.io/api/inputs/anywidget/) for more information on using `anywidget`.
44
+
45
+ ```python
46
+ import marimo as mo
47
+ from markmap_anywidget import MarkmapWidget
48
+
49
+ widget = mo.ui.anywidget(
50
+ MarkmapWidget(
51
+ markdown_content="""
52
+ ---
53
+ markmap:
54
+ colorFreezeLevel: 2
55
+ maxWidth: 300
56
+ ---
57
+
58
+ # markmap
59
+
60
+ ## Links
61
+ - [Website](https://markmap.js.org/)
62
+ - [GitHub](https://github.com/gera2ld/markmap)
63
+
64
+ ## Features
65
+ - `inline code`
66
+ - **strong** and *italic*
67
+ - Katex: $x = {-b \pm \sqrt{b^2-4ac} \over 2a}$
68
+ """
69
+ )
70
+ )
71
+
72
+ # In a marimo cell, displaying the widget is enough
73
+ widget
74
+ ```
75
+
76
+ ## Development
77
+
78
+ This project uses [Nix](https://nixos.org/) with [nix-direnv](https://github.com/nix-community/nix-direnv) for a reproducible development environment.
79
+
80
+ ```bash
81
+ # Clone the repository
82
+ git clone git@github.com:daniel-fahey/markmap_anywidget.git
83
+ cd markmap_anywidget
84
+
85
+ # Enter Nix development environment
86
+ direnv allow
87
+
88
+ # Install dependencies
89
+ uv sync
90
+
91
+ # Build JavaScript assets (see Makefile for more targets)
92
+ make build
93
+ ```
94
+
95
+ To watch for changes and automatically rebuild:
96
+
97
+ ```bash
98
+ make dev
99
+ ```
100
+
101
+ Run the marimo example:
102
+
103
+ ```bash
104
+ uv run python -m marimo edit --watch examples/marimo.py
105
+ ```
@@ -0,0 +1,79 @@
1
+ # markmap_anywidget
2
+
3
+ A simple [anywidget](https://github.com/manzt/anywidget) implementation of [markmap](https://markmap.js.org/) for Jupyter and marimo notebooks.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ # Using pip
9
+ pip install markmap_anywidget
10
+
11
+ # Using uv
12
+ uv add markmap_anywidget
13
+ ```
14
+
15
+ ## Usage with marimo
16
+
17
+ See the [`marimo` documentation](https://docs.marimo.io/api/inputs/anywidget/) for more information on using `anywidget`.
18
+
19
+ ```python
20
+ import marimo as mo
21
+ from markmap_anywidget import MarkmapWidget
22
+
23
+ widget = mo.ui.anywidget(
24
+ MarkmapWidget(
25
+ markdown_content="""
26
+ ---
27
+ markmap:
28
+ colorFreezeLevel: 2
29
+ maxWidth: 300
30
+ ---
31
+
32
+ # markmap
33
+
34
+ ## Links
35
+ - [Website](https://markmap.js.org/)
36
+ - [GitHub](https://github.com/gera2ld/markmap)
37
+
38
+ ## Features
39
+ - `inline code`
40
+ - **strong** and *italic*
41
+ - Katex: $x = {-b \pm \sqrt{b^2-4ac} \over 2a}$
42
+ """
43
+ )
44
+ )
45
+
46
+ # In a marimo cell, displaying the widget is enough
47
+ widget
48
+ ```
49
+
50
+ ## Development
51
+
52
+ This project uses [Nix](https://nixos.org/) with [nix-direnv](https://github.com/nix-community/nix-direnv) for a reproducible development environment.
53
+
54
+ ```bash
55
+ # Clone the repository
56
+ git clone git@github.com:daniel-fahey/markmap_anywidget.git
57
+ cd markmap_anywidget
58
+
59
+ # Enter Nix development environment
60
+ direnv allow
61
+
62
+ # Install dependencies
63
+ uv sync
64
+
65
+ # Build JavaScript assets (see Makefile for more targets)
66
+ make build
67
+ ```
68
+
69
+ To watch for changes and automatically rebuild:
70
+
71
+ ```bash
72
+ make dev
73
+ ```
74
+
75
+ Run the marimo example:
76
+
77
+ ```bash
78
+ uv run python -m marimo edit --watch examples/marimo.py
79
+ ```
@@ -0,0 +1,48 @@
1
+ [project]
2
+ name = "markmap_anywidget"
3
+ version = "0.1.0"
4
+ description = "anywidget to make interactive mindmaps from markdown using markmap in interactive computing environments"
5
+ readme = "README.md"
6
+ authors = [
7
+ { name = "Daniel Fahey", email = "daniel.fahey@proton.me" }
8
+ ]
9
+ license = { text = "MIT" }
10
+ requires-python = ">=3.13"
11
+ classifiers = [
12
+ "Development Status :: 4 - Beta",
13
+ "Framework :: Jupyter",
14
+ "Intended Audience :: Developers",
15
+ "Intended Audience :: Science/Research",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3.13",
19
+ "Topic :: Scientific/Engineering :: Visualization",
20
+ "Topic :: Software Development :: Libraries :: Python Modules",
21
+ "Topic :: Text Processing :: Markup :: Markdown",
22
+ ]
23
+ dependencies = [
24
+ "anywidget[dev]>=0.9.18",
25
+ "marimo>=0.15.1",
26
+ "watchdog>=6.0.0",
27
+ ]
28
+
29
+ [project.urls]
30
+ Homepage = "https://github.com/daniel-fahey/markmap_anywidget"
31
+ Repository = "https://github.com/daniel-fahey/markmap_anywidget"
32
+ "Bug Tracker" = "https://github.com/daniel-fahey/markmap_anywidget/issues"
33
+
34
+ [project.scripts]
35
+ markmap_anywidget = "markmap_anywidget:main"
36
+
37
+ [build-system]
38
+ requires = ["uv_build>=0.8.6,<0.9.0"]
39
+ build-backend = "uv_build"
40
+
41
+ [dependency-groups]
42
+ dev = [
43
+ "mypy>=1.17.1",
44
+ "nbval>=0.11.0",
45
+ "pytest>=8.4.1",
46
+ "pytest-cov>=6.2.1",
47
+ "ruff>=0.12.11",
48
+ ]
@@ -0,0 +1,17 @@
1
+ from pathlib import Path
2
+ import anywidget
3
+ import traitlets
4
+
5
+
6
+ class MarkmapWidget(anywidget.AnyWidget):
7
+ bundler_output_dir = Path(__file__).parent / "static"
8
+ _esm = bundler_output_dir / "widget.js"
9
+ _css = """
10
+ .markmap-widget {
11
+ width: 100%;
12
+ height: 100%;
13
+ background: transparent;
14
+ }
15
+ """
16
+
17
+ markdown_content = traitlets.Unicode("").tag(sync=True)