You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8e252e4
Browse filesBrowse the repository at this point in the historyBrowse files
-**Unified Entry Point**: Renamed the CLI script to `commands/cat/dr_egeria.py` and added a `dr_egeria` script alias in `pyproject.toml`.
87
87
-**Direct Execution**: Restored the `if __name__ == "__main__"` block in `md_processing/dr_egeria.py` for manual invocation.
88
88
-**Dependency Management**: Updated the `v2/README.md` with explicit installation instructions (`pip install -e .`) to ensure all dependencies like `loguru` are correctly resolved.
89
-
-**Consistency**: Standardized command-line arguments to use `--input-file` across all entry points.
89
+
-**Consistency**: Standardized command-line arguments to use a positional inputfile across all entry points.
This plan outlines the changes required to adjust the Dr.Egeria parsing and generation syntax so that:
4
+
-**`#` (Single Hash)**: Ignored by the parser; treated as standard Markdown document headers or comments.
5
+
-**`##` (Double Hash)**: Defines a Dr.Egeria Command.
6
+
-**`###` (Triple Hash)**: Defines a Command Attribute.
7
+
8
+
## Motivation
9
+
This change will allow users to comfortably use single-hash `#` headers to title their overarching Markdown documents or sections, reserving the `##` and `###` headers strictly for Dr.Egeria execution contexts.
10
+
11
+
## Proposed Changes
12
+
13
+
### 1. Update the Extraction Logic (`md_processing/v2/extraction.py`)
14
+
The `UniversalExtractor` determines how markdown text is split into command blocks and attributes.
15
+
-**Command Header Matching**:
16
+
- Update `self.cmd_header_rx` to match `## <Verb> <Object>`.
17
+
- Update `_split_into_blocks()` so that it looks for `line.startswith("## ")` instead of `line.startswith("# ")` when identifying block boundaries.
18
+
-**Attribute Header Matching**:
19
+
- Update `_extract_attributes_from_block()` to use `^###\s+` in its regular expression instead of `^##\s+`.
The generator needs to produce templates in the new syntax.
23
+
-**Command Titles**: Update `_generate_md_file_content()` and the console output equivalent to prefix commands with `## ` instead of `# `.
24
+
-**Attribute Titles**: Update `_write_attr_block()` and `_print_attr()` to prefix attributes with `### ` instead of `## `.
25
+
26
+
### 3. Documentation & Sample Data Migration
27
+
Existing Markdown files (smoke tests, templates, inbox documentation) will no longer parse correctly.
28
+
- Run `uv run gen_md_cmd_templates --usage-level Basic` and `--usage-level Advanced` to forcefully regenerate all built-in template files in the new syntax.
29
+
- Manually (or via script) update `sample-data/smoke_test_gov_officer.md` and `sample-data/smoke_test_terms_and_conditions.md` to shift all hashes down one level.
30
+
- Any Markdown files provided to users in the inbox (e.g. `dr_egeria_intro_*.md`) may need an update to reflect the new expected format.
31
+
32
+
## Verification Plan
33
+
34
+
### Automated Verification
35
+
- Re-run Pytest unit tests. Many tests under `tests/micro-tests/` that feed string literals to `UniversalExtractor` will fail and need to be updated to the new `##` and `###` syntax.
36
+
- Specifically, the parser tests in `tests/micro-tests/md_processing/v2/test_extraction.py` will serve as our primary validation that the single hash `#` is ignored and `##`/`###` parse correctly.
37
+
38
+
### Manual Verification
39
+
- Re-run validation on the smoke tests: `dr_egeria sample-data/smoke_test_gov_officer.md --validate` to ensure it parses successfully.
40
+
41
+
> [!WARNING]
42
+
> **Breaking Change**: This is a breaking change for any existing user Markdown scripts. Users who have created their own `dr_egeria` markdown documents will need to run a quick search-and-replace to shift their headers down one level.
43
+
44
+
Does this approach and scope of changes align with what you had in mind?
0 commit comments