markdown-cms 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.
Files changed (39) hide show
  1. markdown_cms-0.1.0/.gitignore +197 -0
  2. markdown_cms-0.1.0/LICENSE +21 -0
  3. markdown_cms-0.1.0/PKG-INFO +301 -0
  4. markdown_cms-0.1.0/README.md +266 -0
  5. markdown_cms-0.1.0/pyproject.toml +157 -0
  6. markdown_cms-0.1.0/src/markdown_cms/__init__.py +5 -0
  7. markdown_cms-0.1.0/src/markdown_cms/__main__.py +6 -0
  8. markdown_cms-0.1.0/src/markdown_cms/agents/__init__.py +7 -0
  9. markdown_cms-0.1.0/src/markdown_cms/agents/base_agent.py +150 -0
  10. markdown_cms-0.1.0/src/markdown_cms/agents/cli.py +120 -0
  11. markdown_cms-0.1.0/src/markdown_cms/agents/implementation_agent.py +302 -0
  12. markdown_cms-0.1.0/src/markdown_cms/agents/orchestrator_agent.py +323 -0
  13. markdown_cms-0.1.0/src/markdown_cms/agents/testing_agent.py +323 -0
  14. markdown_cms-0.1.0/src/markdown_cms/app.py +110 -0
  15. markdown_cms-0.1.0/src/markdown_cms/cli.py +2825 -0
  16. markdown_cms-0.1.0/src/markdown_cms/components/__init__.py +1 -0
  17. markdown_cms-0.1.0/src/markdown_cms/core/__init__.py +1 -0
  18. markdown_cms-0.1.0/src/markdown_cms/core/admin_routes.py +2952 -0
  19. markdown_cms-0.1.0/src/markdown_cms/core/auth.py +434 -0
  20. markdown_cms-0.1.0/src/markdown_cms/core/auth_routes.py +583 -0
  21. markdown_cms-0.1.0/src/markdown_cms/core/config.py +131 -0
  22. markdown_cms-0.1.0/src/markdown_cms/core/custom_syntax.py +533 -0
  23. markdown_cms-0.1.0/src/markdown_cms/core/database.py +225 -0
  24. markdown_cms-0.1.0/src/markdown_cms/core/forms.py +413 -0
  25. markdown_cms-0.1.0/src/markdown_cms/core/models.py +220 -0
  26. markdown_cms-0.1.0/src/markdown_cms/core/parser.py +150 -0
  27. markdown_cms-0.1.0/src/markdown_cms/core/pure_text_parser.py +2493 -0
  28. markdown_cms-0.1.0/src/markdown_cms/core/queries.py +234 -0
  29. markdown_cms-0.1.0/src/markdown_cms/core/registry.py +170 -0
  30. markdown_cms-0.1.0/src/markdown_cms/core/router.py +473 -0
  31. markdown_cms-0.1.0/src/markdown_cms/core/router_backup.py +164 -0
  32. markdown_cms-0.1.0/src/markdown_cms/core/sidebar.py +429 -0
  33. markdown_cms-0.1.0/src/markdown_cms/core/syntax-mappings.md +686 -0
  34. markdown_cms-0.1.0/src/markdown_cms/plugins/__init__.py +1 -0
  35. markdown_cms-0.1.0/src/markdown_cms/plugins/table/__init__.py +1 -0
  36. markdown_cms-0.1.0/tests/__init__.py +1 -0
  37. markdown_cms-0.1.0/tests/fixtures/__init__.py +1 -0
  38. markdown_cms-0.1.0/tests/test_config.py +59 -0
  39. markdown_cms-0.1.0/tests/test_parser.py +99 -0
