Use latest dev typst-hs.

This commit is contained in:
John MacFarlane
2023-07-05 12:44:57 -07:00
parent e09c560256
commit d3e485fcb0
3 changed files with 3 additions and 17 deletions
+1 -1
View File
@@ -15,6 +15,6 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/jgm/typst-hs
tag: cd2583f638033cdedda2460642c93315fbc11979
tag: be9e946616b1564106255a4de7e69a70c5be848b
-- when time for a release:
-- Release new skylighting, skylighting-core and depend on them
+1 -15
View File
@@ -44,7 +44,7 @@ import Text.TeXMath (writeTeX)
import Text.TeXMath.Shared (getSpaceChars)
import Text.Pandoc.Readers.Typst.Math (pMathMany)
import Text.Pandoc.Readers.Typst.Parsing (pTok, ignored, chunks, getField, P)
import Typst.Methods (applyPureFunction, formatNumber)
import Typst.Methods (formatNumber, applyPureFunction)
import Typst.Types
-- import Debug.Trace
@@ -309,12 +309,6 @@ handleBlock tok = do
pure $ B.plain . B.text . mconcat . map toNum $ V.toList nums
Elt "footnote.entry" _ fields ->
getField "body" fields >>= pWithContents pBlocks
Elt "style" _ fields -> do
Function f <- getField "func" fields
case applyPureFunction (Function f) [VStyles] of
Success (VContent cs) -> pWithContents pBlocks cs
Success x -> pure $ B.para $ B.text $ repr x
Failure e -> fail e
Elt (Identifier tname) _ _ -> do
ignored ("unknown block element " <> tname)
pure mempty
@@ -335,7 +329,6 @@ pParBreak =
isInline :: Content -> Bool
isInline (Lab {}) = True
isInline (Txt {}) = True
isInline (Elt "style" _ _) = True -- can be block or inline
isInline (Elt "place" _ _) = True -- can be block or inline
isInline (Elt "align" _ _) = True -- can be block or inline
isInline x = not (isBlock x)
@@ -383,7 +376,6 @@ isBlock (Elt name _ fields) =
"v" -> True
"xml" -> True
"yaml" -> True
"style" -> True
_ -> False
pWithContents :: PandocMonad m => P m a -> Seq Content -> P m a
@@ -515,12 +507,6 @@ handleInline tok =
LExact x LPt -> toRational x / 12
_ -> 1 / 3 -- guess!
pure $ B.text $ getSpaceChars em
Elt "style" _ fields -> do
Function f <- getField "func" fields
case applyPureFunction (Function f) [VStyles] of
Success (VContent cs) -> pWithContents pInlines cs
Success x -> pure $ B.text $ repr x
Failure e -> fail e
Elt "place" _pos fields -> do
ignored "parameters of place"
getField "body" fields >>= pWithContents pInlines
+1 -1
View File
@@ -25,7 +25,7 @@ extra-deps:
- typst-symbols-0.1.2
- toml-parser-1.1.1.0
- git: https://github.com/jgm/typst-hs
commit: cd2583f638033cdedda2460642c93315fbc11979
commit: be9e946616b1564106255a4de7e69a70c5be848b
- git: https://github.com/jgm/pandoc-types
commit: 2b68c905e75c65e66eaa4635e4c1bd6aabd6302f