Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ black . --check && isort . --check-only && flake8 . && mypy . --check-untyped-de
- `plain2code_logger.py` - Custom logging with elapsed time timestamps
- `plain2code_console.py` - Rich console wrapper with custom styles
- `plain2code_state.py` - Runtime state (render ID, counters, timing)
- `standard_template_library/` - Built-in code templates
- `standard_template_library/` - Built-in `.plain` templates (git subtree from `plainlang-examples`)
- `examples/` - Sample `.plain` projects

### Testing Architecture
Expand Down Expand Up @@ -223,6 +223,26 @@ Two logging modes:
### Running Plain2Code from Another Directory
The tool can be run from any directory by providing an absolute or relative path to the `.plain` file. All paths (build folder, log file, templates) are resolved relative to the `.plain` file's directory, not the current working directory, unless explicitly overridden via CLI arguments.

### Standard Template Library

`standard_template_library/` is a git subtree sourced from the `plainlang-examples` repository. It is **not** updated automatically — you must pull changes manually when the templates change upstream:

```bash
git subtree pull --prefix=standard_template_library git@github.com:Codeplain-ai/plainlang-examples.git subtree/standard-template-library --squash
```

The subtree does not track a branch pointer. The branch (`main` above) is just an argument passed at pull time — git uses the `git-subtree-split` hash embedded in the commit history to determine what's new since the last sync.

**Important:** You must pull from the `subtree/standard-template-library` branch, not `main`. This is a split branch containing only the `standard_template_library/` subdirectory contents at root level. Pulling from `main` would bring in the entire `plainlang-examples` repo.

If the split branch is outdated, regenerate it first in `plainlang-examples`:

```bash
# In plainlang-examples/
git subtree split --prefix=standard_template_library -b subtree/standard-template-library
git push origin subtree/standard-template-library
```

### Windows Support
Windows users must use WSL (Windows Subsystem for Linux). The codebase has some platform-specific script handling (`.ps1` for Windows, `.sh` for Unix).

Expand Down
3 changes: 1 addition & 2 deletions plain2code.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import importlib.resources
import logging
import logging.config
import os
Expand Down Expand Up @@ -55,7 +54,7 @@
from tui.plain2code_tui import Plain2CodeTUI
from tui.plain_module_render_choice_tui import PlainModuleRenderChoiceTUI

DEFAULT_TEMPLATE_DIRS = importlib.resources.files("standard_template_library")
DEFAULT_TEMPLATE_DIRS = "standard_template_library"
RENDER_THREAD_SHUTDOWN_TIMEOUT = 0.7

# Exceptions that represent expected, user-facing error conditions. They are
Expand Down
1 change: 0 additions & 1 deletion standard_template_library/__init__.py

This file was deleted.

Loading