---
title: "Markdown branching story template: one fork, two endings"
slug: markdown-branching-story-template
excerpt: "Write a short invented story with a shared opening, a choice between two paths and a separate final scene for each choice."
quickAnswer: "Reserve the title, name the starting situation in a sentence and write a shared opening passage. At one fork, name two choices in prose and give the heading for each ending. The text block below holds an invented lighthouse tale whose two endings exclude each other."
keyTakeaways:
  - "A single opening gives both possible endings the same starting situation."
  - "The choice paragraph names Row out and Stay ashore as the two passage headings."
  - "Each ending closes the tale after one choice, without returning to the other ending."
  - "Jane Doe's invented lighthouse keeper leaves the shore in one ending and remains there in the other."
  - "A short prose note explains how to keep either chosen path readable by itself."
publishedDate: 2026-10-24
dateModified: 2026-10-24
author: Bobby Huang
cluster: A
role: post
status: published
faq:
  - q: "How much of the story do the two paths share?"
    a: "They share the starting sentence, the opening passage and the choice paragraph. After the choice, each path has its own final scene."
  - q: "Does the reader need both endings to finish the tale?"
    a: "Either ending finishes the chosen path. The other ending describes an alternative that does not happen on that path."
  - q: "How are choices matched to their endings?"
    a: "The choice paragraph gives the heading name for each ending, so the destination is stated in words."
related:
  - markdown-fictional-letter-template
  - markdown-file-naming
---

A branching story template puts a fork in a short piece of invented fiction. The reader reaches one choice after a shared opening, then reads the ending for that choice. Both possibilities occupy the same page, but only one happens in a chosen telling.

## What this one-page story holds

The title sits above a plain sentence naming the starting situation. An opening passage establishes what the character faces before the reader chooses. The choice paragraph then names two possible actions and the passage heading belonging to each. Each of those passages brings its own path to an end.

Passage names are Markdown headings, with prose beneath them. Background on the format appears in [the introduction to .md files](what-is-a-md-file.md). Here the headings give names to passages; the choice states those names without a working link.

## The branching story template and invented example

The invented writer here, Jane Doe, gives her fictional lighthouse keeper the same placeholder name. The lighthouse, boat, chest and every event are invented, with no actual location intended.

Keep the bracketed title as a place for your own title. Beneath it, Jane Doe's tale fills the reusable shape: a starting sentence, an opening, a choice and two final scenes. When writing another tale, replace the situation and passages together so both endings follow from the new opening.

```text
# [Title of the invented branching story]

Jane Doe, a lighthouse keeper, has one chance to retrieve a wooden chest before the tide carries it beyond the cove.

## Opening

From the lighthouse steps, Jane Doe saw the chest drifting past the empty mooring. Her rowing boat rested on the shingle with its oars inside. She held the boat's rope while the water lifted its bow. The chest was still within reach of a short crossing, but she would have to leave the shore to fetch it.

## The choice

To have Jane Doe take the boat after the chest, read the passage headed Row out. To have her remain beside the lighthouse, read the passage headed Stay ashore. Choose one of these endings for this telling.

## Row out

Jane Doe pushed the boat into the water and pulled hard on the oars. She caught the chest against the bow, hauled it aboard and rowed back to the shingle. She carried it into the lighthouse and shut the door. The chest rested at her feet, beyond the tide's reach.

## Stay ashore

Jane Doe pulled the boat above the water and tied its rope around a stone post. She remained on the steps as the chest drifted beyond the cove and vanished from sight. She shut the lighthouse door with empty hands. The chest was gone, and she had stayed ashore throughout.
```

Opening belongs to either telling. The fork separates the endings: Row out ends with the chest inside the lighthouse, while Stay ashore ends with it gone. Jane Doe cannot have stayed ashore throughout and also have rowed after the chest in the same telling.

Those final paragraphs are story prose. Each describes the character's actions through a final scene rather than giving instructions for a routine. The choice paragraph addresses the reader; the endings return to Jane Doe's actions.

The fence is tagged text to present the Markdown example as literal writing. Fence details belong to the guide on [Markdown code blocks](markdown-code-blocks.md).

## Keeping each chosen path readable

Read the opening, the choice and one ending together. An ending can depend on the shared opening, but it should not require a fact that appears only in the other ending. The boat, oars and chest are already present when the fork arrives. Either ending can use those details without borrowing an event from its alternative.

Close each path where its consequence becomes clear. Row out ends with the retrieved chest; Stay ashore ends with the empty-handed keeper. Neither needs a later passage combining them. Reuse the same heading names in the choice and above the final passages so the prose names an unambiguous destination.

## Naming this single-page tale

For this invented tale, `chest-at-the-cove.md` names the page by its central object and setting. The title placeholder can become a different title without changing that name. Filename spelling is discussed in [Markdown naming conventions](markdown-file-naming.md).

## Where Sashmark fits

Reading a tale and revising its sentences would fall within Sashmark's planned Markdown reading and editing role on the desktop. Its audience keeps Markdown files written by agents. Work on Sashmark continues in development, with full v1 still planned.
