Skip to content

ichoosetoaccept/dash-docset-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Dash Docset Template

A Copier template for creating Dash docset generators.

Features

  • Complete project scaffold for building Dash docsets
  • Web scraper with support for sitemap.xml or llms.txt URL discovery
  • SQLite search index builder with customizable parsers
  • TOC anchor injection for in-page navigation
  • Docset validation script (verify.py)
  • Dash contribution checker (verify_contribution.py)
  • Contribution workflow (contribute.py) for submitting to Dash-User-Contributions
  • Pytest test suite with pre-commit hook
  • Pre-commit hooks with prek (ty type checking, pytest, standard hooks)
  • uv for dependency management
  • Poe tasks for common commands (scrape, build, verify, test, contribute)

Usage

Install Copier

# With uv
uv tool install copier

# Or with pipx
pipx install copier

Create a new docset project

copier copy gh:ichoosetoaccept/dash-docset-template my-new-docset

# Or from a local clone
copier copy /path/to/dash-docset-template my-new-docset

Answer the prompts

  • project_name: Name of your project (e.g., raycast-docset)
  • docset_name: Display name for the docset (e.g., Raycast)
  • docs_url: Base URL of documentation (e.g., https://developers.raycast.com)
  • author_name: Your name for attribution
  • author_link: Your GitHub profile URL
  • repo_url: GitHub repo URL for this docset project

Set up the generated project

cd my-new-docset
uv sync
prek install

Customize

  1. Scraper (*_docset/scraper.py): Adjust URL discovery and filtering
  2. Parsers (*_docset/parsers.py): Add custom parsers for different page types
  3. Builder (*_docset/builder.py): Customize icon URL and path handling

Build the docset

poe scrape   # Download documentation
poe build    # Build the docset
poe verify   # Validate the docset
poe test     # Run tests

# Or all at once:
poe all

Template Structure

dash-docset-template/
β”œβ”€β”€ copier.yaml                       # Template configuration
β”œβ”€β”€ template/
β”‚   β”œβ”€β”€ {{docset_identifier}}_docset/ # Package (name templated)
β”‚   β”‚   β”œβ”€β”€ __init__.py.jinja
β”‚   β”‚   β”œβ”€β”€ scraper.py.jinja          # Auto-detects sitemap/llms.txt
β”‚   β”‚   β”œβ”€β”€ builder.py.jinja
β”‚   β”‚   └── parsers.py.jinja
β”‚   β”œβ”€β”€ tests/                        # Pytest test suite
β”‚   β”‚   β”œβ”€β”€ test_builder.py.jinja
β”‚   β”‚   β”œβ”€β”€ test_verify.py.jinja
β”‚   β”‚   β”œβ”€β”€ test_verify_contribution.py
β”‚   β”‚   └── test_contribute.py
β”‚   β”œβ”€β”€ main.py.jinja
β”‚   β”œβ”€β”€ verify.py.jinja               # Docset quality validation
β”‚   β”œβ”€β”€ verify_contribution.py.jinja  # Dash contribution requirements
β”‚   β”œβ”€β”€ contribute.py.jinja           # Contribution workflow
β”‚   β”œβ”€β”€ pyproject.toml.jinja
β”‚   β”œβ”€β”€ README.md.jinja
β”‚   β”œβ”€β”€ .gitignore
β”‚   └── .pre-commit-config.yaml       # Includes pytest hook
└── README.md

License

MIT

About

Copier template for creating Dash docset generators

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published