Skip to content

docs(examples): add runnable hello-world in Rust and Python#38

Merged
lostmygithubaccount merged 1 commit into
mainfrom
agent3/examples-hello
Apr 13, 2026
Merged

docs(examples): add runnable hello-world in Rust and Python#38
lostmygithubaccount merged 1 commit into
mainfrom
agent3/examples-hello

Conversation

@lostmygithubaccount
Copy link
Copy Markdown
Member

Summary

Two tiny runnable programs that build a draw document programmatically and export SVG + PNG. Onboarding artifact for new contributors and library users — shows the full public API in ~50 LOC per language.

Rust: crates/draw-core/examples/hello.rs

cargo run --example hello -p dkdc-draw-core

Python: examples/hello.py

uv run python examples/hello.py   # after `bin/build-py` / `pip install dkdc-draw`

README gains an `Examples` section linking both. `.gitignore` ignores the output files (`hello.svg`, `hello.png`, `hello.draw.json`) at repo root.

Test plan

  • `cargo run --example hello -p dkdc-draw-core` produces valid PNG (830x240, 8-bit RGBA) + well-formed SVG
  • `uv run python examples/hello.py` produces the same + `hello.draw.json` that round-trips through `load_document`
  • `bin/check` green (examples compile under clippy)

🤖 Generated with Claude Code

Two tiny programs that programmatically build a draw document and
export SVG + PNG. Highest-signal onboarding artifact: shows the full
public API surface in ~50 LOC per language.

- crates/draw-core/examples/hello.rs — run with
  `cargo run --example hello -p dkdc-draw-core`
- examples/hello.py — run with `uv run python examples/hello.py`
  (after `bin/build-py` or `pip install dkdc-draw`)
- README gets an Examples section linking both
- .gitignore ignores the output files at repo root

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
lostmygithubaccount added a commit that referenced this pull request Apr 13, 2026
Backfilled from the merged-PR history since the initial release.
Keep-a-Changelog format, semver adherence, conventional-commit
sections (Added / Changed / Fixed), one line per entry with a
linked PR number. `[Unreleased]` currently holds #34 through #38.

Link from README to CHANGELOG.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
lostmygithubaccount added a commit that referenced this pull request Apr 13, 2026
Backfilled from the merged-PR history since the initial release.
Keep-a-Changelog format, semver adherence, conventional-commit
sections (Added / Changed / Fixed), one line per entry with a
linked PR number. `[Unreleased]` currently holds #34 through #38.

Link from README to CHANGELOG.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lostmygithubaccount lostmygithubaccount mentioned this pull request Apr 13, 2026
3 tasks
@lostmygithubaccount lostmygithubaccount merged commit 67c3ca2 into main Apr 13, 2026
1 check passed
@lostmygithubaccount lostmygithubaccount deleted the agent3/examples-hello branch April 13, 2026 03:28
lostmygithubaccount added a commit that referenced this pull request Apr 13, 2026
Backfilled from the merged-PR history since the initial release.
Keep-a-Changelog format, semver adherence, conventional-commit
sections (Added / Changed / Fixed), one line per entry with a
linked PR number. `[Unreleased]` currently holds #34 through #38.

Link from README to CHANGELOG.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
lostmygithubaccount added a commit that referenced this pull request Apr 13, 2026
Bumps all Rust crates and the Python package from 0.2.1 to 0.3.0. This
minor bump reflects one breaking change in the dkdc-draw-core public API
surface (pub -> pub(crate) demotions in #42), accumulated with the
non-breaking work from this cycle:

  - #35: arrow snap-to-shape connection points
  - #36: CONTRIBUTING.md + README badges
  - #37: integration tests for draw-core public API
  - #38: Rust + Python hello-world examples
  - #39: CHANGELOG.md scaffolding
  - #40: surgical clippy opt-ins workspace-wide
  - #41: sample gallery (5 drawings × json/svg/png)
  - #42: pub -> pub(crate) demotions (BREAKING)
  - #43: Python test coverage 5 -> 27

See CHANGELOG.md for the 0.3.0 section and migration notes for the
demoted symbols.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lostmygithubaccount lostmygithubaccount mentioned this pull request Apr 13, 2026
4 tasks
lostmygithubaccount added a commit that referenced this pull request Apr 13, 2026
Bumps all Rust crates and the Python package from 0.2.1 to 0.3.0. This
minor bump reflects one breaking change in the dkdc-draw-core public API
surface (pub -> pub(crate) demotions in #42), accumulated with the
non-breaking work from this cycle:

  - #35: arrow snap-to-shape connection points
  - #36: CONTRIBUTING.md + README badges
  - #37: integration tests for draw-core public API
  - #38: Rust + Python hello-world examples
  - #39: CHANGELOG.md scaffolding
  - #40: surgical clippy opt-ins workspace-wide
  - #41: sample gallery (5 drawings × json/svg/png)
  - #42: pub -> pub(crate) demotions (BREAKING)
  - #43: Python test coverage 5 -> 27

See CHANGELOG.md for the 0.3.0 section and migration notes for the
demoted symbols.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant