Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Python
.venv/
*__pycache__*
**/.pyc
tmp/
docs/build/
*.egg
*.egg-info
dist
build
build/
_build/
docs/html/
eggs
19 changes: 19 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2
build:
os: ubuntu-24.04
tools:
python: "3.12"

sphinx:
configuration: docs/conf.py

python:
install:
- method: pip
path: .
extra_requirements:
- docs

formats:
- epub
- pdf
15 changes: 12 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
cmdcraft
========

.. image:: https://github.com/weinsen/cmdcraft/actions/workflows/unit_tests.yml/badge.svg?branch=master
:target: https://github.com/weinsen/cmdcraft/actions/workflows/unit_tests.yml

``cmdcraft`` is a library that aims to build fast and stable
interative devtools. It that native Python metadata from objects to build prompt
interactive devtools. It uses native Python metadata from objects to build prompt
commands, so you don't have to manually configure input options.

.. image:: docs/source/images/example.gif
.. image:: docs/images/example.gif

Features
--------
Expand All @@ -18,7 +21,13 @@ Features
Contributing
============

Contributions are welcome! Please start by reading the `Contributing Guidelines <CONTRIBUING.rst>`_ file.
Contributions are welcome! Please start by reading the `Contributing Guidelines <docs/pages/contributing.rst>`_ file.

License
=======

This project is licensed under the BSD-style license found in the LICENSE file in the
root directory of this source tree.

Special thanks
==============
Expand Down
27 changes: 10 additions & 17 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
# Minimal makefile for Sphinx documentation
#
PYTHON ?= python
SPHINXBUILD = $(PYTHON) -m sphinx
SPHINXAPIDOC = $(PYTHON) -m sphinx.ext.apidoc
SOURCEDIR = .
BUILDDIR = _build

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
.PHONY: apidoc html

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
apidoc:
$(SPHINXAPIDOC) -f -e -o _generated ../src/cmdcraft

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
html:
$(SPHINXBUILD) -b html "$(SOURCEDIR)" "$(BUILDDIR)/html"
37 changes: 37 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"""Sphinx configuration for the cmdcraft documentation."""

project = "cmdcraft"
copyright = "2026, A. M. Weinsen Jr"
author = "A. M. Weinsen Jr"
release = "0.0.7"

extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx_autodoc_typehints",
]

autodoc_default_options = {
"members": True,
"undoc-members": False,
"private-members": False,
"show-inheritance": True,
"inherited-members": True,
}

autodoc_typehints = "description"
napoleon_google_docstring = True
autosummary_generate = True
autosummary_imported_members = False

templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
html_title = f"{project} {release} documentation"

# Explicit root doc (Sphinx defaults to 'index' but be explicit).
root_doc = "index"
File renamed without changes
24 changes: 24 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Welcome to cmdcraft documentation!
==================================

``cmdcraft`` is a library that aims to build fast and stable
interactive devtools. It uses native Python metadata from objects to build prompt
commands, so you don't have to manually configure input options.

Table of Contents
-----------------

.. toctree::
:maxdepth: 2
:caption: Contents:

pages/intro/index
pages/howto/crafting
pages/contributing
pages/changelog
pages/documentation

Special thanks
==============

- `Python Prompt Toolkit <https://github.com/prompt-toolkit/python-prompt-toolkit>`_: Awesome prompt utility.
35 changes: 0 additions & 35 deletions docs/make.bat

This file was deleted.

4 changes: 2 additions & 2 deletions CHANGELOG.rst → docs/pages/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ v0.0.4
- Improve linting

Fixed issues:
******
*************
#2: Exception while typing quoted arguments

v0.0.3
Expand All @@ -40,7 +40,7 @@ v0.0.3
v0.0.2

Fixed issues:
******
*************
#1: Input mishandling options

- Input handling
Expand Down
8 changes: 7 additions & 1 deletion CONTRIBUING.rst → docs/pages/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,10 @@ we ask to start the brief message with one of these tags:
- `infra`: The commit contains changes to the project infrastructure

Also, if the commit is related to a specific tracked issue, please insert its number
preceded by #.
preceded by #.

Local checks
============

Use ``./tools/lint.sh --changed`` to lint only the Python files changed on your branch,
or ``./tools/lint.sh --all`` for a full-repository Ruff check plus formatting validation.
20 changes: 20 additions & 0 deletions docs/pages/documentation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Documentation
=============

BasePrompter
------------

.. automodule:: cmdcraft.base
:members:

Prompter
--------

.. automodule:: cmdcraft.prompter
:members:

Command
-------

.. automodule:: cmdcraft.command
:members:
File renamed without changes.
File renamed without changes.
27 changes: 0 additions & 27 deletions docs/source/conf.py

This file was deleted.

32 changes: 0 additions & 32 deletions docs/source/index.rst

This file was deleted.

14 changes: 0 additions & 14 deletions docs/source/pages/documentation.rst

This file was deleted.

12 changes: 8 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,17 @@ dev = [
"ruff",
]
docs = [
"furo",
"sphinx",
"sphinx>=6.0",
"sphinx-rtd-theme",
"sphinx-autodoc-typehints",
"sphinx-autobuild",
]

[project.urls]
Homepage = "https://github.com/weinsen/cmdcraft"
Repository = "https://github.com/weinsen/cmdcraft"
"Homepage" = "https://github.com/weinsen/cmdcraft"
"Repository" = "https://github.com/weinsen/cmdcraft"
"Bug Reports" = "https://github.com/weinsen/cmdcraft/issues"
"Docs" = "https://cmdcraft.readthedocs.io/en/latest/?badge=latest"

[tool.setuptools]
package-dir = {"" = "src"}
Expand Down
Loading