Add MF-1 The Curious Case
88
MF-1 The Curious Case.-.md
Normal file
88
MF-1 The Curious Case.-.md
Normal file
@@ -0,0 +1,88 @@
|
||||
Abstractor= A MarkiTect shortstory
|
||||
|
||||
### A Short Story: "The Curious Case of the Scheming Schemas"
|
||||
|
||||
```markdown
|
||||
# The Case of the Missing Chunk
|
||||
|
||||
## Part 1: The First Inclusion
|
||||
|
||||
Mark was a sleek black kitten, and his sister Tect was a fluffy ginger tabby. They lived in a library filled with stacks of Markdown files. One Tuesday, Tect found a curious file titled `recipe.md`. "Mark," she meowed, "this recipe file is missing the `ingredients` section!"
|
||||
|
||||
Mark, a purist, sniffed. "That's because it's a `ChunkInclusion`. It's pulling from `MarkdownChunk-ingredients.md`."
|
||||
|
||||
> **Narrator's Note:** Mark was right, but he also had a superiority complex about Markdown.
|
||||
|
||||
The recipe file, when viewed in their console, looked something like this:
|
||||
|
||||
```
|
||||
|
||||
# Recipe: Tuna à la Markdown
|
||||
|
||||
## Instructions
|
||||
|
||||
1. Open the can.
|
||||
2. Put tuna on a plate.
|
||||
|
||||
{\_chunk: MarkdownChunk-ingredients.md}
|
||||
|
||||
```
|
||||
|
||||
### Ingredients from Another File
|
||||
|
||||
Suddenly, a loud `*POP!*` echoed through the library. `MarkdownChunk-ingredients.md` appeared as if from nowhere, containing a single line:
|
||||
|
||||
* 1 can of tuna
|
||||
|
||||
---
|
||||
|
||||
## Part 2: The SchemaFile Fiasco
|
||||
|
||||
Tect, ever the mischief-maker, decided to write her own recipe. She created `disaster.md`.
|
||||
|
||||
**[Table of Contents]**
|
||||
1. **A Terrible Idea**
|
||||
2. **The Fiasco**
|
||||
|
||||
"I need to make sure my recipe has a schema," she declared. She pulled out a `SchemaFile` for recipes, which required the following:
|
||||
|
||||
* `#` Title (required)
|
||||
* `##` Ingredients (required)
|
||||
* `##` Instructions (required)
|
||||
|
||||
Tect's `disaster.md` started like this:
|
||||
|
||||
```
|
||||
|
||||
# A Terrible Idea
|
||||
|
||||
## The Fiasco
|
||||
|
||||
### The End Result
|
||||
|
||||
````
|
||||
|
||||
"That's not a schema," Mark said, peering over her shoulder. "Your `disaster.md` is in a terrible state. It's missing `## Ingredients` and `## Instructions`."
|
||||
|
||||
Tect's eyes widened. "It's a failure! An **InclusionStub**!" she cried. She had only provided the structural headings, and the schema-checker was screaming.
|
||||
|
||||
---
|
||||
|
||||
## Part 3: The Great Validation
|
||||
|
||||
Mark, with a feline shrug, showed her a correct file. He had a file named `perfect.md`. He told her he had generated it from the `SchemaFile`.
|
||||
|
||||
* **Ordered List of Steps**
|
||||
1. Read the `SchemaFile`.
|
||||
2. Check for required headings.
|
||||
3. Create an `InclusionStub` for each missing part.
|
||||
|
||||
This made `perfect.md` look like a skeleton, but it was ready for content. He then used his **JSON Schema Validator** to check the finished `perfect.md`.
|
||||
|
||||
* **Code Block for Validation:**
|
||||
|
||||
```python
|
||||
validator.validate(perfect_md_ast, recipe_schema)
|
||||
````
|
||||
|
||||
The validator returned `True`, and a chorus of purrs filled the air. Mark and Tect knew that with schemas and chunks, their Markdown files would forever be perfect.
|
||||
Reference in New Issue
Block a user