From 36a34e190d3b9a682d719a3f9aea1432370aede0 Mon Sep 17 00:00:00 2001 From: Dave Burt Date: Wed, 21 Feb 2024 21:37:50 +1100 Subject: [PATCH 1/2] Fix misplaced 'Spells K' heading --- Spells (Alt)/Spells J.md | 24 +----------------------- Spells (Alt)/Spells K.md | 21 ++++++++++++++++++++- Spells/Jump.md | 2 -- 3 files changed, 21 insertions(+), 26 deletions(-) diff --git a/Spells (Alt)/Spells J.md b/Spells (Alt)/Spells J.md index 769b986..66a471b 100644 --- a/Spells (Alt)/Spells J.md +++ b/Spells (Alt)/Spells J.md @@ -12,26 +12,4 @@ **Duration:** 1 minute -You touch a creature. The creature's jump distance is tripled until the spell ends. - -# Spells (K) - -#### Knock - -*2nd-level transmutation* - -**Casting Time:** 1 action - -**Range:** 60 feet - -**Components:** V - -**Duration:** Instantaneous - -Choose an object that you can see within range. The object can be a door, a box, a chest, a set of manacles, a padlock, or another object that contains a mundane or magical means that prevents access. - -A target that is held shut by a mundane lock or that is stuck or barred becomes unlocked, unstuck, or unbarred. If the object has multiple locks, only one of them is unlocked. - -If you choose a target that is held shut with *arcane lock*, that spell is suppressed for 10 minutes, during which time the target can be opened and shut normally. - -When you cast the spell, a loud knock, audible from as far away as 300 feet, emanates from the target object. \ No newline at end of file +You touch a creature. The creature's jump distance is tripled until the spell ends. \ No newline at end of file diff --git a/Spells (Alt)/Spells K.md b/Spells (Alt)/Spells K.md index 91214e5..68d33ef 100644 --- a/Spells (Alt)/Spells K.md +++ b/Spells (Alt)/Spells K.md @@ -1,3 +1,22 @@ + # Spells (K) -None. \ No newline at end of file +#### Knock + +*2nd-level transmutation* + +**Casting Time:** 1 action + +**Range:** 60 feet + +**Components:** V + +**Duration:** Instantaneous + +Choose an object that you can see within range. The object can be a door, a box, a chest, a set of manacles, a padlock, or another object that contains a mundane or magical means that prevents access. + +A target that is held shut by a mundane lock or that is stuck or barred becomes unlocked, unstuck, or unbarred. If the object has multiple locks, only one of them is unlocked. + +If you choose a target that is held shut with *arcane lock*, that spell is suppressed for 10 minutes, during which time the target can be opened and shut normally. + +When you cast the spell, a loud knock, audible from as far away as 300 feet, emanates from the target object. \ No newline at end of file diff --git a/Spells/Jump.md b/Spells/Jump.md index 0938255..240c368 100755 --- a/Spells/Jump.md +++ b/Spells/Jump.md @@ -11,5 +11,3 @@ **Duration:** 1 minute You touch a creature. The creature's jump distance is tripled until the spell ends. - -# Spells (K) \ No newline at end of file From 2fdb812f462de1769e49f03a76547825b9bc9721 Mon Sep 17 00:00:00 2001 From: Dave Burt Date: Wed, 21 Feb 2024 21:38:10 +1100 Subject: [PATCH 2/2] Add ePub builder --- .gitignore | 3 +++ build_epub | 38 ++++++++++++++++++++++++++++++++++++++ title.txt | 6 ++++++ 3 files changed, 47 insertions(+) create mode 100644 .gitignore create mode 100755 build_epub create mode 100644 title.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0e17d20 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +chapters +tmp +*.epub diff --git a/build_epub b/build_epub new file mode 100755 index 0000000..0c884b6 --- /dev/null +++ b/build_epub @@ -0,0 +1,38 @@ +#!/usr/bin/env ruby + +require 'pathname' + +chapters = %w( + Races + Classes + Characterizations + Gameplay + Equipment + Gamemastering + Spells\ (Alt) + Treasure\ (Alt) + Monsters\ (Alt) +) + +# chapter = h1 +# file = h2 + +`rm chapters/*.md` + +chapters.each_with_index do |chapter, i| + s = "# #{chapter.split.first}\n\n" + + Pathname(chapter).children.sort.map do |f| + data = f.read + data[/^#+ /] = '' # remove initial heading (it will be re-added as h2) + hs = data.scan(/^#+ /).sort.uniq.map {|hdg| hdg.size - 1 } + (hs.length - 1).downto(0) do |h| + data.gsub! /^\#{#{hs[h]}}/, '#' * (h + 3) + end + "\n\n## " + data + end.join + File.write "chapters/#{i+1}_#{chapter.split.first}.md", s +end + +pandoc_cmd = "pandoc -o Dungeons_and_Dragons_SRD_5.1.epub title.txt chapters/*" +puts pandoc_cmd +system pandoc_cmd diff --git a/title.txt b/title.txt new file mode 100644 index 0000000..4e2c6d9 --- /dev/null +++ b/title.txt @@ -0,0 +1,6 @@ +--- +title: Dungeons and Dragons SRD 5.1 +author: Wizards of the Coast +rights: CC-BY-4.0 +language: en-US +---