xeditor 0.1.42__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,50 @@
1
+ name: Prep Release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ version_spec:
7
+ description: New version or increment, for example 0.1.43 or next
8
+ required: true
9
+ default: next
10
+ post_version_spec:
11
+ description: Post-release development version increment
12
+ required: false
13
+ default: next
14
+ branch:
15
+ description: Target branch
16
+ required: false
17
+ default: main
18
+ dry_run:
19
+ description: Build and validate without pushing changes
20
+ required: false
21
+ default: "false"
22
+ type: choice
23
+ options: ["false", "true"]
24
+
25
+ permissions:
26
+ contents: write
27
+ pull-requests: write
28
+
29
+ jobs:
30
+ prep:
31
+ runs-on: ubuntu-latest
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ with:
35
+ fetch-depth: 0
36
+ ref: ${{ inputs.branch }}
37
+ - uses: actions/setup-python@v5
38
+ with:
39
+ python-version: "3.12"
40
+ - name: Install build frontend
41
+ run: python -m pip install build
42
+ - name: Prepare release
43
+ uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2
44
+ with:
45
+ token: ${{ secrets.GITHUB_TOKEN }}
46
+ version_spec: ${{ inputs.version_spec }}
47
+ post_version_spec: ${{ inputs.post_version_spec }}
48
+ branch: ${{ inputs.branch }}
49
+ dry_run: ${{ inputs.dry_run }}
50
+ admin_check: "false"
@@ -0,0 +1,23 @@
1
+ name: Publish PyPI
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ permissions:
7
+ contents: read
8
+
9
+ jobs:
10
+ publish:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ - uses: actions/setup-python@v5
15
+ with:
16
+ python-version: "3.12"
17
+ - run: python -m pip install build twine
18
+ - run: python -m build
19
+ - run: python -m twine check dist/*
20
+ - name: Upload to PyPI
21
+ uses: pypa/gh-action-pypi-publish@release/v1
22
+ with:
23
+ password: ${{ secrets.PYPI_API_TOKEN }}
@@ -0,0 +1,49 @@
1
+ name: Publish Release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ release_url:
7
+ description: Draft release URL from Prep Release
8
+ required: true
9
+ type: string
10
+ branch:
11
+ description: Target branch
12
+ required: false
13
+ default: main
14
+
15
+ permissions:
16
+ contents: write
17
+ pull-requests: write
18
+ id-token: write
19
+
20
+ jobs:
21
+ publish:
22
+ runs-on: ubuntu-latest
23
+ environment:
24
+ name: pypi
25
+ url: ${{ inputs.release_url }}
26
+ steps:
27
+ - uses: actions/checkout@v4
28
+ with:
29
+ fetch-depth: 0
30
+ ref: ${{ inputs.branch }}
31
+ - uses: actions/setup-python@v5
32
+ with:
33
+ python-version: "3.12"
34
+ - name: Install build frontend
35
+ run: python -m pip install build
36
+ - name: Populate release and publish to PyPI
37
+ uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2
38
+ with:
39
+ token: ${{ secrets.GITHUB_TOKEN }}
40
+ release_url: ${{ inputs.release_url }}
41
+ branch: ${{ inputs.branch }}
42
+ admin_check: "false"
43
+ - name: Finalize GitHub release
44
+ uses: jupyter-server/jupyter_releaser/.github/actions/finalize-release@v2
45
+ with:
46
+ token: ${{ secrets.GITHUB_TOKEN }}
47
+ release_url: ${{ inputs.release_url }}
48
+ branch: ${{ inputs.branch }}
49
+ admin_check: "false"
@@ -0,0 +1,29 @@
1
+ name: Test Package
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ test:
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ matrix:
17
+ python-version: ["3.9", "3.12"]
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ - uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+ - run: python -m pip install --upgrade pip
24
+ - run: python -m pip install build twine pytest
25
+ - run: python -m pip install --no-deps .
26
+ - run: python -m pytest tests
27
+ - run: xeditor --help
28
+ - run: python -m build
29
+ - run: python -m twine check dist/*
xeditor-0.1.42/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 kunwen01
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,7 @@
1
+ include README.md
2
+ include LICENSE
3
+ recursive-include src/xeditor *.html *.json *.png *.js
4
+ recursive-include tests *.py
5
+ recursive-include .github/workflows *.yml
6
+ recursive-include recipe *.yaml
7
+ recursive-include scripts *.py
@@ -0,0 +1,115 @@
1
+ Metadata-Version: 2.4
2
+ Name: xeditor
3
+ Version: 0.1.42
4
+ Summary: A local Markdown, code, and document editor
5
+ Author: kunwen01
6
+ License-Expression: MIT
7
+ Project-URL: Repository, https://github.com/kunwen01/pyme
8
+ Keywords: markdown,editor,python,local
9
+ Classifier: Environment :: Web Environment
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3 :: Only
14
+ Classifier: Topic :: Text Editors
15
+ Requires-Python: >=3.9
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Provides-Extra: release
19
+ Requires-Dist: build>=1.0; extra == "release"
20
+ Requires-Dist: twine>=5.0; extra == "release"
21
+ Dynamic: license-file
22
+
23
+ # Mixed Markdown Editor
24
+
25
+ A local web-based editor for Markdown, Python, HTML, SVG, CSV, and scripts.
26
+ The Python distribution packages the sanitized `IDE_` frontend and its
27
+ standard-library local server.
28
+
29
+ Source: <https://github.com/kunwen01/pyme>
30
+
31
+ ## Install and run
32
+
33
+ ```bash
34
+ python -m pip install xeditor
35
+ xeditor
36
+ ```
37
+
38
+ Then open <http://127.0.0.1:8000/>. The server binds to localhost by default.
39
+
40
+ ```bash
41
+ xeditor --port 8001
42
+ xeditor --host 0.0.0.0 --no-browser
43
+ python -m xeditor --help
44
+ ```
45
+
46
+ Binding to `0.0.0.0` exposes the editor and its file, terminal, and code
47
+ execution APIs to the network. Use only on a trusted network with appropriate
48
+ access controls.
49
+
50
+ Python 3.9 or newer is required. The local server uses only the Python standard
51
+ library. Script execution additionally requires the runtimes you select, such
52
+ as Python, Node.js, PowerShell, or Bash.
53
+
54
+ ## Included files
55
+
56
+ The wheel includes `index.html`, `runtimes.json`, the PNG assets, and the
57
+ vendored Mammoth and SheetJS browser libraries. No checkout of `IDE_` is needed
58
+ at runtime.
59
+
60
+ ## Development
61
+
62
+ ```bash
63
+ python -m pip install -e ".[release]"
64
+ python -m build
65
+ python -m twine check dist/*
66
+ python -m pytest tests
67
+ ```
68
+
69
+ ## Direct PyPI publishing
70
+
71
+ Build and validate first:
72
+
73
+ ```bash
74
+ python -m build
75
+ python -m twine check dist/*
76
+ python -m twine upload --repository testpypi dist/*
77
+ python -m twine upload dist/*
78
+ ```
79
+
80
+ Use a PyPI API token scoped to this project. For automated publishing, prefer
81
+ Trusted Publishing rather than storing a long-lived token.
82
+
83
+ The `Publish PyPI` GitHub Actions workflow builds and uploads the artifacts using
84
+ the repository secret `PYPI_API_TOKEN`. The Jupyter Releaser workflows below
85
+ remain available for changelog and GitHub Release automation.
86
+
87
+ ## Jupyter Releaser publishing
88
+
89
+ 1. Push this project to a GitHub repository with `pyproject.toml` on `main`.
90
+ 2. In PyPI, configure a Trusted Publisher for `xeditor` with this
91
+ repository's owner/name, workflow filename `publish-release.yml`, and
92
+ environment name `pypi`.
93
+ 3. Create a GitHub environment named `pypi`, optionally with required reviewers.
94
+ 4. Run **Prep Release** manually. It builds the distributions, updates the
95
+ version and changelog, and opens the release PR. Review and merge that PR.
96
+ 5. Run **Publish Release** manually. Supply the draft release URL if there is
97
+ more than one draft. It publishes the validated artifacts to PyPI and
98
+ finalizes the GitHub Release.
99
+
100
+ The workflows use `GITHUB_TOKEN`; no separate GitHub PAT is needed. GitHub
101
+ Actions must also be allowed to create pull requests in the repository or
102
+ organization settings.
103
+
104
+ ## conda-forge publishing
105
+
106
+ After the sdist is public on PyPI, generate its checksum and submit the recipe:
107
+
108
+ ```bash
109
+ python scripts/update_conda_recipe.py --version 0.1.42
110
+ ```
111
+
112
+ Submit `recipe/meta.yaml` to `conda-forge/staged-recipes`. Once the feedstock is
113
+ created, subsequent releases can use `conda-smithy`'s rerender/update tooling or
114
+ the feedstock bot. The conda package name is `xeditor`, while the import
115
+ package is `xeditor` and the command is `xeditor`.
@@ -0,0 +1,93 @@
1
+ # Mixed Markdown Editor
2
+
3
+ A local web-based editor for Markdown, Python, HTML, SVG, CSV, and scripts.
4
+ The Python distribution packages the sanitized `IDE_` frontend and its
5
+ standard-library local server.
6
+
7
+ Source: <https://github.com/kunwen01/pyme>
8
+
9
+ ## Install and run
10
+
11
+ ```bash
12
+ python -m pip install xeditor
13
+ xeditor
14
+ ```
15
+
16
+ Then open <http://127.0.0.1:8000/>. The server binds to localhost by default.
17
+
18
+ ```bash
19
+ xeditor --port 8001
20
+ xeditor --host 0.0.0.0 --no-browser
21
+ python -m xeditor --help
22
+ ```
23
+
24
+ Binding to `0.0.0.0` exposes the editor and its file, terminal, and code
25
+ execution APIs to the network. Use only on a trusted network with appropriate
26
+ access controls.
27
+
28
+ Python 3.9 or newer is required. The local server uses only the Python standard
29
+ library. Script execution additionally requires the runtimes you select, such
30
+ as Python, Node.js, PowerShell, or Bash.
31
+
32
+ ## Included files
33
+
34
+ The wheel includes `index.html`, `runtimes.json`, the PNG assets, and the
35
+ vendored Mammoth and SheetJS browser libraries. No checkout of `IDE_` is needed
36
+ at runtime.
37
+
38
+ ## Development
39
+
40
+ ```bash
41
+ python -m pip install -e ".[release]"
42
+ python -m build
43
+ python -m twine check dist/*
44
+ python -m pytest tests
45
+ ```
46
+
47
+ ## Direct PyPI publishing
48
+
49
+ Build and validate first:
50
+
51
+ ```bash
52
+ python -m build
53
+ python -m twine check dist/*
54
+ python -m twine upload --repository testpypi dist/*
55
+ python -m twine upload dist/*
56
+ ```
57
+
58
+ Use a PyPI API token scoped to this project. For automated publishing, prefer
59
+ Trusted Publishing rather than storing a long-lived token.
60
+
61
+ The `Publish PyPI` GitHub Actions workflow builds and uploads the artifacts using
62
+ the repository secret `PYPI_API_TOKEN`. The Jupyter Releaser workflows below
63
+ remain available for changelog and GitHub Release automation.
64
+
65
+ ## Jupyter Releaser publishing
66
+
67
+ 1. Push this project to a GitHub repository with `pyproject.toml` on `main`.
68
+ 2. In PyPI, configure a Trusted Publisher for `xeditor` with this
69
+ repository's owner/name, workflow filename `publish-release.yml`, and
70
+ environment name `pypi`.
71
+ 3. Create a GitHub environment named `pypi`, optionally with required reviewers.
72
+ 4. Run **Prep Release** manually. It builds the distributions, updates the
73
+ version and changelog, and opens the release PR. Review and merge that PR.
74
+ 5. Run **Publish Release** manually. Supply the draft release URL if there is
75
+ more than one draft. It publishes the validated artifacts to PyPI and
76
+ finalizes the GitHub Release.
77
+
78
+ The workflows use `GITHUB_TOKEN`; no separate GitHub PAT is needed. GitHub
79
+ Actions must also be allowed to create pull requests in the repository or
80
+ organization settings.
81
+
82
+ ## conda-forge publishing
83
+
84
+ After the sdist is public on PyPI, generate its checksum and submit the recipe:
85
+
86
+ ```bash
87
+ python scripts/update_conda_recipe.py --version 0.1.42
88
+ ```
89
+
90
+ Submit `recipe/meta.yaml` to `conda-forge/staged-recipes`. Once the feedstock is
91
+ created, subsequent releases can use `conda-smithy`'s rerender/update tooling or
92
+ the feedstock bot. The conda package name is `xeditor`, while the import
93
+ package is `xeditor` and the command is `xeditor`.
@@ -0,0 +1,44 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "xeditor"
7
+ version = "0.1.42"
8
+ description = "A local Markdown, code, and document editor"
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [{ name = "kunwen01" }]
14
+ keywords = ["markdown", "editor", "python", "local"]
15
+ classifiers = [
16
+ "Environment :: Web Environment",
17
+ "Intended Audience :: Developers",
18
+ "Operating System :: OS Independent",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3 :: Only",
21
+ "Topic :: Text Editors",
22
+ ]
23
+ dependencies = []
24
+
25
+ [project.urls]
26
+ Repository = "https://github.com/kunwen01/pyme"
27
+
28
+ [project.scripts]
29
+ xeditor = "xeditor.cli:main"
30
+
31
+ [project.optional-dependencies]
32
+ release = ["build>=1.0", "twine>=5.0"]
33
+
34
+ [tool.setuptools.packages.find]
35
+ where = ["src"]
36
+
37
+ [tool.setuptools.package-data]
38
+ xeditor = ["index.html", "runtimes.json", "*.png", "vendor/*.js"]
39
+
40
+ [tool.jupyter-releaser]
41
+ skip = ["check-npm"]
42
+
43
+ [tool.jupyter-releaser.options]
44
+ dist_dir = "dist"
@@ -0,0 +1,35 @@
1
+ {% set version = "0.1.42" %}
2
+
3
+ package:
4
+ name: xeditor
5
+ version: {{ version }}
6
+
7
+ source:
8
+ url: https://pypi.org/packages/source/x/xeditor/xeditor-{{ version }}.tar.gz
9
+ sha256: REPLACE_WITH_SDIST_SHA256
10
+
11
+ build:
12
+ noarch: python
13
+ number: 0
14
+
15
+ requirements:
16
+ host:
17
+ - python >=3.9
18
+ - pip
19
+ - setuptools >=77
20
+ - wheel
21
+ run:
22
+ - python >=3.9
23
+
24
+ test:
25
+ imports:
26
+ - xeditor
27
+ commands:
28
+ - xeditor --help
29
+ - python -c "from importlib.resources import files; assert files('xeditor').joinpath('index.html').is_file(); assert files('xeditor').joinpath('vendor/xlsx.full.min.js').is_file()"
30
+
31
+ about:
32
+ home: https://github.com/kunwen01/pyme
33
+ summary: A local Markdown, code, and document editor
34
+ license: MIT
35
+ license_family: MIT
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env python3
2
+ """Update the conda recipe from a published PyPI sdist."""
3
+
4
+ import argparse
5
+ import hashlib
6
+ import json
7
+ import re
8
+ from pathlib import Path
9
+ from urllib.request import urlopen
10
+
11
+
12
+ def main():
13
+ parser = argparse.ArgumentParser(description=__doc__)
14
+ parser.add_argument("--version", required=True)
15
+ parser.add_argument(
16
+ "--recipe",
17
+ type=Path,
18
+ default=Path(__file__).resolve().parents[1] / "recipe" / "meta.yaml",
19
+ )
20
+ args = parser.parse_args()
21
+
22
+ if not re.fullmatch(r"\d+\.\d+\.\d+(?:[a-zA-Z0-9.]+)?", args.version):
23
+ parser.error("version must be a PEP 440 version without a URL path")
24
+
25
+ with urlopen(f"https://pypi.org/pypi/xeditor/{args.version}/json", timeout=30) as response:
26
+ metadata = json.load(response)
27
+
28
+ sdist = next(
29
+ (item for item in metadata["urls"] if item["packagetype"] == "sdist"),
30
+ None,
31
+ )
32
+ if sdist is None:
33
+ raise SystemExit(f"No sdist found for xeditor {args.version}")
34
+
35
+ digest = hashlib.sha256()
36
+ with urlopen(sdist["url"], timeout=60) as response:
37
+ while chunk := response.read(1024 * 1024):
38
+ digest.update(chunk)
39
+ sha256 = digest.hexdigest()
40
+
41
+ recipe = args.recipe.read_text(encoding="utf-8")
42
+ recipe, count = re.subn(
43
+ r'\{% set version = "[^"]+" %\}',
44
+ f'{{% set version = "{args.version}" %}}',
45
+ recipe,
46
+ count=1,
47
+ )
48
+ if count != 1:
49
+ raise SystemExit("Could not find the recipe version declaration")
50
+ recipe, count = re.subn(
51
+ r"sha256: (?:[0-9a-f]{64}|REPLACE_WITH_SDIST_SHA256)",
52
+ f"sha256: {sha256}",
53
+ recipe,
54
+ count=1,
55
+ )
56
+ if count != 1:
57
+ raise SystemExit("Could not find the recipe SHA-256 placeholder")
58
+ args.recipe.write_text(recipe, encoding="utf-8", newline="\n")
59
+ print(f"Updated {args.recipe} to {args.version} ({sha256})")
60
+
61
+
62
+ if __name__ == "__main__":
63
+ main()
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ """Mixed Markdown Editor."""
2
+
3
+ __version__ = "0.1.42"
@@ -0,0 +1,4 @@
1
+ from .cli import main
2
+
3
+ if __name__ == "__main__":
4
+ main()
@@ -0,0 +1,3 @@
1
+ from .server import main
2
+
3
+ __all__ = ["main"]