Conversation
There was a problem hiding this comment.
Pull request overview
Adds a docbuddy command intended to launch DocBuddy’s standalone /docs webpage locally (to support local LLM usage), and updates documentation/UI copy to promote that workflow.
Changes:
- Introduces a Python CLI entry point (
docbuddy) that starts a localhttp.serverand opens the standalone docs page. - Updates README and the standalone
docs/index.htmllanding content with CLI-based “run locally” instructions. - Bumps package version to
0.6.0and removes some repo automation/config files.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/docbuddy/cli.py |
New CLI entry point to serve the standalone docs page locally. |
README.md |
Documents the new CLI-based standalone workflow. |
pyproject.toml |
Bumps version and registers docbuddy = docbuddy.cli:main console script. |
docs/index.html |
Adds “Run locally with CLI” instructions to the landing/install section. |
.github/workflows/release.yml |
Removes the previous release workflow. |
.clineignore |
Removes the ignore file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/docbuddy/cli.py
Outdated
| # Use importlib.resources to find the docs directory | ||
| docbuddy_pkg = files("docbuddy") | ||
|
|
||
| # The docs directory is at the project root, one level up from src/docbuddy | ||
| # When installed, it's in site-packages/docbuddy/../.. | ||
| docs_path = docbuddy_pkg.parent.parent / "docs" | ||
|
|
||
| if not docs_path.exists(): | ||
| print(f"Error: Could not find 'docs' directory at {docs_path}", file=sys.stderr) | ||
| sys.exit(1) | ||
|
|
||
| # Serve from the project root (parent of docs) so static files are accessible | ||
| # The index.html uses paths like /src/docbuddy/static/core.js which need the parent | ||
| os.chdir(docs_path.parent) | ||
|
|
||
| url = f"http://{args.host}:{args.port}/docs/index.html" |
src/docbuddy/cli.py
Outdated
| # Serve from the project root (parent of docs) so static files are accessible | ||
| # The index.html uses paths like /src/docbuddy/static/core.js which need the parent | ||
| os.chdir(docs_path.parent) | ||
|
|
| def main(): | ||
| """Launch DocBuddy standalone webpage on port 8008.""" | ||
| parser = argparse.ArgumentParser( | ||
| prog="docbuddy", |
README.md
Outdated
| ### Option 1: Using the CLI (Recommended) | ||
|
|
||
| After installing DocBuddy, use the `docbuddy` command to launch the standalone webpage: | ||
|
|
||
| ```bash | ||
| pip install docbuddy | ||
| docbuddy | ||
| ``` | ||
|
|
||
| This starts a local server on port **8008** and opens your browser to [http://localhost:8008/docs/index.html](http://localhost:8008/docs/index.html). | ||
|
|
docs/index.html
Outdated
| <span class="copy-hint">Click to copy</span> | ||
| </div> | ||
| <p style="font-size: 12px; color: var(--theme-text-secondary); margin-top: 8px;"> | ||
| Opens at <code>http://localhost:8008/docs/index.html</code> |
|
@copilot apply changes based on the comments in this thread |
|
@pearsonkyle I've opened a new pull request, #22, to work on those changes. Once the pull request is ready, I'll request review from you. |
… add tests (#22) * Initial plan * Fix CLI: package standalone.html, use directory= instead of os.chdir, add tests, fix hardcoded URLs Co-authored-by: pearsonkyle <4556546+pearsonkyle@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pearsonkyle <4556546+pearsonkyle@users.noreply.github.com>
|
@copilot review this branch and help me consolidate some of the code. After I pip install this, if I go to my home directory and then run the command |
|
@pearsonkyle I've opened a new pull request, #23, to work on those changes. Once the pull request is ready, I'll request review from you. |
…_ for package directory resolution (#23) * Initial plan * Fix CLI: use pathlib.__file__ instead of importlib.resources.files() to resolve package directory Co-authored-by: pearsonkyle <4556546+pearsonkyle@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pearsonkyle <4556546+pearsonkyle@users.noreply.github.com>
No description provided.