summaryrefslogtreecommitdiff
path: root/Pancake/Printing.hs
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2017-11-07 21:37:54 +0300
committerdefanor <defanor@uberspace.net>2017-11-07 22:17:34 +0300
commit1d8a5140e3ce03d9fa6b9c63a6621ab3ab64eb4c (patch)
treecd3f131567cc0ac9c86b752f22f25e3cd319ce45 /Pancake/Printing.hs
parent5301bb027cf56a0e1148808f11510e7fcc298b86 (diff)
Let Emacs to render subscripts, superscripts, strikethrough
That is, add `Styled` constructors for those.
Diffstat (limited to 'Pancake/Printing.hs')
-rw-r--r--Pancake/Printing.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/Pancake/Printing.hs b/Pancake/Printing.hs
index 66d2606..9bc6c81 100644
--- a/Pancake/Printing.hs
+++ b/Pancake/Printing.hs
@@ -30,6 +30,12 @@ propertize t (Bold s) =
fromMaybe id (getCapability t withBold) $ propertize t s
propertize t (Emph s) =
fromMaybe id (getCapability t withStandout) $ propertize t s
+propertize t (Strikethrough s) =
+ mconcat [termText "-", propertize t s, termText "-"]
+propertize t (Subscript s) =
+ mconcat [termText "_{", propertize t s, termText "}"]
+propertize t (Superscript s) =
+ mconcat [termText "^{", propertize t s, termText "}"]
propertize t (Underline s) =
fromMaybe id (getCapability t withUnderline) $ propertize t s
propertize t (Denote _ s) = propertize t s
@@ -78,6 +84,9 @@ showSexps uri ro =
showSexp (Bold s) = list ["style", "bold", showSexp s]
showSexp (Underline s) = list ["style", "underline", showSexp s]
showSexp (Emph s) = list ["style", "italic", showSexp s]
+ showSexp (Strikethrough s) = list ["style", "strikethrough", showSexp s]
+ showSexp (Subscript s) = list ["subscript", showSexp s]
+ showSexp (Superscript s) = list ["superscript", showSexp s]
showSexp (Denote d s) = list [ "denotation"
, showDenotation d
, showSexp s]