markitecture 0.1.15__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- markitecture-0.1.15/.gitignore +41 -0
- markitecture-0.1.15/.ruff.toml +63 -0
- markitecture-0.1.15/CONTRIBUTING.md +123 -0
- markitecture-0.1.15/LICENSE +21 -0
- markitecture-0.1.15/Makefile +171 -0
- markitecture-0.1.15/PKG-INFO +271 -0
- markitecture-0.1.15/README.md +237 -0
- markitecture-0.1.15/docs/assets/badges/compact.svg +14 -0
- markitecture-0.1.15/docs/assets/badges/detailed.svg +49 -0
- markitecture-0.1.15/docs/assets/badges/minimal.svg +7 -0
- markitecture-0.1.15/docs/assets/badges/modern.svg +3 -0
- markitecture-0.1.15/docs/assets/badges/retro.svg +15 -0
- markitecture-0.1.15/docs/assets/badges/shields.svg +150 -0
- markitecture-0.1.15/docs/assets/buttons/rectangle.svg +23 -0
- markitecture-0.1.15/docs/assets/buttons/vesica-piscis.svg +30 -0
- markitecture-0.1.15/docs/assets/callouts/designs.svg +82 -0
- markitecture-0.1.15/docs/assets/callouts/info.svg +43 -0
- markitecture-0.1.15/docs/assets/cookbooks/examples.mdx +218 -0
- markitecture-0.1.15/docs/assets/favicon.svg +63 -0
- markitecture-0.1.15/docs/assets/line.svg +11 -0
- markitecture-0.1.15/docs/assets/logos/circle-dark.svg +64 -0
- markitecture-0.1.15/docs/assets/logos/circle-light.svg +64 -0
- markitecture-0.1.15/docs/assets/logos/logo-box.svg +42 -0
- markitecture-0.1.15/docs/assets/logos/logo-rectangle.svg +57 -0
- markitecture-0.1.15/docs/assets/logos/logo.svg +59 -0
- markitecture-0.1.15/docs/assets/shield.svg +37 -0
- markitecture-0.1.15/docs/community.mdx +0 -0
- markitecture-0.1.15/docs/features/content-analysis.mdx +327 -0
- markitecture-0.1.15/docs/features/health-score.mdx +17 -0
- markitecture-0.1.15/docs/features/link-management.mdx +0 -0
- markitecture-0.1.15/docs/features/static-site-generation.mdx +0 -0
- markitecture-0.1.15/docs/features/text-splitting.mdx +0 -0
- markitecture-0.1.15/docs/guides/api-reference.mdx +0 -0
- markitecture-0.1.15/docs/guides/cli-reference.mdx +244 -0
- markitecture-0.1.15/docs/guides/configuration.mdx +214 -0
- markitecture-0.1.15/docs/guides/installation.mdx +37 -0
- markitecture-0.1.15/docs/guides/quickstart.mdx +145 -0
- markitecture-0.1.15/docs/index.mdx +119 -0
- markitecture-0.1.15/docs/mint.json +124 -0
- markitecture-0.1.15/docs/philosophy.mdx +175 -0
- markitecture-0.1.15/pyproject.toml +188 -0
- markitecture-0.1.15/src/markitecture/__init__.py +41 -0
- markitecture-0.1.15/src/markitecture/__main__.py +4 -0
- markitecture-0.1.15/src/markitecture/cli/__init__.py +3 -0
- markitecture-0.1.15/src/markitecture/cli/app.py +38 -0
- markitecture-0.1.15/src/markitecture/cli/commands/__init__.py +21 -0
- markitecture-0.1.15/src/markitecture/cli/commands/config.py +84 -0
- markitecture-0.1.15/src/markitecture/cli/commands/links.py +146 -0
- markitecture-0.1.15/src/markitecture/cli/commands/metrics.py +193 -0
- markitecture-0.1.15/src/markitecture/cli/commands/mkdocs.py +39 -0
- markitecture-0.1.15/src/markitecture/cli/commands/split.py +48 -0
- markitecture-0.1.15/src/markitecture/errors.py +64 -0
- markitecture-0.1.15/src/markitecture/generators/__init__.py +3 -0
- markitecture-0.1.15/src/markitecture/generators/configs/__init__.py +0 -0
- markitecture-0.1.15/src/markitecture/generators/configs/mintlify_json.py +0 -0
- markitecture-0.1.15/src/markitecture/generators/configs/mkdocs_yaml.py +317 -0
- markitecture-0.1.15/src/markitecture/metrics/__init__.py +9 -0
- markitecture-0.1.15/src/markitecture/metrics/analyzer.py +109 -0
- markitecture-0.1.15/src/markitecture/metrics/badges/__init__.py +28 -0
- markitecture-0.1.15/src/markitecture/metrics/badges/base.py +7 -0
- markitecture-0.1.15/src/markitecture/metrics/badges/compact.py +35 -0
- markitecture-0.1.15/src/markitecture/metrics/badges/detailed.py +60 -0
- markitecture-0.1.15/src/markitecture/metrics/badges/minimal.py +19 -0
- markitecture-0.1.15/src/markitecture/metrics/badges/modern.py +45 -0
- markitecture-0.1.15/src/markitecture/metrics/badges/retro.py +23 -0
- markitecture-0.1.15/src/markitecture/metrics/badges/shields.py +124 -0
- markitecture-0.1.15/src/markitecture/metrics/svg_generator.py +70 -0
- markitecture-0.1.15/src/markitecture/processing/__init__.py +0 -0
- markitecture-0.1.15/src/markitecture/processing/link_validator.py +133 -0
- markitecture-0.1.15/src/markitecture/processing/reflink_converter.py +198 -0
- markitecture-0.1.15/src/markitecture/processing/reflink_extractor.py +82 -0
- markitecture-0.1.15/src/markitecture/processing/text_splitter.py +290 -0
- markitecture-0.1.15/src/markitecture/settings/__init__.py +9 -0
- markitecture-0.1.15/src/markitecture/settings/config.py +61 -0
- markitecture-0.1.15/src/markitecture/settings/validators.py +26 -0
- markitecture-0.1.15/src/markitecture/utils/__init__.py +5 -0
- markitecture-0.1.15/src/markitecture/utils/file_handler.py +24 -0
- markitecture-0.1.15/src/markitecture/utils/printer.py +195 -0
- markitecture-0.1.15/src/markitecture/utils/sanitizer.py +78 -0
- markitecture-0.1.15/tests/__init__.py +0 -0
- markitecture-0.1.15/tests/cli/__init__.py +0 -0
- markitecture-0.1.15/tests/cli/commands/__init__.py +0 -0
- markitecture-0.1.15/tests/cli/test_app.py +45 -0
- markitecture-0.1.15/tests/conftest.py +24 -0
- markitecture-0.1.15/tests/data/mistletoe.md +268 -0
- markitecture-0.1.15/tests/data/pydantic.md +55 -0
- markitecture-0.1.15/tests/data/readme-ai.html +966 -0
- markitecture-0.1.15/tests/data/readme-ai.md +916 -0
- markitecture-0.1.15/tests/generators/__init__.py +0 -0
- markitecture-0.1.15/tests/metrics/__init__.py +0 -0
- markitecture-0.1.15/tests/metrics/test_analyzer.py +123 -0
- markitecture-0.1.15/tests/metrics/test_svg_generator.py +0 -0
- markitecture-0.1.15/tests/processing/__init__.py +0 -0
- markitecture-0.1.15/tests/processing/test_link_validator.py +84 -0
- markitecture-0.1.15/tests/processing/test_reflink_converter.py +36 -0
- markitecture-0.1.15/tests/settings/__init__.py +0 -0
- markitecture-0.1.15/tests/settings/test_validators.py +16 -0
- markitecture-0.1.15/tests/test_validators.py +27 -0
- markitecture-0.1.15/tests/utils/__init__.py +0 -0
- markitecture-0.1.15/tests/utils/test_sanitizer.py +35 -0
- markitecture-0.1.15/uv.lock +3876 -0
@@ -0,0 +1,41 @@
|
|
1
|
+
__pycache__/
|
2
|
+
*.py[cod]
|
3
|
+
*$py.class
|
4
|
+
*.so
|
5
|
+
.Python
|
6
|
+
build/
|
7
|
+
develop-eggs/
|
8
|
+
dist/
|
9
|
+
downloads/
|
10
|
+
eggs/
|
11
|
+
.eggs/
|
12
|
+
lib/
|
13
|
+
lib64/
|
14
|
+
parts/
|
15
|
+
sdist/
|
16
|
+
var/
|
17
|
+
wheels/
|
18
|
+
*.egg-info/
|
19
|
+
.installed.cfg
|
20
|
+
*.egg
|
21
|
+
MANIFEST
|
22
|
+
.env
|
23
|
+
.venv
|
24
|
+
env/
|
25
|
+
venv/
|
26
|
+
ENV/
|
27
|
+
.idea/
|
28
|
+
.vscode/
|
29
|
+
*.swp
|
30
|
+
.DS_Store
|
31
|
+
.mypy_cache/
|
32
|
+
.pytest_cache/
|
33
|
+
.ruff_cache/
|
34
|
+
.reports/
|
35
|
+
site/
|
36
|
+
.continuerules
|
37
|
+
|
38
|
+
# -- Markitect ---------
|
39
|
+
markitect.yml
|
40
|
+
.markitecture/
|
41
|
+
notebooks/
|
@@ -0,0 +1,63 @@
|
|
1
|
+
exclude = [
|
2
|
+
".env,",
|
3
|
+
".git",
|
4
|
+
".ipynb_checkpoints",
|
5
|
+
".mypy_cache",
|
6
|
+
".nox",
|
7
|
+
".pyenv",
|
8
|
+
".pytest_cache",
|
9
|
+
".ruff_cache",
|
10
|
+
"venv",
|
11
|
+
".venv",
|
12
|
+
".vscode",
|
13
|
+
]
|
14
|
+
line-length = 88
|
15
|
+
indent-width = 4
|
16
|
+
target-version = "py311"
|
17
|
+
|
18
|
+
[lint]
|
19
|
+
preview = true
|
20
|
+
extend-select = [
|
21
|
+
"E305", # 2 blank lines before class or function
|
22
|
+
]
|
23
|
+
select = [
|
24
|
+
"ARG", # unused arguments
|
25
|
+
"B", # flake8-bugbear
|
26
|
+
"E", # pycodestyle
|
27
|
+
"E303", # too many blank lines
|
28
|
+
"E722", # bare except statements
|
29
|
+
"F", # pyflakes
|
30
|
+
"F401", # remove unused imports
|
31
|
+
"I", # isort
|
32
|
+
"N", # pep8-naming
|
33
|
+
"RUF", # ruff
|
34
|
+
"SIM", # flake8-simplify
|
35
|
+
"UP", # pyupgrade
|
36
|
+
"W", # pycodestyle
|
37
|
+
"W291", # trailing whitespace
|
38
|
+
"W293", # blank line contains whitespace
|
39
|
+
"F821", # undefined name
|
40
|
+
]
|
41
|
+
fixable = ["ALL"]
|
42
|
+
ignore = [
|
43
|
+
"UP006",
|
44
|
+
"UP007",
|
45
|
+
"UP035",
|
46
|
+
]
|
47
|
+
unfixable = []
|
48
|
+
|
49
|
+
[lint.isort]
|
50
|
+
known-third-party = ["readmeai"]
|
51
|
+
relative-imports-order = "closest-to-furthest"
|
52
|
+
split-on-trailing-comma=true
|
53
|
+
|
54
|
+
[lint.pydocstyle]
|
55
|
+
convention = "numpy"
|
56
|
+
|
57
|
+
[format]
|
58
|
+
docstring-code-format = true
|
59
|
+
docstring-code-line-length = 88
|
60
|
+
indent-style = "space"
|
61
|
+
line-ending = "auto"
|
62
|
+
preview = true
|
63
|
+
quote-style = "double"
|
@@ -0,0 +1,123 @@
|
|
1
|
+
# Contributing to Markitecture
|
2
|
+
|
3
|
+
👋 Welcome, thank you for considering contributing to Markitecture! Happy to have you join our community. Every contribution, no matter how small, helps make Markitecture better for everyone.
|
4
|
+
|
5
|
+
This document outlines how to contribute to the project and the standards we follow. Please take a few moments to read through it before submitting your first contribution.
|
6
|
+
|
7
|
+
## How You Can Contribute
|
8
|
+
|
9
|
+
There are many ways you can contribute to Markitecture:
|
10
|
+
|
11
|
+
* **🐛 Report Bugs:** Found a bug? Let us know by opening a [new issue][issues]. Please provide a clear description of the issue, including steps to reproduce it, your operating system, Python version, and Markitecture version.
|
12
|
+
* **✨ Suggest Enhancements:** Have an idea for a new feature or improvement? We'd love to hear it! Open a [new issue][issues] and describe your suggestion.
|
13
|
+
* **📖 Improve Documentation:** Help us make the documentation clearer, more comprehensive, or more accurate.
|
14
|
+
* **🛠️ Contribute Code:** Contribute new features, fix bugs, or improve existing code.
|
15
|
+
* **📣 Spread the Word:** Share Markitecture with others who might find it useful!
|
16
|
+
|
17
|
+
## Getting Started
|
18
|
+
|
19
|
+
Here's how to get started with contributing code or documentation:
|
20
|
+
|
21
|
+
1. **Fork the Repository:** Start by forking the [Markitecture repository][markitecture] on GitHub (or your chosen platform).
|
22
|
+
|
23
|
+
2. **Clone Your Fork:** Clone your forked repository to your local machine:
|
24
|
+
|
25
|
+
```bash
|
26
|
+
git clone https://github.com/eli64s/markitecture.git
|
27
|
+
cd markitecture
|
28
|
+
```
|
29
|
+
|
30
|
+
3. **Create a Branch:** Create a new branch for your changes:
|
31
|
+
|
32
|
+
```bash
|
33
|
+
git checkout -b feature/your-feature-name
|
34
|
+
```
|
35
|
+
|
36
|
+
Use a descriptive branch name that reflects your changes (e.g., `bugfix/link-validation-edge-case`, `feature/new-feature`, `docs/update-readme`). This will help you and others easily identify the purpose of the branch.
|
37
|
+
|
38
|
+
4. **Set Up Your Development Environment:**
|
39
|
+
|
40
|
+
Follow these steps to get a development version of Markitecture up and running:
|
41
|
+
|
42
|
+
1. **Create a virtual environment:**
|
43
|
+
|
44
|
+
```bash
|
45
|
+
make venv
|
46
|
+
```
|
47
|
+
|
48
|
+
2. **Install project dependencies:**
|
49
|
+
|
50
|
+
```bash
|
51
|
+
make install
|
52
|
+
make lock
|
53
|
+
```
|
54
|
+
|
55
|
+
3. **Install pre-commit hooks:**
|
56
|
+
|
57
|
+
```bash
|
58
|
+
pre-commit install
|
59
|
+
```
|
60
|
+
|
61
|
+
5. **Make Your Changes:** Implement your bug fix, feature, or documentation update.
|
62
|
+
|
63
|
+
6. **Test Your Changes:** Ensure your changes don't break existing functionality by running the tests:
|
64
|
+
|
65
|
+
```bash
|
66
|
+
make test
|
67
|
+
```
|
68
|
+
|
69
|
+
7. **Commit Your Changes:** Commit your changes with clear and concise commit messages:
|
70
|
+
|
71
|
+
```bash
|
72
|
+
git commit -m "fix: Resolved issue with link validation"
|
73
|
+
```
|
74
|
+
|
75
|
+
8. **Push to Your Fork:** Push your branch to your forked repository:
|
76
|
+
|
77
|
+
```bash
|
78
|
+
git push origin feature/your-feature-name
|
79
|
+
```
|
80
|
+
|
81
|
+
9. **Open a Pull Request:** Go to the original Markitecture repository and open a pull request from your branch. Provide a clear description of your changes in the pull request.
|
82
|
+
|
83
|
+
## Code Style and Standards
|
84
|
+
|
85
|
+
* We adhere to the [PEP 8](https://www.python.org/dev/peps/pep-0008/) style guide for Python code.
|
86
|
+
* We use `ruff` for code formatting and linting. You can run it locally before committing:
|
87
|
+
|
88
|
+
```bash
|
89
|
+
make format-and-lint
|
90
|
+
```
|
91
|
+
* Add tests for any new features or bug fixes.
|
92
|
+
* Document any new or changed functionality in the code using docstrings and, if necessary, update the user-facing documentation.
|
93
|
+
* Keep your code clean, well-commented, and easy to understand.
|
94
|
+
|
95
|
+
## Code of Conduct
|
96
|
+
|
97
|
+
We expect all contributors to follow our [Code of Conduct]([link to your Code of Conduct - e.g., CODE_OF_CONDUCT.md]). Please be respectful and considerate of others in all your interactions within the project.
|
98
|
+
|
99
|
+
## Pull Request Process
|
100
|
+
|
101
|
+
1. We'll review your pull request as soon as possible.
|
102
|
+
2. We may suggest changes or improvements. We encourage open feedback and collaboration.
|
103
|
+
3. Once your pull request is approved, it will be merged into the `main` branch.
|
104
|
+
|
105
|
+
## Questions and Support
|
106
|
+
|
107
|
+
If you have any questions or need help with contributing, please don't hesitate to:
|
108
|
+
|
109
|
+
* Open an [issue][issues] in the project's issue tracker.
|
110
|
+
* Join our [discussion forum][discussions] and ask your question there.
|
111
|
+
|
112
|
+
We appreciate your contributions and look forward to collaborating with you!
|
113
|
+
|
114
|
+
---
|
115
|
+
|
116
|
+
**Cheers!**
|
117
|
+
|
118
|
+
The Markitecture Team
|
119
|
+
|
120
|
+
<!-- REFERENCE LINKS -->
|
121
|
+
[discussions]: https://github.com/eli64s/markitecture/discussions
|
122
|
+
[issues]: https://github.com/eli64s/markitecture/issues
|
123
|
+
[markitecture]: https://github.com/eli64s/markitecture/
|
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2024 to present Markitecture and individual contributors.
|
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,171 @@
|
|
1
|
+
SHELL := /bin/bash
|
2
|
+
.ONESHELL:
|
3
|
+
.SHELLFLAGS := -eu -o pipefail -c
|
4
|
+
.DELETE_ON_ERROR:
|
5
|
+
MAKEFLAGS += --warn-undefined-variables
|
6
|
+
MAKEFLAGS += --no-builtin-rules
|
7
|
+
|
8
|
+
DOCS_DIR := docs
|
9
|
+
PYPROJECT_TOML := pyproject.toml
|
10
|
+
PYPI_VERSION := 0.1.15
|
11
|
+
PYTHON_VERSION := 3.11
|
12
|
+
TARGET := src/markitecture
|
13
|
+
TARGET_TEST := tests
|
14
|
+
TEST_DATA := tests/data/readme-ai.md
|
15
|
+
|
16
|
+
|
17
|
+
# -------------------------------------------------------------------
|
18
|
+
# Build: Build the distribution package using uv
|
19
|
+
# -------------------------------------------------------------------
|
20
|
+
|
21
|
+
|
22
|
+
.PHONY: build
|
23
|
+
build: ## Build the distribution package using uv
|
24
|
+
uv build
|
25
|
+
uv pip install dist/markitecture-$(PYPI_VERSION)-py3-none-any.whl
|
26
|
+
|
27
|
+
.PHONY: install
|
28
|
+
install: ## Install all dependencies from pyproject.toml
|
29
|
+
uv sync --dev --group lint --group test --all-extras
|
30
|
+
|
31
|
+
.PHONY: lock
|
32
|
+
lock: ## Lock dependencies declared in pyproject.toml
|
33
|
+
uv pip compile $(PYPROJECT_TOML) --all-extras
|
34
|
+
|
35
|
+
.PHONY: requirements
|
36
|
+
requirements: ## Generate requirements files from pyproject.toml
|
37
|
+
uv pip compile $(PYPROJECT_TOML) -o requirements.txtiu
|
38
|
+
uv pip compile $(PYPROJECT_TOML) --all-extras -o requirements-dev.txt
|
39
|
+
|
40
|
+
.PHONY: sync
|
41
|
+
sync: ## Sync environment with pyproject.toml
|
42
|
+
uv sync --all-groups --dev
|
43
|
+
|
44
|
+
.PHONY: update
|
45
|
+
update: ## Update all dependencies from pyproject.toml
|
46
|
+
uv lock --upgrade
|
47
|
+
|
48
|
+
.PHONY: venv
|
49
|
+
venv: ## Create a virtual environment
|
50
|
+
uv venv --python $(PYTHON_VERSION)
|
51
|
+
|
52
|
+
|
53
|
+
# -------------------------------------------------------------------
|
54
|
+
# Documenation: Build and serve static site using MkDocs
|
55
|
+
# -------------------------------------------------------------------
|
56
|
+
|
57
|
+
.PHONY: docs
|
58
|
+
docs: ## Serve mintlify documentation locally
|
59
|
+
cd $(DOCS_DIR) && npx mintlify dev --verbose
|
60
|
+
|
61
|
+
|
62
|
+
# -------------------------------------------------------------------
|
63
|
+
# Format & Lint: Format and lint Python files using Ruff and MyPy
|
64
|
+
# -------------------------------------------------------------------
|
65
|
+
|
66
|
+
|
67
|
+
.PHONY: format-toml
|
68
|
+
format-toml: ## Format TOML files using pyproject-fmt
|
69
|
+
uvx --isolated pyproject-fmt $(TOML_FILE) --indent 4
|
70
|
+
|
71
|
+
.PHONY: format
|
72
|
+
format: ## Format Python files using Ruff
|
73
|
+
@echo -e "\n► Running the Ruff formatter..."
|
74
|
+
uvx --isolated ruff format $(TARGET)
|
75
|
+
|
76
|
+
.PHONY: lint
|
77
|
+
lint: ## Lint Python files using Ruff
|
78
|
+
@echo -e "\n ►Running the Ruff linter..."
|
79
|
+
uvx --isolated ruff check $(TARGET) --fix
|
80
|
+
|
81
|
+
.PHONY: format-and-lint
|
82
|
+
format-and-lint: format lint ## Format and lint Python files
|
83
|
+
|
84
|
+
.PHONY: typecheck-mypy
|
85
|
+
typecheck-mypy: ## Type-check Python files using MyPy
|
86
|
+
uv run mypy $(TARGET)
|
87
|
+
|
88
|
+
.PHONY: typecheck-pyright
|
89
|
+
typecheck-pyright: ## Type-check Python files using Pyright
|
90
|
+
uv run pyright $(TARGET)
|
91
|
+
|
92
|
+
|
93
|
+
# -------------------------------------------------------------------
|
94
|
+
# Tests: Run test suite using Pytest
|
95
|
+
# -------------------------------------------------------------------
|
96
|
+
|
97
|
+
|
98
|
+
.PHONY: test
|
99
|
+
test: ## Run test suite using Pytest
|
100
|
+
uv run pytest $(TARGET_TEST) --config-file $(PYPROJECT_TOML)
|
101
|
+
|
102
|
+
|
103
|
+
# -------------------------------------------------------------------
|
104
|
+
# Examples: Batch run CLI examples for documentation and testing
|
105
|
+
# -------------------------------------------------------------------
|
106
|
+
|
107
|
+
|
108
|
+
.PHONY: run-examples
|
109
|
+
run-examples: ## Run examples for documentation and testing
|
110
|
+
@echo -e "\n► Running split commands..."
|
111
|
+
uv run markitect --split.i $(TEST_DATA) --split.o examples/text-splitter/header-2 --split.level "##"
|
112
|
+
@echo -e "\n--------------------------------------------------------------------------------\n"
|
113
|
+
uv run markitect --split.i $(TEST_DATA) --split.o examples/text-splitter/header-3/ --split.level "###"
|
114
|
+
@echo -e "\n--------------------------------------------------------------------------------\n"
|
115
|
+
uv run markitect --split.i $(TEST_DATA) --split.o examples/text-splitter/header-4/ --split.level "####"
|
116
|
+
@echo -e "\n--------------------------------------------------------------------------------\n"
|
117
|
+
uv run markitect --reflinks.i tests/data/pydantic.md --reflinks.o examples/reference-links/reflinks_conversion.md
|
118
|
+
@echo -e "\n--------------------------------------------------------------------------------\n"
|
119
|
+
@echo -e "\n► Checking for markdown files in examples/text-splitter/header-2..."
|
120
|
+
@if [ -z "$$(find examples/text-splitter/header-2 -maxdepth 1 -type f -name '*.md')" ]; then \
|
121
|
+
echo "Warning: No markdown files found in examples/text-splitter/header-2. Skipping MkDocs config generation."; \
|
122
|
+
else \
|
123
|
+
echo "Generating MkDocs static site config for: examples/text-splitter/header-2"; \
|
124
|
+
uv run markitect --metrics.input $(TEST_DATA) --metrics.style all --metrics.output-dir examples/metrics; \
|
125
|
+
fi
|
126
|
+
@echo -e "\n--------------------------------------------------------------------------------\n"
|
127
|
+
|
128
|
+
.PHONY: run-pypi
|
129
|
+
run-pypi: ## Run examples for documentation
|
130
|
+
uvx --isolated markitect --split.i $(TEST_DATA) --split.o examples/text-splitter/pypi/header-2/ --split.level "##"
|
131
|
+
uvx --isolated markitect --split.i $(TEST_DATA) --split.o examples/text-splitter/pypi/header-3/ --split.level "###"
|
132
|
+
uvx --isolated markitect --split.i $(TEST_DATA) --split.o examples/text-splitter/pypi/header-4/ --split.level "####"
|
133
|
+
uvx --isolated markitect --reflinks.i tests/data/pydantic.md --reflinks.o examples/reference-links/reflinks_conversion.md
|
134
|
+
|
135
|
+
|
136
|
+
# -------------------------------------------------------------------
|
137
|
+
# Utils: Utility commands for managing the project
|
138
|
+
# -------------------------------------------------------------------
|
139
|
+
|
140
|
+
|
141
|
+
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
|
142
|
+
|
143
|
+
clean-build: ## remove build artifacts
|
144
|
+
rm -fr build/
|
145
|
+
rm -fr dist/
|
146
|
+
rm -fr .eggs/
|
147
|
+
rm -fr .venv/
|
148
|
+
find . -name '*.egg-info' -exec rm -fr {} +
|
149
|
+
find . -name '*.egg' -exec rm -f {} +
|
150
|
+
|
151
|
+
clean-pyc: ## remove Python file artifacts
|
152
|
+
find . -name '*.pyc' -exec rm -f {} +
|
153
|
+
find . -name '*.pyo' -exec rm -f {} +
|
154
|
+
find . -name '*~' -exec rm -f {} +
|
155
|
+
find . -name '__pycache__' -exec rm -fr {} +
|
156
|
+
|
157
|
+
clean-test: ## remove test and coverage artifacts
|
158
|
+
rm -fr .tox/
|
159
|
+
rm -f .coverage
|
160
|
+
rm -fr htmlcov/
|
161
|
+
rm -fr .pytest_cache
|
162
|
+
|
163
|
+
.PHONY: help
|
164
|
+
help: ## Display this help
|
165
|
+
@echo ""
|
166
|
+
@echo "Usage: make [target]"
|
167
|
+
@echo ""
|
168
|
+
@awk 'BEGIN {FS = ":.*?## "; printf "\033[1m%-20s %-50s\033[0m\n", "Target", "Description"; \
|
169
|
+
printf "%-20s %-50s\n", "------", "-----------";} \
|
170
|
+
/^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-20s\033[0m %-50s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
171
|
+
@echo ""
|
@@ -0,0 +1,271 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: markitecture
|
3
|
+
Version: 0.1.15
|
4
|
+
Summary: ❂ Markdown tools for modular and flexible docs: link validation, reference link conversion, text splitting, & more.
|
5
|
+
Project-URL: documentation, https://github.com/eli64s/markitecture/blob/main/README.md
|
6
|
+
Project-URL: homepage, https://github.com/eli64s/markitecture
|
7
|
+
Project-URL: repository, https://github.com/eli64s/markitecture
|
8
|
+
Author-email: Eli Salamie <egsalamie@gmail.com>
|
9
|
+
License-Expression: MIT
|
10
|
+
License-File: LICENSE
|
11
|
+
Keywords: automated-markdown,content-management,documentation-tools,intelligent-documentation,markdown-ai,markdown-link-checker,markdown-parser,markdown-splitter,markdown-tools,mkdocs,modular-docs,readme-generator,reference-links,smart-markdown
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
13
|
+
Classifier: Framework :: Pydantic
|
14
|
+
Classifier: Framework :: Pytest
|
15
|
+
Classifier: Intended Audience :: Developers
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
17
|
+
Classifier: Operating System :: OS Independent
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
22
|
+
Classifier: Topic :: Software Development :: Documentation
|
23
|
+
Classifier: Topic :: Software Development :: Libraries
|
24
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
25
|
+
Classifier: Typing :: Typed
|
26
|
+
Requires-Python: <=3.14,>=3.10
|
27
|
+
Requires-Dist: httpx
|
28
|
+
Requires-Dist: pydantic
|
29
|
+
Requires-Dist: pydantic-settings
|
30
|
+
Requires-Dist: pyyaml
|
31
|
+
Requires-Dist: rich
|
32
|
+
Requires-Dist: toml; python_full_version < '3.11'
|
33
|
+
Description-Content-Type: text/markdown
|
34
|
+
|
35
|
+
<div id="top" align="center">
|
36
|
+
|
37
|
+
<!-- HEADER -->
|
38
|
+
<picture>
|
39
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/eli64s/markitecture/13c4b28213fb8e8c75299ef5c905ce1d195a6988/docs/assets/logos/circle-dark.svg">
|
40
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/eli64s/markitecture/13c4b28213fb8e8c75299ef5c905ce1d195a6988/docs/assets/logos/circle-light.svg">
|
41
|
+
<img alt="markitecture Logo" src="https://raw.githubusercontent.com/eli64s/markitecture/13c4b28213fb8e8c75299ef5c905ce1d195a6988/docs/assets/logos/circle-light.svg" width="900" style="max-width: 100%;">
|
42
|
+
</picture>
|
43
|
+
|
44
|
+
<h3 align="center">
|
45
|
+
Building Blocks for Brilliant Documentation.
|
46
|
+
</h3>
|
47
|
+
<p align="center">
|
48
|
+
<em>Markitecture: The Python toolkit that empowers modular Markdown workflows.</em>
|
49
|
+
</p>
|
50
|
+
|
51
|
+
<!-- BADGES -->
|
52
|
+
<div align="center">
|
53
|
+
<p align="center" style="margin-bottom: 20px;">
|
54
|
+
<a href="https://github.com/eli64s/markitecture/actions">
|
55
|
+
<img src="https://img.shields.io/github/actions/workflow/status/eli64s/markitecture/ci.yml?label=CI&style=flat&logo=githubactions&logoColor=white&labelColor=2A2A2A&color=FFD700" alt="GitHub Actions" />
|
56
|
+
</a>
|
57
|
+
<a href="https://app.codecov.io/gh/eli64s/markitecture">
|
58
|
+
<img src="https://img.shields.io/codecov/c/github/eli64s/markitecture?label=Coverage&style=flat&logo=codecov&logoColor=white&labelColor=2A2A2A&color=3fe1c0" alt="Coverage" />
|
59
|
+
</a>
|
60
|
+
<a href="https://pypi.org/project/markitecture/">
|
61
|
+
<img src="https://img.shields.io/pypi/v/markitecture?label=PyPI&style=flat&logo=pypi&logoColor=white&labelColor=2A2A2A&color=00E5FF" alt="PyPI Version" />
|
62
|
+
</a>
|
63
|
+
<a href="https://github.com/eli64s/markitecture">
|
64
|
+
<img src="https://img.shields.io/pypi/pyversions/markitecture?label=Python&style=flat&logo=python&logoColor=white&labelColor=2A2A2A&color=7934C5" alt="Python Version" />
|
65
|
+
</a>
|
66
|
+
<a href="https://opensource.org/license/mit/">
|
67
|
+
<img src="https://img.shields.io/github/license/eli64s/markitecture?label=License&style=flat&logo=opensourceinitiative&logoColor=white&labelColor=2A2A2A&color=FF00FF" alt="MIT License">
|
68
|
+
</a>
|
69
|
+
</p>
|
70
|
+
</div>
|
71
|
+
|
72
|
+
<div align="center">
|
73
|
+
<img src="https://raw.githubusercontent.com/eli64s/markitecture/216a92894e6f30c707a214fad5a5fba417e3bc39/docs/assets/line.svg" alt="separator" width="100%" height="2px" style="margin: 20px 0;">
|
74
|
+
</div>
|
75
|
+
|
76
|
+
</div>
|
77
|
+
<!-- HEADER END -->
|
78
|
+
|
79
|
+
## What is Markitecture?
|
80
|
+
|
81
|
+
**Markitecture** is a comprehensive Python toolkit designed to streamline your Markdown workflow. Whether you're managing documentation, writing technical content, or maintaining a knowledge base, Markitecture provides essential utilities to make working with Markdown files easier and more efficient.
|
82
|
+
|
83
|
+
### Key Features
|
84
|
+
|
85
|
+
- **Text Splitting:** Break down large Markdown files into manageable sections based on headings or custom rules.
|
86
|
+
- **Link Management:** Convert between inline and reference-style links, validate URLs, and identify broken links.
|
87
|
+
- **Content Analysis:** Analyze document structure, extract metadata, and ensure consistent formatting.
|
88
|
+
- **Documentation Tools:** Generate configurations for static site generators like [MkDocs][mkdocs].
|
89
|
+
|
90
|
+
---
|
91
|
+
|
92
|
+
## Quick Start
|
93
|
+
|
94
|
+
### Installation
|
95
|
+
|
96
|
+
Install from [PyPI][pypi] using your preferred package manager.
|
97
|
+
|
98
|
+
#### <img width="2%" src="https://simpleicons.org/icons/python.svg"> pip
|
99
|
+
|
100
|
+
Use [pip][pip] (recommended for most users):
|
101
|
+
|
102
|
+
```sh
|
103
|
+
pip install -U markitecture
|
104
|
+
```
|
105
|
+
|
106
|
+
#### <img width="2%" src="https://simpleicons.org/icons/pipx.svg"> pipx
|
107
|
+
|
108
|
+
Install in an isolated environment with [pipx][pipx]:
|
109
|
+
|
110
|
+
```sh
|
111
|
+
❯ pipx install markitecture
|
112
|
+
```
|
113
|
+
|
114
|
+
#### <img width="2%" src="https://simpleicons.org/icons/uv.svg"> uv
|
115
|
+
|
116
|
+
For the fastest installation use [uv][uv]:
|
117
|
+
|
118
|
+
```sh
|
119
|
+
❯ uv tool install markitecture
|
120
|
+
```
|
121
|
+
|
122
|
+
### Using the CLI
|
123
|
+
|
124
|
+
#### Text Splitting
|
125
|
+
|
126
|
+
Split large Markdown files into smaller, organized sections:
|
127
|
+
|
128
|
+
```sh
|
129
|
+
markitect \
|
130
|
+
--split.i tests/data/readme-ai.md \
|
131
|
+
--split.o examples/split-sections-h2
|
132
|
+
```
|
133
|
+
|
134
|
+
#### Link Validation
|
135
|
+
|
136
|
+
Check for broken links in your documentation:
|
137
|
+
|
138
|
+
```sh
|
139
|
+
markitect --check-links.input tests/data/pydantic.md
|
140
|
+
```
|
141
|
+
|
142
|
+
In your terminal, you'll see a summary of the results:
|
143
|
+
|
144
|
+
```console
|
145
|
+
|
146
|
+
Markdown Link Check Results
|
147
|
+
|
148
|
+
┏━━━━━━━━┳━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━┓
|
149
|
+
┃ Status ┃ Line ┃ Link ┃ Error ┃
|
150
|
+
┡━━━━━━━━╇━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━┩
|
151
|
+
│ ✓ │ 2 │ https://img.shields.io/github/actions/workflow/status/pydantic/pydantic/ci.yml?b… │ │
|
152
|
+
│ ✓ │ 3 │ https://coverage-badge.samuelcolvin.workers.dev/pydantic/pydantic.svg │ │
|
153
|
+
│ ✓ │ 4 │ https://img.shields.io/pypi/v/pydantic.svg │ │
|
154
|
+
│ ✓ │ 5 │ https://img.shields.io/conda/v/conda-forge/pydantic.svg │ │
|
155
|
+
│ ✓ │ 6 │ https://static.pepy.tech/badge/pydantic/month │ │
|
156
|
+
│ ✓ │ 7 │ https://img.shields.io/pypi/pyversions/pydantic.svg │ │
|
157
|
+
│ ✓ │ 8 │ https://img.shields.io/github/license/pydantic/pydantic.svg │ │
|
158
|
+
│ ✓ │ 9 │ https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/p… │ │
|
159
|
+
│ ✓ │ 18 │ https://pydantic.dev/articles/logfire-announcement │ │
|
160
|
+
│ ✓ │ 24 │ https://docs.pydantic.dev/ │ │
|
161
|
+
│ ✓ │ 24 │ https://github.com/pydantic/pydantic/tree/1.10.X-fixes │ │
|
162
|
+
│ ✓ │ 28 │ https://docs.pydantic.dev/ │ │
|
163
|
+
│ 𝗫 │ 34 │ https://docs.pydantic.dev/install/invalid-link │ HTTP 404 │
|
164
|
+
└────────┴──────┴───────────────────────────────────────────────────────────────────────────────────┴──────────┘
|
165
|
+
|
166
|
+
Summary: 1 broken links out of 13 total links.
|
167
|
+
```
|
168
|
+
|
169
|
+
#### Reference Link Conversion
|
170
|
+
|
171
|
+
In Markdown, [reference-style links][reflinks] let you write cleaner text by keeping URLs in a reference section - think footnotes for the web.
|
172
|
+
|
173
|
+
To convert inline links to reference-style links:
|
174
|
+
|
175
|
+
```sh
|
176
|
+
markitect \
|
177
|
+
--reflinks.input tests/data/pydantic.md \
|
178
|
+
--reflinks.output with_refs.md
|
179
|
+
```
|
180
|
+
|
181
|
+
#### Static Site Configuration Generation
|
182
|
+
|
183
|
+
Generate a MkDocs configuration [(mkdocs.yml)][mkdocs.yml] from a given Markdown file.
|
184
|
+
|
185
|
+
1. Split the Markdown file into sections:
|
186
|
+
|
187
|
+
```sh
|
188
|
+
markitect \
|
189
|
+
--split.i tests/data/readme-ai.md \
|
190
|
+
--split.o examples/split-sections-h2
|
191
|
+
```
|
192
|
+
|
193
|
+
2. Generate the MkDocs configuration:
|
194
|
+
|
195
|
+
```sh
|
196
|
+
markitect \
|
197
|
+
--mkdocs.dir examples/split-sections-h2 \
|
198
|
+
--mkdocs.site-name "MyDocsSite"
|
199
|
+
```
|
200
|
+
|
201
|
+
<sub>
|
202
|
+
|
203
|
+
See additional example and usage details in the [here][examples].
|
204
|
+
|
205
|
+
</sub>
|
206
|
+
|
207
|
+
<!--
|
208
|
+
>[!NOTE]
|
209
|
+
> Explore the [Official Documentation][docs] for more detailed guides and examples.
|
210
|
+
-->
|
211
|
+
|
212
|
+
---
|
213
|
+
|
214
|
+
## Roadmap
|
215
|
+
|
216
|
+
- [ ] Support for additional documentation formats (e.g., reStructuredText, HTML)
|
217
|
+
- [ ] Enhanced link management utilities
|
218
|
+
- [ ] Improved content analysis features
|
219
|
+
- [ ] Integration with more static site generators
|
220
|
+
- [ ] Plugin system for custom utilities
|
221
|
+
- [ ] More intuitive CLI commands and options
|
222
|
+
|
223
|
+
---
|
224
|
+
|
225
|
+
## Contributing
|
226
|
+
|
227
|
+
Contributions are welcome! Whether it's bug reports, feature requests, or code contributions, please feel free to:
|
228
|
+
|
229
|
+
- Open an [issue][github-issues]
|
230
|
+
- Submit a [pull request][github-pulls]
|
231
|
+
- Improve documentation, write tutorials, etc.
|
232
|
+
- Share your feedback and suggestions
|
233
|
+
|
234
|
+
---
|
235
|
+
|
236
|
+
## License
|
237
|
+
|
238
|
+
Copyright © 2024-2025 [Markitecture][markitecture]. <br />
|
239
|
+
Released under the [MIT][mit-license] license.
|
240
|
+
|
241
|
+
<div align="left">
|
242
|
+
<a href="#top">
|
243
|
+
<img src="https://raw.githubusercontent.com/eli64s/markitecture/77bec69129dd3a075d7d0816c7bd826da131ccc7/docs/assets/buttons/rectangle.svg" width="100px" height="100px" alt="Return to Top">
|
244
|
+
</a>
|
245
|
+
</div>
|
246
|
+
|
247
|
+
<div align="center">
|
248
|
+
<img src="https://raw.githubusercontent.com/eli64s/markitecture/216a92894e6f30c707a214fad5a5fba417e3bc39/docs/assets/line.svg" alt="separator" width="100%" height="2px" style="margin: 20px 0;">
|
249
|
+
</div>
|
250
|
+
|
251
|
+
|
252
|
+
<!-- REFERENCE LINKS -->
|
253
|
+
|
254
|
+
<!-- PROJECT RESOURCES -->
|
255
|
+
[pypi]: https://pypi.org/project/markitecture/
|
256
|
+
[markitecture]: https://github.com/eli64s/markitecture
|
257
|
+
[github-issues]: https://github.com/eli64s/markitecture/issues
|
258
|
+
[github-pulls]: https://github.com/eli64s/markitecture/pulls
|
259
|
+
[mit-license]: https://github.com/eli64s/markitecture/blob/main/LICENSE
|
260
|
+
[examples]: https://github.com/eli64s/markitecture/tree/main/examples
|
261
|
+
|
262
|
+
<!-- DEVELOPER TOOLS -->
|
263
|
+
[python]: https://www.python.org/
|
264
|
+
[pip]: https://pip.pypa.io/en/stable/
|
265
|
+
[pipx]: https://pipx.pypa.io/stable/
|
266
|
+
[uv]: https://docs.astral.sh/uv/
|
267
|
+
[mkdocs]: https://www.mkdocs.org/
|
268
|
+
[mkdocs.yml]: https://www.mkdocs.org/user-guide/configuration/
|
269
|
+
|
270
|
+
<!-- RESOURCES -->
|
271
|
+
[reflinks]: https://www.markdownguide.org/basic-syntax/#reference-style-links
|