Commit Graph

22 Commits

Author SHA1 Message Date
Thomas Hallock 98263a79a0 feat: add Python bridge and optional FastAPI server
- Add bridge.py for clean JSON-based Python-Node communication
- Add optional FastAPI server for REST API access
- Include requirements for API server setup

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 15:45:52 -05:00
Thomas Hallock fb1b0470cf feat: add Node.js/TypeScript integration with clean function interface
- Add SorobanGenerator class with python-shell bridge
- No CLI arguments - clean TypeScript function calls
- Support for Express.js and Next.js integration
- Include comprehensive API documentation

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 15:45:47 -05:00
Thomas Hallock a8a01a8db3 feat: add config presets for colored numerals and skip counting
- Add colored-numerals.yaml for place-value with colored text
- Add count-by-5s.yaml for skip counting example
- Demonstrate new features with ready-to-use configs

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 15:45:40 -05:00
Thomas Hallock c94fa5c74e feat: add step parameter for skip counting
- Add --step flag to count by 2s, 5s, 10s, or any increment
- Update parse_range function to support step parameter
- Works with ranges to generate skip counting flashcards

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 15:45:28 -05:00
Thomas Hallock e4aaaeab13 feat: add colored numerals feature to match bead colors
- Add create-colored-numeral function for coloring digits
- Support place-value, heaven-earth, and alternating color schemes
- Numerals on back of cards now use same colors as beads on front

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 15:45:23 -05:00
Thomas Hallock 06926262c1 Add full-page cutting guides for accurate card separation
- Implement horizontal and vertical cutting guides that extend across entire page
- Use subtle 50% gray lines (0.25pt) that won't be distracting if cut is slightly off
- Guides run through the gutter space between cards
- Automatically adjust to any grid layout (2x3, 3x3, 3x4, etc.)
- Controlled by existing --cut-marks flag
- Appear on both front and back sides for consistent cutting

The guides make it much easier to:
- Cut all cards to exactly the same size
- Make straight cuts across the entire page
- Maintain consistent spacing between cards
- Handle larger batches efficiently with a paper cutter

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 13:18:08 -05:00
Thomas Hallock 7d8d7a1cfd Add color scheme support for enhanced learning
- Implement four color schemes: monochrome, place-value, heaven-earth, alternating
- Place-value: Different colors for ones (blue), tens (magenta), hundreds (orange), etc.
- Heaven-earth: Orange heaven beads, blue earth beads for visual distinction
- Alternating: Blue/green alternating columns for easier reading
- Add --color-scheme CLI flag and config support
- Create place-value-colors.yaml example config

Color coding helps students:
- Instantly recognize place values
- Distinguish between heaven and earth beads
- Reduce reading errors in multi-digit numbers
- Make learning more engaging and memorable

Default remains monochrome for printer-friendly output.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 13:15:04 -05:00
Thomas Hallock 0ab2a69b90 Add flexible cards-per-page support with dynamic grid layout
- Support common layouts: 1, 2, 3, 4, 6, 8, 9, 10, 12, 15, 16, 18, 20, 24, 25, 30
- Add fallback logic for arbitrary card counts using square root calculation
- Remove panic on unsupported values - now handles any reasonable number
- Enable layouts like 18 cards (3x6) for larger batches

Users can now specify any cards-per-page value and get a reasonable
grid layout automatically calculated.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 13:05:07 -05:00
Thomas Hallock 152c495c40 Fix circle positioning to align with other shapes
- Wrap circles in a box for consistent top-left positioning
- All shapes now position from the same reference point
- Eliminates the bar appearing too high for circles only

Now all three shapes (diamond, square, circle) use the exact same
positioning logic with no special cases or exceptions.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 12:56:17 -05:00
Thomas Hallock 472aa5fc63 Simplify bead positioning with consistent center-based logic
- All shapes now use center-based positioning (no exceptions)
- Remove shape-specific adjustments for cleaner code
- Calculate bead positions using centers for all shapes
- Diamond and square shapes offset from center appropriately

This eliminates the complex conditional logic and makes the code
much cleaner and easier to maintain. All three shapes now follow
the same positioning rules.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 12:53:31 -05:00
Thomas Hallock a8078b8110 Fix bead positioning for all shapes with proper alignment
- Circles use center-based positioning (original Typst behavior)
- Diamonds and squares use top-edge positioning
- Add shape-specific y-coordinate adjustments for consistent alignment
- Ensure all active beads properly touch the reckoning bar