@@ -0,0 +1,197 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/#use-with-ide
110
+ .pdm.toml
111
+
112
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113
+ __pypackages__/
114
+
115
+ # Celery stuff
116
+ celerybeat-schedule
117
+ celerybeat.pid
118
+
119
+ # SageMath parsed files
120
+ *.sage.py
121
+
122
+ # Environments
123
+ .env
124
+ .venv
125
+ env/
126
+ venv/
127
+ ENV/
128
+ env.bak/
129
+ venv.bak/
130
+
131
+ # Spyder project settings
132
+ .spyderproject
133
+ .spyproject
134
+
135
+ # Rope project settings
136
+ .ropeproject
137
+
138
+ # mkdocs documentation
139
+ /site
140
+
141
+ # mypy
142
+ .mypy_cache/
143
+ .dmypy.json
144
+ dmypy.json
145
+
146
+ # Pyre type checker
147
+ .pyre/
148
+
149
+ # pytype static type analyzer
150
+ .pytype/
151
+
152
+ # Cython debug symbols
153
+ cython_debug/
154
+
155
+ # PyCharm
156
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157
+ # be added to the global gitignore or merged into this project gitignore. For a PyCharm
158
+ # project, it is recommended to include the following files in version control:
159
+ # - .idea/modules.xml
160
+ # - .idea/*.iml
161
+ # - .idea/misc.xml
162
+ # - .idea/vcs.xml
163
+ .idea/
164
+
165
+ # VS Code
166
+ .vscode/
167
+ !.vscode/settings.json
168
+ !.vscode/tasks.json
169
+ !.vscode/launch.json
170
+ !.vscode/extensions.json
171
+ !.vscode/*.code-snippets
172
+
173
+ # Local History for Visual Studio Code
174
+ .history/
175
+
176
+ # Built Visual Studio Code Extensions
177
+ *.vsix
178
+
179
+ # Project specific
180
+ site/content/.cache/
181
+ site/database/
182
+ site/uploads/
183
+ logs/
184
+ *.sqlite
185
+ *.sqlite-journal
186
+ *.db
187
+ *.db-journal
188
+
189
+ # Session key (runtime secret)
190
+ .sesskey
191
+
192
+ # Claude Code local settings
193
+ .claude/
194
+
195
+ # Windows artifacts
196
+ nul
197
+ This
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Rakesh Patil
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,301 @@
1
+ Metadata-Version: 2.4
2
+ Name: markdown-cms
3
+ Version: 0.1.0
4
+ Summary: Markdown-first CMS and Application Framework
5
+ Project-URL: Homepage, https://github.com/rakeshpatil1983/markdown-cms
6
+ Project-URL: Documentation, https://github.com/rakeshpatil1983/markdown-cms/docs
7
+ Project-URL: Repository, https://github.com/rakeshpatil1983/markdown-cms.git
8
+ Project-URL: Issues, https://github.com/rakeshpatil1983/markdown-cms/issues
9
+ Author-email: Rakesh Patil <rakeshpatil1983@gmail.com>
10
+ License: MIT
11
+ License-File: LICENSE
12
+ Keywords: cms,fasthtml,htmx,markdown,web-framework
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Requires-Python: >=3.12
20
+ Requires-Dist: markdown-it-py>=3.0.0
21
+ Requires-Dist: passlib[bcrypt]>=1.7.4
22
+ Requires-Dist: python-fasthtml>=0.12.0
23
+ Requires-Dist: python-jose[cryptography]>=3.3.0
24
+ Requires-Dist: python-multipart>=0.0.9
25
+ Requires-Dist: sqlalchemy>=2.0.0
26
+ Provides-Extra: dev
27
+ Requires-Dist: black>=24.0.0; extra == 'dev'
28
+ Requires-Dist: isort>=5.13.0; extra == 'dev'
29
+ Requires-Dist: pre-commit>=3.6.0; extra == 'dev'
30
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
31
+ Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
32
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
33
+ Requires-Dist: ruff>=0.1.0; extra == 'dev'
34
+ Description-Content-Type: text/markdown
35
+
36
+ # Markdown-First Application Framework
37
+
38
+ A Markdown-first CMS and Application Framework built with FastHTML and HTMX.
39
+
40
+ > **Philosophy**: Everything is a file. Everything is Markdown. Markdown is declarative UI, Python is behavior.
41
+
42
+ ---
43
+
44
+ ## What Is This?
45
+
46
+ `markdown-cms` is a Python web framework where you build complete web applications by writing Markdown files — not just documentation sites.
47
+
48
+ Pages, layouts, navigation, forms, interactive calculators, data tables, component libraries, admin panels — all driven by Markdown and a file-based structure. Python handles behavior; Markdown handles structure and intent.
49
+
50
+ Think of it as the intersection of **Obsidian's file-first philosophy**, **WordPress's template system**, and **Django's project structure** — but lighter, faster, and Markdown-native.
51
+
52
+ ### Real-World Reference: TechArya
53
+
54
+ [TechArya.net](https://techarya.net) — an electronics and embedded systems learning platform — was built and migrated using this framework. It demonstrates the framework's capability beyond documentation:
55
+
56
+ - **25+ structured electronics lessons** with diagrams, formulas, and categorized navigation
57
+ - **Live HTMX calculators** (Ohm's Law, RC filter, power) — form submission returns parsed Markdown responses
58
+ - **Nested subject navigation** with auto-generated sidebar trees from the file structure
59
+ - **Multi-theme switching** (Bootstrap, Bulma, Tailwind, Materialize) at runtime
60
+ - **Image galleries, tables, alerts, carousels** — all from Markdown
61
+
62
+ TechArya is proof that this framework handles real content-heavy, interactive applications — not just static docs.
63
+
64
+ ---
65
+
66
+ ## What Can You Build With It?
67
+
68
+ This is **not** a documentation generator. It is a full application framework. You can build:
69
+
70
+ | Use Case | How |
71
+ |---|---|
72
+ | Documentation sites | pages/ + markdown content |
73
+ | Learning platforms | Nested subject folders + sidebar auto-navigation |
74
+ | Company portals | Template parts (header/footer/nav) + themes |
75
+ | Technical blogs | File-based routing + metadata |
76
+ | Interactive tools | HTMX endpoints + Python API handlers in api.py |
77
+ | Admin dashboards | Built-in admin routes + SQLite database |
78
+ | Product landing pages | Cards, heroes, stats, columns — all in Markdown |
79
+ | Form-driven apps | `:::form` blocks + Python POST handlers |
80
+
81
+ ---
82
+
83
+ ## Philosophy
84
+
85
+ > Markdown describes structure and intent. Python executes behavior and truth.
86
+
87
+ This framework enforces a strict separation:
88
+
89
+ - **Markdown** = pages, layout, content, UI structure, forms, components
90
+ - **Python** = business logic, database queries, API responses, authentication
91
+
92
+ If a feature requires putting Python logic inside a Markdown file — it does not belong here.
93
+
94
+ ### Pure Text Syntax
95
+
96
+ The framework extends Markdown with a clean, readable syntax for UI elements:
97
+
98
+ ```
99
+ => Click Me -> <button class="btn btn-primary">
100
+ => Save (success) -> <button class="btn btn-success">
101
+ => Delete (danger) -> <button class="btn btn-danger">
102
+
103
+ ? Your Name (text) -> <input type="text">
104
+ ?? Your Message -> <textarea>
105
+
106
+ > [!SUCCESS] Saved! -> styled success alert
107
+ > [!WARNING] Review -> styled warning alert
108
+
109
+ :::card
110
+ # Title
111
+ Content here
112
+ => Learn More
113
+ :::
114
+ ```
115
+
116
+ No HTML required. No YAML. No JSON. Just text that reads like what it means.
117
+
118
+ ---
119
+
120
+ ## Quick Start
121
+
122
+ ```bash
123
+ pip install markdown-cms
124
+
125
+ # Create a new project
126
+ markdown-cms create my-project
127
+ cd my-project
128
+
129
+ # Run development server
130
+ markdown-cms run
131
+ ```
132
+
133
+ Open `http://localhost:8000` — your site is live with auto-reload.
134
+
135
+ ---
136
+
137
+ ## Features
138
+
139
+ - **File-based routing** — `pages/about.md` becomes `/about`, `pages/docs/intro.md` becomes `/docs/intro`
140
+ - **Template parts** — WordPress-style `header.md`, `footer.md`, `navbar.md`, `sidenav.md`
141
+ - **Multi-theme system** — Switch between Bootstrap, Bulma, Tailwind, Materialize with one command
142
+ - **HTMX-native** — Components load via HTMX fragments; no page refresh needed
143
+ - **Component library** — 3-level hierarchy: Elements, Containers, Layout
144
+ - **Plugin system** — Drop Python plugins into `plugins/` directory
145
+ - **Admin panel** — Built-in content management at `/admin`
146
+ - **Authentication** — JWT-based auth, user management
147
+ - **Database** — SQLite via SQLAlchemy, with CLI commands (`markdown-cms db init/seed/reset`)
148
+ - **Auto-reload** — Watches `pages/`, `templates/`, `static/` for changes
149
+ - **API routes** — Drop an `api.py` in your project root; the framework auto-loads it
150
+ - **Agents** — Built-in orchestrator, implementation, and testing agents for development assistance
151
+
152
+ ---
153
+
154
+ ## Project Structure
155
+
156
+ ```
157
+ my-project/
158
+ ├── pages/ # Markdown content -> URL routes
159
+ ├── templates/ # header.md, footer.md, navbar.md, sidenav.md
160
+ ├── static/ # CSS, JS, images
161
+ ├── components/ # Reusable HTMX-loadable markdown fragments
162
+ │ ├── elements/ # Buttons, inputs, dropdowns
163
+ │ ├── containers/ # Cards, panels, tabs
164
+ │ └── layout/ # Navbar, sidebar, header, footer
165
+ ├── themes/ # bootstrap/, bulma/, tailwind/, materialize/
166
+ ├── apps/ # Custom Django-style applications
167
+ ├── plugins/ # Custom plugins
168
+ └── api.py # Your HTMX API endpoints (auto-loaded)
169
+ ```
170
+
171
+ ---
172
+
173
+ ## CLI Commands
174
+
175
+ ```bash
176
+ markdown-cms create <name> # Scaffold new project
177
+ markdown-cms run # Development server (auto-reload)
178
+ markdown-cms run --port 3000 # Custom port
179
+ markdown-cms build # Validate project structure
180
+ markdown-cms theme bootstrap # Switch to Bootstrap theme
181
+ markdown-cms theme tailwind # Switch to Tailwind theme
182
+ markdown-cms db init # Create database tables
183
+ markdown-cms db seed # Seed with sample data
184
+ markdown-cms db reset # Drop and recreate (with confirmation)
185
+ markdown-cms db info # Show database info
186
+ markdown-cms agent orchestrator # Run development orchestrator agent
187
+ ```
188
+
189
+ ---
190
+
191
+ ## Writing HTMX API Routes
192
+
193
+ Create `api.py` in your project root — the framework loads it automatically:
194
+
195
+ ```python
196
+ from markdown_cms.core.parser import MarkdownParser
197
+ from fasthtml.common import NotStr
198
+
199
+ _parser = MarkdownParser()
200
+
201
+ def render_markdown(md_text):
202
+ return _parser.parse(md_text).get("html", "")
203
+
204
+ def setup_api_routes(app):
205
+
206
+ @app.post("/api/calculate")
207
+ async def calculate(request):
208
+ form = await request.form()
209
+ value = float(form.get("input", 0))
210
+ result = value * 2
211
+
212
+ # Return Markdown — the library parses it to HTML
213
+ md = f"> [!SUCCESS] Result\n> **{result}**"
214
+ return NotStr(render_markdown(md))
215
+ ```
216
+
217
+ Then call it from any Markdown page:
218
+
219
+ ```markdown
220
+ :::form /api/calculate
221
+ ? Input Value (number)
222
+ => Calculate (success)
223
+ :::
224
+ ```
225
+
226
+ Zero boilerplate. No templates. Pure Markdown + Python.
227
+
228
+ ---
229
+
230
+ ## Limitations
231
+
232
+ The framework is at **v0.1.0 / Alpha** stage. Known limitations:
233
+
234
+ - **No built-in search** — full-text search across pages requires a custom plugin
235
+ - **SQLite only** — no PostgreSQL or MySQL support yet
236
+ - **Single-user auth** — multi-tenant or org-level permissions not implemented
237
+ - **No asset pipeline** — CSS/JS is served as-is; no bundling or minification
238
+ - **Plugin API is minimal** — the plugin scaffold exists but the hook system is early-stage
239
+ - **No live preview in admin** — content edits require a page reload to see final output
240
+ - **Python 3.12+ required** — uses modern type annotation syntax throughout
241
+ - **No i18n/l10n** — no built-in internationalisation support
242
+
243
+ ---
244
+
245
+ ## Roadmap / Feature Improvements
246
+
247
+ Planned for future versions:
248
+
249
+ | Feature | Priority |
250
+ |---|---|
251
+ | Full-text search across pages | High |
252
+ | PostgreSQL / MySQL support | High |
253
+ | Live admin preview panel | High |
254
+ | Image upload + media manager | Medium |
255
+ | Tag and category system | Medium |
256
+ | RSS / sitemap generation | Medium |
257
+ | Plugin hook system (before/after render) | Medium |
258
+ | Multi-language content support | Medium |
259
+ | Role-based access control | Medium |
260
+ | Static site export (SSG mode) | Low |
261
+ | CLI scaffolding for custom plugins | Low |
262
+ | VS Code / Obsidian extension | Low |
263
+
264
+ ---
265
+
266
+ ## Tech Stack
267
+
268
+ | Component | Technology |
269
+ |---|---|
270
+ | Web framework | [FastHTML](https://fastht.ml) |
271
+ | Interactivity | [HTMX](https://htmx.org) |
272
+ | Markdown parsing | [markdown-it-py](https://markdown-it-py.readthedocs.io) |
273
+ | Database ORM | [SQLAlchemy](https://sqlalchemy.org) |
274
+ | Auth | python-jose + passlib |
275
+ | Build | [Hatchling](https://hatch.pypa.io) |
276
+
277
+ ---
278
+
279
+ ## Development
280
+
281
+ ```bash
282
+ git clone https://github.com/rakeshpatil1983/markdown-cms
283
+ cd markdown-cms
284
+ pip install -e ".[dev]"
285
+ pre-commit install
286
+ pytest
287
+ ```
288
+
289
+ ---
290
+
291
+ ## License
292
+
293
+ MIT License — see [LICENSE](LICENSE) for details.
294
+
295
+ ---
296
+
297
+ ## Contributing
298
+
299
+ Contributions welcome. Please open an issue before submitting large changes.
300
+
301
+ > Markdown describes structure and intent. Python executes behavior and truth.