diff --git a/app/IR.hs b/app/IR.hs index a46bd3a..9a78e84 100644 --- a/app/IR.hs +++ b/app/IR.hs @@ -1,4 +1,18 @@ -module IR ( -) where +module IR where +import Data.Text +-- Html and Math tags come with their data because they are leaves for us +-- We aren't parsing that if we can avoid it +data Tag = Heading {level :: Int} | Paragraph | Blockquote | Code | Html {html :: Text} | Anchor | Italic | Bold | Math {mathML :: Text} + +data Data = Ast {ast :: AST} | Text {text :: Text} + +data AST = AST {tag :: Tag, child :: [Data]} + +-- for processing math +-- https://hackage.haskell.org/package/typst-0.6.1/docs/Typst-Parse.html#v:parseTypst +-- and +-- https://hackage.haskell.org/package/typst-symbols-0.1.7/docs/Typst-Symbols.html +-- are going to be used for handling typst and +-- texmath for latex handling diff --git a/app/Markdown.hs b/app/Markdown.hs index 568c185..6a1333c 100644 --- a/app/Markdown.hs +++ b/app/Markdown.hs @@ -1,4 +1,4 @@ -module Markdown ( -) where - +module Markdown where +-- https://spec.commonmark.org/0.31.2/ +-- https://hackage.haskell.org/package/parsec diff --git a/app/Restruct.hs b/app/Restruct.hs index 2839524..2fd3e42 100644 --- a/app/Restruct.hs +++ b/app/Restruct.hs @@ -1,4 +1,4 @@ -module Restruct ( -) where - +module Restruct where +-- https://docutils.sourceforge.io/rst.html +-- https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html diff --git a/psb.cabal b/psb.cabal index 3e20f64..0f9ef17 100644 --- a/psb.cabal +++ b/psb.cabal @@ -35,7 +35,7 @@ executable psb -- Other library packages from which modules are imported. -- https://hackage.haskell.org/package/texmath - build-depends: base >=4.17.2.1, mustache >=2.4.2, pandoc >=3.2.1, shake >= 0.19.8, deriving-aeson >= 0.2.9, aeson, text, time, unordered-containers, yaml, parsec >= 3.1.18.0 + build-depends: base >=4.17.2.1, mustache >=2.4.2, pandoc >=3.2.1, shake >= 0.19.8, deriving-aeson >= 0.2.9, aeson, text, time, unordered-containers, yaml, parsec >= 3.1.18.0, typst >= 0.6.1, typst-symbols >= 0.1.7 -- Directories containing source files. hs-source-dirs: app