├── notes ├── .gitkeep └── notes.md ├── .gitignore ├── cover.png ├── content ├── content.md ├── E02_Biography.md ├── E01_Appendix.md ├── A01_Foreward.md ├── A02_Preface.md └── C01.md ├── metadata.yml ├── LICENSE.txt ├── compile.sh └── markdown-novel-template.md /notes/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | drafts/* 2 | -------------------------------------------------------------------------------- /cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/8bitbuddhist/markdown-novel-template/HEAD/cover.png -------------------------------------------------------------------------------- /notes/notes.md: -------------------------------------------------------------------------------- 1 | --- 2 | date-created: '2023-08-19 00:08' 3 | date-modified: '2023-08-20 10:08' 4 | --- 5 | # notes 6 | 7 | %% Begin Waypoint %% 8 | 9 | 10 | %% End Waypoint %% 11 | -------------------------------------------------------------------------------- /content/content.md: -------------------------------------------------------------------------------- 1 | --- 2 | date-created: '2023-08-19 00:08' 3 | date-modified: '2023-08-20 10:08' 4 | --- 5 | # content 6 | 7 | %% Begin Waypoint %% 8 | - [[A01_Foreward]] 9 | - [[A02_Preface]] 10 | - [[C01]] 11 | - [[E01_Appendix]] 12 | - [[E02_Biography]] 13 | 14 | %% End Waypoint %% 15 | -------------------------------------------------------------------------------- /metadata.yml: -------------------------------------------------------------------------------- 1 | --- 2 | title: markdown-novel-template 3 | subtitle: A template for writing novels in the Markdown markup language. 4 | author: 8bitbuddhist 5 | date: August 2023 6 | language: en-US 7 | output: 8 | pdf_document: 9 | toc: no 10 | number_sections: true 11 | cover-image: cover.png 12 | include-before: 13 | - '`\newpage{}`{=latex}' 14 | - '`\tableofcontents{}`{=latex}' 15 | - '`\newpage{}`{=latex}' 16 | --- 17 | -------------------------------------------------------------------------------- /content/E02_Biography.md: -------------------------------------------------------------------------------- 1 | --- 2 | date-created: '2023-08-15 09:08' 3 | date-modified: '2023-08-17 15:08' 4 | --- 5 | # Biography 6 | 7 | Quam lacus suspendisse faucibus interdum posuere lorem ipsum. Libero volutpat sed cras ornare arcu. Diam phasellus vestibulum lorem sed. Netus et malesuada fames ac turpis egestas. A iaculis at erat pellentesque adipiscing commodo. Ut venenatis tellus in metus vulputate eu scelerisque felis imperdiet. Dictum sit amet justo donec enim. Tempor id eu nisl nunc mi. Adipiscing elit pellentesque habitant morbi tristique senectus et netus. In aliquam sem fringilla ut morbi tincidunt augue interdum. Tristique nulla aliquet enim tortor at auctor urna nunc id. Ornare lectus sit amet est placerat. Ac odio tempor orci dapibus ultrices in iaculis. A diam maecenas sed enim ut sem viverra aliquet. In fermentum et sollicitudin ac orci phasellus egestas tellus rutrum. 8 | -------------------------------------------------------------------------------- /content/E01_Appendix.md: -------------------------------------------------------------------------------- 1 | --- 2 | date-created: '2023-08-15 09:08' 3 | date-modified: '2023-08-17 15:08' 4 | --- 5 | # Appendix 6 | 7 | Nec nam aliquam sem et tortor consequat id porta nibh. Nec feugiat in fermentum posuere urna nec tincidunt. Maecenas accumsan lacus vel facilisis volutpat est velit egestas. Et netus et malesuada fames ac. Posuere urna nec tincidunt praesent semper feugiat nibh sed. Neque laoreet suspendisse interdum consectetur libero. Semper feugiat nibh sed pulvinar proin gravida hendrerit. Sit amet massa vitae tortor condimentum lacinia quis. Eu augue ut lectus arcu bibendum at varius vel pharetra. Purus non enim praesent elementum. Senectus et netus et malesuada. Tempus quam pellentesque nec nam aliquam sem et. Posuere urna nec tincidunt praesent semper feugiat nibh. Montes nascetur ridiculus mus mauris. Massa eget egestas purus viverra accumsan in nisl nisi scelerisque. 8 | -------------------------------------------------------------------------------- /content/A01_Foreward.md: -------------------------------------------------------------------------------- 1 | --- 2 | date-created: '2023-08-15 09:08' 3 | date-modified: '2023-08-17 15:08' 4 | --- 5 | # Foreward 6 | 7 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. At lectus urna duis convallis convallis tellus id interdum velit. Massa tempor nec feugiat nisl pretium. Malesuada bibendum arcu vitae elementum curabitur vitae nunc sed. Feugiat pretium nibh ipsum consequat nisl vel. Aenean et tortor at risus viverra. Rhoncus mattis rhoncus urna neque. Quam id leo in vitae. Amet venenatis urna cursus eget nunc scelerisque. Suscipit adipiscing bibendum est ultricies integer. Risus nullam eget felis eget nunc lobortis. Elementum pulvinar etiam non quam lacus. Amet nisl suscipit adipiscing bibendum est. Urna nunc id cursus metus aliquam. Urna neque viverra justo nec ultrices dui sapien eget. Mattis rhoncus urna neque viverra. Elit eget gravida cum sociis natoque penatibus. 8 | -------------------------------------------------------------------------------- /content/A02_Preface.md: -------------------------------------------------------------------------------- 1 | --- 2 | date-created: '2023-08-15 09:08' 3 | date-modified: '2023-08-17 15:08' 4 | --- 5 | # Preface 6 | 7 | In tellus integer feugiat scelerisque varius morbi enim nunc. Pharetra massa massa ultricies mi quis hendrerit. Arcu non odio euismod lacinia at. Amet mattis vulputate enim nulla aliquet porttitor lacus luctus. Dui id ornare arcu odio ut. Pellentesque diam volutpat commodo sed egestas egestas fringilla phasellus faucibus. Vitae aliquet nec ullamcorper sit amet. Viverra nam libero justo laoreet sit amet cursus sit amet. Nec ultrices dui sapien eget mi. Venenatis a condimentum vitae sapien pellentesque. Eu scelerisque felis imperdiet proin fermentum leo vel. Nec sagittis aliquam malesuada bibendum arcu vitae elementum curabitur vitae. Adipiscing bibendum est ultricies integer quis auctor. Dui accumsan sit amet nulla facilisi morbi tempus. Eros donec ac odio tempor orci dapibus ultrices. Nibh cras pulvinar mattis nunc sed blandit libero volutpat sed. 8 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | ``` 2 | MIT License 3 | 4 | Copyright (c) 2022 Andre Newman 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | ``` -------------------------------------------------------------------------------- /compile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Get the draft name from Git 3 | DRAFT=$(git rev-parse --abbrev-ref HEAD) 4 | DRAFT_FILE="drafts/${DRAFT}/${DRAFT}" 5 | 6 | echo "Compiling new draft \"${DRAFT}\"..." 7 | 8 | # Create the draft directory if it doesn't already exist 9 | mkdir -p drafts/${DRAFT} 10 | 11 | # Initialize new main file 12 | echo > $DRAFT_FILE.md 13 | 14 | # Grab content files and add a page break to the end of each one. 15 | find ./content/*.md ! -name content.md -print0 | sort -z | while read -d $'\0' file 16 | do 17 | # Add newline to Markdown doc 18 | echo >> $DRAFT_FILE.md 19 | # Clean up incoming Markdown and append it to final doc 20 | sed '/%% Begin Waypoint %%/,/%% End Waypoint %%/d' $file >> $DRAFT_FILE.md 21 | echo "\\newpage" >> $DRAFT_FILE.md 22 | done 23 | 24 | # Generate the output files: 25 | # Markdown -> DOCX 26 | # Markdown -> EPUB 27 | # Markdown -> PDF (A4 size) 28 | # Markdown -> PDF (B6/Standard book size) 29 | pandoc -t docx $DRAFT_FILE.md -o $DRAFT_FILE.docx --metadata-file metadata.yml 30 | pandoc -t epub $DRAFT_FILE.md -o $DRAFT_FILE.epub --metadata-file metadata.yml 31 | pandoc $DRAFT_FILE.md -o ${DRAFT_FILE}-a4.pdf --metadata-file metadata.yml -V geometry:"a4paper" -V fontsize:"12pt" 32 | pandoc $DRAFT_FILE.md -o ${DRAFT_FILE}-b6.pdf --metadata-file metadata.yml -V geometry:"b6paper" -V fontsize:"10pt" 33 | 34 | echo "Done! Your new draft is in ${PWD}/drafts/${DRAFT}/" 35 | -------------------------------------------------------------------------------- /content/C01.md: -------------------------------------------------------------------------------- 1 | --- 2 | date-created: '2023-08-15 09:08' 3 | date-modified: '2023-08-17 15:08' 4 | --- 5 | # Chapter 1 6 | 7 | Velit aliquet sagittis id consectetur purus ut faucibus pulvinar elementum. Adipiscing elit duis tristique sollicitudin nibh sit amet. Ultricies mi eget mauris pharetra et ultrices neque ornare aenean. Ipsum a arcu cursus vitae. Sed sed risus pretium quam vulputate dignissim suspendisse in est. Proin nibh nisl condimentum id venenatis a. Aliquet nibh praesent tristique magna sit amet purus gravida quis. Mattis rhoncus urna neque viverra justo. Magna ac placerat vestibulum lectus mauris ultrices. Ut tellus elementum sagittis vitae et. Eget nunc lobortis mattis aliquam. Nam aliquam sem et tortor consequat id porta nibh venenatis. Tortor posuere ac ut consequat semper viverra. Diam vel quam elementum pulvinar. 8 | 9 | Sollicitudin aliquam ultrices sagittis orci. Commodo elit at imperdiet dui. Viverra mauris in aliquam sem fringilla ut. Neque egestas congue quisque egestas diam in arcu cursus. Amet luctus venenatis lectus magna. Vitae congue mauris rhoncus aenean vel elit scelerisque. Odio aenean sed adipiscing diam donec adipiscing tristique risus nec. Volutpat consequat mauris nunc congue nisi vitae suscipit tellus. Suscipit tellus mauris a diam maecenas sed enim. Tincidunt ornare massa eget egestas purus. Lectus sit amet est placerat in egestas erat imperdiet. 10 | 11 | Vitae justo eget magna fermentum iaculis eu non diam phasellus. Mollis aliquam ut porttitor leo a diam sollicitudin tempor. Aenean et tortor at risus viverra adipiscing at in. Gravida dictum fusce ut placerat. Ut ornare lectus sit amet est. Non enim praesent elementum facilisis leo. Gravida arcu ac tortor dignissim convallis aenean. Pretium aenean pharetra magna ac placerat vestibulum lectus mauris ultrices. Et pharetra pharetra massa massa ultricies mi quis hendrerit dolor. Volutpat lacus laoreet non curabitur gravida arcu. Ut tortor pretium viverra suspendisse potenti nullam. Gravida quis blandit turpis cursus in hac. Hendrerit gravida rutrum quisque non tellus orci ac auctor augue. Felis imperdiet proin fermentum leo vel orci porta. Sollicitudin nibh sit amet commodo. Tellus cras adipiscing enim eu. 12 | -------------------------------------------------------------------------------- /markdown-novel-template.md: -------------------------------------------------------------------------------- 1 | --- 2 | date-created: '2023-08-15 12:08' 3 | date-modified: '2023-08-20 10:08' 4 | --- 5 | # Markdown Novel Template 6 | 7 | %% Begin Waypoint %% 8 | - **[[content]]** 9 | - **drafts** 10 | - **[[main]]** 11 | - **[[notes]]** 12 | 13 | %% End Waypoint %% 14 | 15 | This folder provides a blank novel template for writing in the [Markdown](https://daringfireball.net/projects/markdown/) markup language. This also provides a script for compiling the complete work into Markdown, EPUB, Microsoft Word, and PDF formats. 16 | 17 | Note: The script is designed primarily for Linux and macOS. Windows is untested. 18 | 19 | ## Adding your content 20 | 21 | The main contents of your novel should be stored in the `content/` folder as Markdown (`.md`) files. Each file corresponds to a single section or chapter of your final book. 22 | 23 | When compiling the novel, all Markdown files are sorted in alphabetical order and merged, with page breaks added automatically at the end of each file. 24 | 25 | The `notes` folder is for any content that you don't want to include in the final draft. Use this folder to store research, storyboards, images, etc. 26 | 27 | **Note:** You don't need a Title Page or Table of Contents. These are automatically generated for you! 28 | 29 | ### Recommended file structure 30 | 31 | You can name the files in this folder however you want, but this template uses the following naming convention: 32 | 33 | - `AXX_` for front Matter (Foreward, Preface, etc.): 34 | - A01_Copyright.md 35 | - A02_Preface.md 36 | - … 37 | - `CXX_` for chapters: 38 | - C01.md 39 | - C02.md 40 | - … 41 | - `EXX_` for back Matter (Appendices, Epilogues, etc.): 42 | - E01_Appendix.md 43 | - E02_Epilogue.md 44 | - … 45 | 46 | ## Compiling your novel 47 | 48 | `compile.sh` is a helper script that compiles and formats your novel into the following formats: 49 | 50 | - A single combined Markdown (`.md`) file. 51 | - EPUB 52 | - DOCX 53 | - PDF (A4 sized) 54 | - PDF (B6 sized) 55 | 56 | ### Requirements 57 | 58 | To use the script, you'll need to install the following software (this list is for Arch Linux): 59 | 60 | - `find` 61 | - `pandoc` 62 | - `pandoc-crossref` 63 | - `texlive-core` 64 | - `texlive-fontsrecommended` 65 | - `texlive-latexrecommended` 66 | 67 | ### Setting your own metadata (title, author, etc.) 68 | 69 | The `metadata.yml` file contains fields for setting the book's `title`, `subtitle`, `author`, and publication `date`. The compile script uses this data to generate a title page. You can customize these fields as needed. 70 | 71 | ### Changing the cover image 72 | 73 | Set your own cover image by replacing `cover.png`. 74 | 75 | ### Compiling 76 | 77 | Run `compile.sh` to compile your novel: 78 | 79 | ```bash 80 | ./compile.sh 81 | ``` 82 | 83 | This creates a subfolder in `drafts` named after the current git branch. For example, if your branch is called `main`, then your drafts will be created in `drafts/main/`. I recommend creating a new branch for each draft, but how you manage this is up to you. 84 | 85 | Happy writing! 86 | --------------------------------------------------------------------------------