Skip to content

Commit

Permalink
Add hack for Turkish apostrophe-hyphenation rule
Browse files Browse the repository at this point in the history
To be removed when [upstream issue][1] is fixed.

[1]: sile-typesetter/sile#355
  • Loading branch information
alerque committed Feb 21, 2019
1 parent 2dfe829 commit 3bdd107
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions casile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -781,3 +781,8 @@ end
isScreenLayout = function ()
return CASILE.layout == "app" or CASILE.layout == "screen"
end

-- Apostrophe Hack, see https://github.com/simoncozens/sile/issues/355
SILE.registerCommand("ah", function ()
SILE.call("discretionary", { prebreak = "-", replacement = "" })
end)
5 changes: 4 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,9 @@ $(FULLPDFS): %.pdf: %.sil $$(call coverpreq,$$@) .casile.lua $$(call onpaperlibs
fi
$(addtopub)

# Apostrophe Hack, see https://github.com/simoncozens/sile/issues/355
ah := perl -Mutf8 -CS -pne '/^\#/ or s/(?<=\p{L})’(?=\p{L})/\\ah{}/g' |

FULLSILS := $(call pattern_list,$(SOURCES),$(REALLAYOUTS),.sil)
FULLSILS += $(call pattern_list,$(SOURCES),$(EDITS),$(REALLAYOUTS),.sil)
$(FULLSILS): PANDOCFILTERS = --filter=$(CASILEDIR)/svg2pdf.py
Expand All @@ -539,7 +542,7 @@ $(FULLSILS): %.sil: $$(PROCESSEDSOURCE) $$(call pattern_list,$$(call parse_booki
--template=$(filter %.sil,$^) \
--from=markdown-raw_tex \
--to=sile \
$(filter %-manifest.yml,$^) =(< $< $(call pre_sile_markdown_hook)) |
$(filter %-manifest.yml,$^) =(< $< $(call ah) $(call pre_sile_markdown_hook)) |
$(call sile_hook) > $@

# Send some environment data to a common Lua file to be pulled into all SILE runs
Expand Down

0 comments on commit 3bdd107

Please sign in to comment.