-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add hyphenation. Remove fonts from ebooks.
- Loading branch information
1 parent
680f193
commit df761cd
Showing
9 changed files
with
344 additions
and
455 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/styles/ebook.css | ||
/ebooks/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
ls New-Introductory-Lectures-On-Psycho-Analysis.md styles/* template.t filters/* cover.png | entr make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import re | ||
from pandocfilters import Str, toJSONFilter | ||
from pyphen import Pyphen | ||
|
||
dic = Pyphen(lang='en_GB', left=3, right=3) | ||
|
||
word_detection_pattern = re.compile(r'\w{7,}', re.UNICODE) | ||
|
||
def hyphenate(key, value, format, meta): | ||
if key == 'Str': | ||
return Str(word_detection_pattern.sub( | ||
lambda match: dic.inserted(match.group(0), hyphen=''), | ||
value)) | ||
|
||
if __name__ == "__main__": | ||
toJSONFilter(hyphenate) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
nix-shell -p pkgs.{pandoc,gnumake,entr} 'pkgs.python3.withPackages (pkgs: with pkgs; [pandocfilters pyphen])' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,33 @@ | ||
@font-face | ||
{ font-family: libertine; | ||
src: url(../fonts/LinLibertine_R.woff); } | ||
|
||
@font-face | ||
{ font-family: libertine; | ||
font-style: italic; | ||
src: url(../fonts/LinLibertine_RI.woff); } | ||
|
||
@font-face | ||
{ font-family: libertine; | ||
font-weight: bold; | ||
src: url(../fonts/LinLibertine_RB.woff); } | ||
|
||
@font-face | ||
{ font-family: libertine; | ||
font-weight: bold; | ||
font-style: italic; | ||
src: url(../fonts/LinLibertine_RBI.woff); } | ||
|
||
body | ||
{ font-family: libertine, serif; } | ||
|
||
@media (min-width: 34rem) | ||
{ html | ||
{ font-size: 1rem; } | ||
|
||
body | ||
{ width: 34rem; | ||
margin: 0 auto; } } | ||
|
||
section.level1 | ||
{ margin-bottom: 20rem; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters