Metadata-Version: 2.4
Name: sphinx-cmd
Version: 0.2.0
Summary: Command-line tools for Sphinx documentation management
Author-email: Jared Dillard <jared.dillard@gmail.com>
Project-URL: Homepage, https://github.com/jdillard/sphinx-cmd
Project-URL: Bug Reports, https://github.com/jdillard/sphinx-cmd/issues
Project-URL: Source, https://github.com/jdillard/sphinx-cmd
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: flake8; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: isort; extra == "dev"
Provides-Extra: test
Requires-Dist: pytest>=7.0.0; extra == "test"
Dynamic: license-file

# Sphinx-CMD

A collection of command-line tools for managing Sphinx documentation.

## Installation

```bash
pip install sphinx-cmd
```

## Commands

The `sphinx-cmd` tool provides subcommands for different Sphinx documentation management tasks.

### `sphinx-cmd rm`

Delete unused .rst files and their unique assets if not used elsewhere.

```bash
# Remove files and assets
sphinx-cmd rm path/to/docs

# Dry run to preview deletions
sphinx-cmd rm path/to/docs --dry-run
```

### `sphinx-cmd mv`

Move/rename .rst files and automatically update all references to them.

```bash
# Move and update all references
sphinx-cmd mv old-file.rst new-file.rst

# Move to a different directory
sphinx-cmd mv chapter1.rst topics/chapter1.rst

# Preview the move without making changes
sphinx-cmd mv old-file.rst new-file.rst --dry-run

# Move without updating references
sphinx-cmd mv old-file.rst new-file.rst --no-update-refs
```

#### Features

- Automatically updates `toctree` entries
- Updates `:doc:` references
- Updates `include` and `literalinclude` directives
- Handles relative paths correctly
- Preserves file relationships

## Development

```bash
# Clone the repository
git clone https://github.com/yourusername/sphinx-cmd.git
cd sphinx-cmd

# Install in development mode with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run linters
black sphinx_cmd tests
flake8 sphinx_cmd tests
mypy sphinx_cmd

# Test the command
sphinx-cmd --help
sphinx-cmd rm --help
sphinx-cmd mv --help
```

## Adding New Commands

The architecture is designed to make adding new commands easy:

1. Create a new file in `sphinx_cmd/commands/` (e.g., `new_command.py`)
2. Implement an `execute(args)` function in your new file
3. Import the command in `sphinx_cmd/cli.py`
4. Add a new subparser for your command in `create_parser()`

## License

MIT License - see LICENSE file for details.