Each shape now positions correctly relative to the reckoning bar,
with circles using their natural center positioning and other shapes
using top-edge positioning.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 12:50:06 -05:00
Thomas Hallock 9ed1015bf3 Fix bead vertical alignment for all shapes
- Standardize bead positioning to use top edge as reference point
- Adjust circle positioning to match diamond and square alignment
- Ensure active beads properly touch the reckoning bar
- Fix issue where non-circle beads appeared too high

All bead shapes now align consistently with the reckoning bar,
with active beads properly positioned against it.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 12:46:53 -05:00
Thomas Hallock 8725d8b4ed Add configurable bead shapes with diamond as default
- Add three bead shape options: diamond (default), circle, square
- Implement diamond shape as horizontally elongated rhombus (realistic)
- Add draw-bead function to handle all three shape types
- Update CLI with --bead-shape parameter
- Create circle-beads.yaml config for traditional round beads

Diamond shape is now the default as it more accurately represents
real soroban/abacus beads which are typically bi-conical or
rhombus-shaped when viewed from the side.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 12:43:51 -05:00
Thomas Hallock 36b13bb54a Improve duplex printing support and documentation
- Clarify page ordering with detailed comments (fronts on odd, backs on even)
- Add PDF metadata for better document properties
- Improve qpdf linearization with object stream preservation
- Document duplex printing behavior in README
- Ensure consistent front/back pairing with explicit pagebreaks

The PDF now clearly alternates between soroban diagrams (odd pages)
and numerals (even pages) for reliable duplex printing with long-edge
binding.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 12:40:35 -05:00
Thomas Hallock 5596ef2c81 Add option to hide inactive beads for minimal display
- Add hide-inactive-beads parameter to draw-soroban function
- Conditionally render beads based on active state
- Add --hide-inactive-beads CLI flag
- Create minimal-beads.yaml config example
- Support both display modes: full (with grayed inactive) and minimal (active only)

This allows users to choose between two common soroban display
conventions: showing all beads with inactive ones grayed out, or
showing only the active beads for a cleaner look.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 12:38:15 -05:00
Thomas Hallock 8b38ca6521 Add comprehensive documentation
- README.md: Main documentation with quick start, usage, and examples
- DESIGN.md: Technical implementation details and architecture decisions
- INSTALL.md: Detailed installation guide for macOS

Documentation covers soroban representation, duplex printing,
vector graphics strategy, and configuration options.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 12:14:57 -05:00
Thomas Hallock 75e9337e4e Bundle DejaVu Sans fonts for consistent rendering
- Add DejaVuSans.ttf for main text
- Add DejaVuSans-Bold.ttf for emphasis
- Ensures PDF portability across systems
- No dependency on system fonts

DejaVu fonts are open source and freely redistributable.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 12:14:44 -05:00
Thomas Hallock e411b289c7 Add Makefile for build automation
- Default target generates flashcards with linearization
- Install target for macOS dependencies (typst, qpdf)
- Sample generation target for all configurations
- Test target for quick validation
- Clean target to remove generated files
- Dependency checking before builds

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 12:14:31 -05:00
Thomas Hallock 46f235a0b7 Add configuration files for common use cases
- default.yaml: Basic 0-9 configuration
- 0-99.yaml: Two-digit numbers with cut marks
- 3-column-fixed.yaml: Three-digit numbers with fixed columns

Each config includes paper size, margins, font settings, and
soroban display options.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 12:14:18 -05:00
Thomas Hallock d10b7836b7 Add Python CLI tool for flashcard generation
- Create generate.py with full CLI argument support
- Support YAML/JSON configuration files
- Implement number range parsing and shuffling
- Add font path configuration for bundled fonts
- Include PDF linearization with qpdf
- Add sample generation script for testing

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 12:14:05 -05:00
Thomas Hallock 1312eef345 Add Typst template for soroban flashcard generation
- Implement draw-soroban function for rendering abacus beads
- Create flashcard layout with front/back support
- Add generate-flashcards main function for batch generation
- Support configurable layouts (6/8/9 cards per page)
- Include duplex printing alignment with mirrored backs
- Pure vector graphics using Typst drawing primitives

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 12:13:51 -05:00
Thomas Hallock 466efad640 Initial project setup with dependencies
- Add .gitignore for Python, macOS, and generated files
- Add requirements.txt with PyYAML dependency

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-09 12:13:32 -05:00