GithubHelp home page GithubHelp logo

prosegrinder / pandoc-templates Goto Github PK

View Code? Open in Web Editor NEW
65.0 4.0 14.0 395 KB

An opinionated set of Pandoc templates and scripts for converting markdown to DOCX manuscripts that adhere to William Shunn's Proper Manuscript Format guidelines using Pandoc.

Home Page: http://www.prosegrinder.com/pandoc-templates

License: GNU General Public License v3.0

Shell 46.53% Lua 25.20% PowerShell 28.27%
pandoc docx markdown fiction publishing

pandoc-templates's Introduction

Pandoc Templates

An opinionated set of Pandoc templates and scripts for converting markdown to DOCX manuscripts that adhere to William Shunn's Proper Manuscript Format guidelines using Pandoc.

Getting Started

These templates and scripts aim to be easy to install and use, and consistent across Windows, Mac, and Linux. I generally use Mac and Linux at home, so Windows scripts may lag behind those.

Requirements

  • Pandoc version 2.0 or greater.

Pandoc

See the Pandoc site for full installation instructions. For Linux, I strongly suggest using LinuxBrew instead of your distribution's package manager for the same reason given in the Pandoc installation instructions. Install LinuxBrew and follow the instructions for installing on Mac via HomeBrew. Versions packaged by your distribution may be too old.

Markdown

These templates only work for short and long fiction written in Markdown. See Sustainable Authorship in Plain Text using Pandoc and Markdown if you're interested in my motivation. I hope one day soon publishers in the fiction markets will prefer submissions in Markdown over DOCX as it minimized the burden of typsetting on the author and is relatively easy to convert to many other formats (e.g. using Pandoc).

Installation

Once you have Pandoc set up, you'll need to copy these files to your local machine.

Install via Download

If you're not familiar with git, no big deal. Just download the latest release and extract it to any directory you like.

Install via Git

If you're git savvy, clone this repository:

git clone https://github.com/prosegrinder/pandoc-templates.git

Usage

Once you have the templates installed locally, you'll need to make sure your source Markdown document has the proper frontmatter.

Frontmatter

These templates assume the following frontmatter in at least one of the markdown files. The following is from the guidelines.md file used to test Shunn's Short Story Format:

title: "Proper Manuscript Format"
short_title: "Format"
author: "by William Shunn"
author_lastname: "Shunn"
contact_name: "William Shunn"
contact_address: "12 Courier Lane"
contact_city_state_zip: "Pica's Font, NY 10010"
contact_phone: "(212) 555-1212"
contact_email: "[email protected]"

Optional properties for the frontpage:

subtitle: Optional field
abstract: |-
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Nam libero justo laoreet sit amet cursus. Etiam erat velit scelerisque in dictum non consectetur a. Duis tristique sollicitudin nibh sit amet commodo nulla.

md2short.sh

The script simplifies the process of converting a short story in markdown to a Microsoft Word DOCX file in William Shunn's Short Story Format:

For Mac & Linux:

md2short.sh --output DOCX [--overwrite] [--modern] FILES

  -o DOCX               --output=DOCX
    Write the output to DOCX. Passed straight to pandoc as-is.
  -x                    --overwrite
    If output FILE exists, overwrite without prompting.
  -m                    --modern
    Use Shunn modern manuscript format (otherwise use Shunn classic)
  FILES
    One (1) or more Markdown file(s) to be converted to DOCX.
    Passed straight to pandoc as-is.

For example:

$PANDOC_TEMPLATES_HOME/bin/md2short.sh --output $HOME/somecoolstory.docx --overwrite $HOME/somecoolstory.md

For Windows (using PowerShell 5.0 or greater): under revision

.\bin\md2short.ps1 -overwrite -modern -output $env:USERPROFILE/Documents/short-out-ps.docx './test/short/guidelines.md'

md2long.sh

The script simplifies the process of converting a novel in markdown to a Microsoft Word DOCX file in William Shunn's Novel Format:

For Mac & Linux:

md2long.sh --output DOCX [--overwrite] FILES

  -o DOCX               --output=DOCX
    Write the output to DOCX.
    Passed straight to pandoc as-is.
  -x                    --overwrite
    If output FILE exists, overwrite without prompting.
  FILES
    One (1) or more Markdown file(s) to be converted to DOCX.
    Passed straight to pandoc as-is.

For example:

$PANDOC_TEMPLATES_HOME/bin/md2long.sh --output $HOME/somecoolstory.docx --overwrite $HOME/manuscript/ch*.md

For Windows (using PowerShell 5.0 or greater): under revision

Credits

Contributing

When contributing to this repository, please first open an issue to discuss the changes you wish to make.

In general:

  • Use the standard Pull Request process.
  • Be respectful of yourself and others.
  • Have fun!

Versioning

This project uses SemVer for versioning. For the versions available, see the tags on this repository.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.