<commit_before># Mountain

[Fountain](http://fountain.io) is a plain-text markup language for
screenwriting.

Fountain is awesome, but it can be somewhat cumbersome to use in practice
because the vast majority of [Fountain apps](http://fountain.io/apps) assume
that the entire screenplay is housed in a single file.

This means that if you're storing your screenplay in multiple files (say, a
file per scene or sequence), then you're likely fighting an uphill battle
against your screenwriting software.

This isn't Fountain's fault -- it's just a markup language, and file
organization is a higher-level concern.

That being said, we can change the equation by building tooling (see
[Exhibit A](http://johnaugust.com/2014/fountain-for-coders-or-the-joy-of-writing)
and [Exhibit B](http://slugline.co/blog/shotlists) for examples unrelated to
the concern of file organization).

Mountain makes it possible to arbitrarily organize the file layout of your
screenplay. More specifically, it is a tool for intelligently splitting and
combining files in the Fountain screenplay format\*.

See the accompanying
[blog post](http://blog.mjrusso.com/2014/08/15/mountain-screenwriting-with-fountain.html)
for more details on the specific motivations that led to this tool's creation,
and why multi-file screenplays may be beneficial to your screenwriting
workflow.

_\* Technically, there's not really anything in Mountain that's
Fountain-specific, besides the usage of the notes syntax (`[[ ]]`) to specify
**directives**. However, it was built specifically to make working with long
Fountain documents more palatable._

## Installation

```bash
git clone https://github.com/mjrusso/mountain.git
cd mountain
python setup.py install
```

After installation, the `mountain` binary will be available in your `$PATH`.

Note that Python >= 2.7 is required to run this project.

## Usage

The following command will print detailed usage information:

```bash
mountain --help
```

There are two main commands available -- `mountain join`, and `mountain split`.

### Tutorial

Create an outline file (or "manifest"). We'll call the file `manifest.fountain`
for the purpose of this tutorial, but it can be named whatever you like.

_manifest.fountain_:

```markdown
# ACT I

= Meet the **Hero**.

[[#include intro.fountain]]
<commit_msg>Add documentation on 'directives' concept.<commit_after># Mountain

[Fountain](http://fountain.io) is a plain-text markup language for
screenwriting.

Fountain is awesome, but it can be somewhat cumbersome to use in practice
because the vast majority of [Fountain apps](http://fountain.io/apps) assume
that the entire screenplay is housed in a single file.

This means that if you're storing your screenplay in multiple files (say, a
file per scene or sequence), then you're likely fighting an uphill battle
against your screenwriting software.

This isn't Fountain's fault -- it's just a markup language, and file
organization is a higher-level concern.

That being said, we can change the equation by building tooling (see
[Exhibit A](http://johnaugust.com/2014/fountain-for-coders-or-the-joy-of-writing)
and [Exhibit B](http://slugline.co/blog/shotlists) for examples unrelated to
the concern of file organization).

Mountain makes it possible to arbitrarily organize the file layout of your
screenplay. More specifically, it is a tool for intelligently splitting and
combining files in the Fountain screenplay format\*.

See the accompanying
[blog post](http://blog.mjrusso.com/2014/08/15/mountain-screenwriting-with-fountain.html)
for more details on the specific motivations that led to this tool's creation,
and why multi-file screenplays may be beneficial to your screenwriting
workflow.

_\* Technically, there's not really anything in Mountain that's
Fountain-specific, besides the usage of the notes syntax (`[[ ]]`) to specify
**directives**. However, it was built specifically to make working with long
Fountain documents more palatable._

## Installation

```bash
git clone https://github.com/mjrusso/mountain.git
cd mountain
python setup.py install
```

After installation, the `mountain` binary will be available in your `$PATH`.

Note that Python >= 2.7 is required to run this project.

## Usage

The following command will print detailed usage information:

```bash
mountain --help
```

There are two main commands available -- `mountain join`, and `mountain split`.

### Directives

Mountain makes use of two "**directives**:

- `#include`
- `#reference` (and its companion, `/reference`)

A directive is metadata that is encoded inside of Fountain note. (Fountain does
not currently have first-class support for metadata.)

`#include` enables a Fountain document to reference another Fountain document.

`#reference ... /reference` is used to wrap a document thta has been inline
`#include`d.

(Examples are available in the following tutorial.)

### Tutorial

Create an outline file (or "manifest"). We'll call the file `manifest.fountain`
for the purpose of this tutorial, but it can be named whatever you like.

_manifest.fountain_:

```markdown
# ACT I

= Meet the **Hero**.

[[#include intro.fountain]]

{'fraction_non_alphanumeric': 0.08605283605283605, 'fraction_numerical': 0.005439005439005439, 'mean_word_length': 4.727474972191324, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7159873', 'n_tokens_mistral': 1494, 'n_tokens_neox': 1367, 'n_words': 653}