Skip to main content

A toolkit for writing stories in a modular way.

Project description

# writerblocks

A toolkit for writing stories in a modular way.

## Overview

writerblocks provides a way of constructing structured stories from a collection of Markdown-formatted text files. It’s intended to be highly flexible and customizable, and to make it easy to reorder, restructure, and change around the story on the fly.

writerblocks works using a project directory, containing the following:

  1. Some number of text files, default Markdown-formatted, representing “scenes” or snippets of story, which may be stored in subdirectories. Each text file may contain a “tags block” consisting of the word “tags:” followed by one or more lines containing comma-separated tags, keywords, or labels that categorize the contents of that file.

  2. An index file, which is a YAML or JSON file that contains the relative locations of the scene files and information about the organization of those scenes. It may simply be a list that tells what order the files should be read in, or it may group them under volumes, chapters, sections, or some other hierarchical structure.

  3. A configuration file, writerblocks.ini, that contains default options that would otherwise be provided on the command line.

  4. A format file, which is a YAML or JSON file that contains instructions for how to format the story. This file can specify what to use to separate scenes, chapters, or whatever other grouping mechanisms are used in the index.

(The configuration and format files, as well as an empty index file, can be automatically generated; see usage examples for how to do that.)

It’s additionally possible to create a preamble file whose contents will be automatically attached to the beginning of the final output file.

Once the user has created the project directory, they can call writerblocks to combine the scenes into new files, which can then be optionally converted into a publication format (PDF, epub, HTML, etc.) according to the ordering and structure defined in the index file.

Additionally, the user can combine only scenes that have specific tags; for example, if they choose to tag all scenes with the characters that appear in that scene, they could generate a file containing the scenes that featured specific characters, to look at what those characters’ arc looks like on its own. It’s also possible to exclude scenes based on their tags, so if you want to look at the scenes involving characters A and B but not C, that can be easily done as well.

Since the order of scenes depends only on the index file, if the user decides that a particular scene or group of scenes needs to happen at a different point in the story, they need only to move the filenames in the index. Removing a scene is easy too, and doesn’t require deleting the actual file; just get rid of any references to it in the index and consider it gone!

## Requirements

writerblocks depends on Python 3.5 or newer. It also requires pandoc (tested with version 1.19.2.4) for the format conversion process.

## Some usage examples
  • Launch the GUI tool: writerblocks-gui

  • Create a new project with default options in directory some/dir:

    writerblocks-cli –base-dir /some/dir –new-project

  • Generate a PDF based on the contents of my_index.json in the current working directory:

    writerblocks-cli –out-fmt pdf –out-file out.pdf –index-file my_index.json

  • Generate foo.md, a compilation of all files with the tag foo in said index:

    writerblocks-cli -f markdown -o foo.md -i my_index.json -t foo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

writerblocks-0.3.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

writerblocks-0.3-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file writerblocks-0.3.tar.gz.

File metadata

  • Download URL: writerblocks-0.3.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for writerblocks-0.3.tar.gz
Algorithm Hash digest
SHA256 b20f0e7fded2693e741af3e14cd92cc077c6b088932b0cdcf99bae15b78defa5
MD5 fbf347f70c8c898c5dabd03ea49a4dad
BLAKE2b-256 8895eb9a83d9d9b6461798a274e027446386871e2e50b111bf8bc3128d5bfabe

See more details on using hashes here.

File details

Details for the file writerblocks-0.3-py3-none-any.whl.

File metadata

  • Download URL: writerblocks-0.3-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3

File hashes

Hashes for writerblocks-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ea7800e6f2c49efbefc63927e1aeab1f4547a19b52f2ab02e53dcfa3c80942ac
MD5 64bd136eda6db918a6cf5c39b65e4b0c
BLAKE2b-256 15eac12367c15cdfd447068b73e2cd0183a0a9d5c8faeb8e99f945e994a6caea

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page