Skip to content

Commit 2547031

Browse files
committed
docs(readme): document distant headers and flexible formats
Update the README to reflect the parser's new, more flexible header-matching capabilities. This change documents two key features recently added to the parser: - **Distant Headers:** Clarifies that content-related headers (`File:`, `Append File:`, etc.) are now associated with the *next available* code block, allowing for descriptive paragraphs between a header and its code. - **Flexible Hash Formats:** Updates the examples to show that headers can use more than two hash symbols (`###`, `####`) and can include descriptive text before the action keyword (e.g., `### The Main File: ...`). A new "Distant / Flexible Header" example has been added to explicitly demonstrate this enhanced functionality to users.
1 parent 7c1668f commit 2547031

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ The tool reads a markdown file, identifies actions (like creating, appending, pr
1414
* Supports appending content to existing files (creates if not exists).
1515
* Supports prepending content to existing files (creates if not exists).
1616
* Supports deleting files.
17+
* Flexible association of headers with code blocks, allowing for descriptive text in between.
1718
* Supports moving files.
1819
* Multiple header formats for defining actions (Markdown headers, backticks, internal comments).
1920
* "Wrapped" header format for associating headers with subsequent code blocks or for standalone delete/move actions.
@@ -83,10 +84,11 @@ The following header formats are recognized:
8384

8485
**1. `File` Actions (Create/Overwrite):**
8586

86-
These headers must be immediately followed by a fenced code block (e.g., `````, ```` ``` ````). The content of the code block becomes the content of the file.
87+
These headers are associated with the next available fenced code block (e.g., `````, ```` ``` ````). While they are typically placed immediately before the code block, they can be separated by paragraphs of text. The content of the associated code block becomes the content of the file.
8788

8889
* **Markdown Headers:**
89-
* `## File: path/to/your/file.txt`
90+
* `## File: path/to/your/file.txt` (and with more hashes like `###`, `####`, etc.)
91+
* `### Any descriptive text File: path/to/your/file.txt`
9092
* `**File: path/to/your/file.txt**`
9193
* **Backtick Path Only:** (Implies `File` action)
9294
* `` `path/to/your/file.txt` ``

0 commit comments

Comments
 (0)