Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hello! #1

Closed
molleweide opened this issue Jan 9, 2022 · 10 comments
Closed

Hello! #1

molleweide opened this issue Jan 9, 2022 · 10 comments

Comments

@molleweide
Copy link

Hi, I just wanted to say hi!

I am learning haskell and neorg and was very pleased and happy to see that you had alread begun working on a parser.
I am a newbie when it comes to pandoc but it I am excited to try to read through your project and if I can maybe help out.
It depends on how hard this is :P

@molleweide
Copy link
Author

may I ask, does every format supported under pandoc require a parser writen in haskell?

@Simre1
Copy link
Owner

Simre1 commented Jan 12, 2022

Happy to hear that you are trying to help out! I will try to put more effort into documenting things to make things easier for you.
Currently I am approaching my university final exams, so I do not have much time for this project at the moment. Still, I will try to be more active on GitHub so I can answer questions more quickly next time!

may I ask, does every format supported under pandoc require a parser writen in haskell?

Not necessarily. Pandoc has an internal representation for documents (https://hackage.haskell.org/package/pandoc-types-1.22.1/docs/Text-Pandoc-Definition.html), which is a big Haskell datatype. Making the parser in haskell makes it easier to transform the document into the internal pandoc representation since you can use the pandoc data types directly.
I would also imagine that if your parser is written in haskell, then it is easier to be officially integrated into the pandoc library.

@Simre1 Simre1 closed this as completed Jan 12, 2022
@molleweide
Copy link
Author

Thanks for the detailed reply. I browsed through the source and it is way beyond my competence in haskell but I will try to build it and see if I can use it. I am using a repository called pandoc_resume for my cv. I will try to add a neorg doc to it and see if I can build and use this parser to manage my cv in neorg format.

@molleweide
Copy link
Author

molleweide commented Jan 17, 2022

I built and tested on a macbook air m1 with macOS 11.5 and all tests passed.

This was part of the output when building fyi:

Completed    attoparsec-0.14.3 (lib)
Completed    strict-0.4.0.1 (lib)
Installing   vector-0.12.3.1 (lib)
Completed    vector-0.12.3.1 (lib)
Starting     indexed-traversable-instances-0.1.1 (lib)
Configuring library for neorg-0.1.0.0..
Building     indexed-traversable-instances-0.1.1 (lib)
Preprocessing library for neorg-0.1.0.0..
Building library for neorg-0.1.0.0..
[ 1 of 12] Compiling Control.Monad.GetPut ( src/Control/Monad/GetPut.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser
/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/build/Control/Monad/GetPut.o, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-
haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/build/Control/Monad/GetPut.dyn_o )
[ 2 of 12] Compiling Neorg            ( src/Neorg.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/buil
d/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/build/Neorg.o, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build
/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/build/Neorg.dyn_o )
[ 3 of 12] Compiling Type.Forall      ( src/Type/Forall.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyl
e/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/build/Type/Forall.o, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-ne
wstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/build/Type/Forall.dyn_o )
[ 4 of 12] Compiling Type.Set         ( src/Type/Set.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/b
uild/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/build/Type/Set.o, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle
/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/build/Type/Set.dyn_o )

src/Type/Set.hs:113:9: warning: [-Wunticked-promoted-constructors]
    Unticked promoted constructor: ‘Empty’.
    Use ‘'Empty’ instead of ‘Empty’.
    |
113 |   Merge Empty big   = big
    |         ^^^^^

src/Type/Set.hs:114:15: warning: [-Wunticked-promoted-constructors]
    Unticked promoted constructor: ‘Empty’.
    Use ‘'Empty’ instead of ‘Empty’.
    |
114 |   Merge small Empty = small
    |               ^^^^^

src/Type/Set.hs:121:12: warning: [-Wunticked-promoted-constructors]
    Unticked promoted constructor: ‘Empty’.
    Use ‘'Empty’ instead of ‘Empty’.
    |
121 |   Remove t Empty = Empty
    |            ^^^^^

src/Type/Set.hs:121:20: warning: [-Wunticked-promoted-constructors]
    Unticked promoted constructor: ‘Empty’.
    Use ‘'Empty’ instead of ‘Empty’.
    |
121 |   Remove t Empty = Empty
    |                    ^^^^^

src/Type/Set.hs:130:22: warning: [-Wunticked-promoted-constructors]
    Unticked promoted constructor: ‘Empty’.
    Use ‘'Empty’ instead of ‘Empty’.
    |
130 |   RemoveImpl 'EQ t a Empty rbst = rbst
    |                      ^^^^^

src/Type/Set.hs:131:27: warning: [-Wunticked-promoted-constructors]
    Unticked promoted constructor: ‘Empty’.
    Use ‘'Empty’ instead of ‘Empty’.
    |
131 |   RemoveImpl 'EQ t a lbst Empty = lbst
    |                           ^^^^^

src/Type/Set.hs:172:18: warning: [-Wunticked-promoted-constructors]
    Unticked promoted constructor: ‘Empty’.
    Use ‘'Empty’ instead of ‘Empty’.
    |
172 |   FromList '[] = Empty
    |                  ^^^^^
[ 5 of 12] Compiling Neorg.Document   ( src/Neorg/Document.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-news
tyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/build/Neorg/Document.o, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/d
ist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/build/Neorg/Document.dyn_o )
Installing   indexed-traversable-instances-0.1.1 (lib)
Completed    indexed-traversable-instances-0.1.1 (lib)
Starting     witherable-0.4.2 (lib)
Starting     semialign-1.2.0.1 (lib)
Building     witherable-0.4.2 (lib)
Building     semialign-1.2.0.1 (lib)
[ 6 of 12] Compiling Neorg.Parser.Utils ( src/Neorg/Parser/Utils.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dis
t-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/build/Neorg/Parser/Utils.o, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskel
l-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/build/Neorg/Parser/Utils.dyn_o )
[ 7 of 12] Compiling Neorg.Parser.Types ( src/Neorg/Parser/Types.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dis
t-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/build/Neorg/Parser/Types.o, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskel
l-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/build/Neorg/Parser/Types.dyn_o )
[ 8 of 12] Compiling Neorg.Parser.Paragraph ( src/Neorg/Parser/Paragraph.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-pa
rser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/build/Neorg/Parser/Paragraph.o, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/
neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/build/Neorg/Parser/Paragraph.dyn_o )

src/Neorg/Parser/Paragraph.hs:125:28: warning: [-Wname-shadowing]
    This binding for ‘c’ shadows the existing binding
      bound at src/Neorg/Parser/Paragraph.hs:120:22
    |
125 |             withNextChar (\c -> P.choice [attachedOpenings c, word c])
    |                            ^

src/Neorg/Parser/Paragraph.hs:245:5: warning: [-Wunused-local-binds]
    Defined but not used: ‘link’
    |
245 |     link = \case
    |     ^^^^

src/Neorg/Parser/Paragraph.hs:247:9: warning: [-Wunused-matches]
    Defined but not used: ‘target’
    |
247 |         target <- linkTarget
    |         ^^^^^^

src/Neorg/Parser/Paragraph.hs:248:9: warning: [-Wunused-matches]
    Defined but not used: ‘text’
    |
248 |         text <- linkText
    |         ^^^^
[ 9 of 12] Compiling Neorg.Parser.Tags ( src/Neorg/Parser/Tags.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-
newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/build/Neorg/Parser/Tags.o, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-p
arser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/build/Neorg/Parser/Tags.dyn_o )

src/Neorg/Parser/Tags.hs:18:1: warning: [-Worphans]
    Orphan instance: instance ParseTagContent "code"
    To avoid this
        move the instance declaration to the module of the class or of the type, or
        wrap the type with a newtype and declare the instance on the new type.
   |
18 | instance ParseTagContent "code" where
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

src/Neorg/Parser/Tags.hs:19:21: warning: [-Wunused-matches]
    Defined but not used: ‘args’
   |
19 |   parseTagContent _ args = P.takeWhileP (Just "Code block") (const True)
   |                     ^^^^

src/Neorg/Parser/Tags.hs:21:1: warning: [-Worphans]
    Orphan instance: instance ParseTagContent "math"
    To avoid this
        move the instance declaration to the module of the class or of the type, or
        wrap the type with a newtype and declare the instance on the new type.
   |
21 | instance ParseTagContent "math" where
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

src/Neorg/Parser/Tags.hs:22:21: warning: [-Wunused-matches]
    Defined but not used: ‘args’
   |
22 |   parseTagContent _ args = P.takeWhileP (Just "Math block") (const True)
   |                     ^^^^

src/Neorg/Parser/Tags.hs:24:1: warning: [-Worphans]
    Orphan instance: instance ParseTagContent "comment"
    To avoid this
        move the instance declaration to the module of the class or of the type, or
        wrap the type with a newtype and declare the instance on the new type.
   |
24 | instance ParseTagContent "comment" where
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

src/Neorg/Parser/Tags.hs:25:21: warning: [-Wunused-matches]
    Defined but not used: ‘args’
   |
25 |   parseTagContent _ args = P.takeWhileP (Just "Comment block") (const True)
   |                     ^^^^

src/Neorg/Parser/Tags.hs:27:1: warning: [-Worphans]
    Orphan instance: instance ParseTagContent "embed"
    To avoid this
        move the instance declaration to the module of the class or of the type, or
        wrap the type with a newtype and declare the instance on the new type.
   |
27 | instance ParseTagContent "embed" where
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

src/Neorg/Parser/Tags.hs:32:1: warning: [-Worphans]
    Orphan instance: instance ParseTagContent "document.meta"
    To avoid this
        move the instance declaration to the module of the class or of the type, or
        wrap the type with a newtype and declare the instance on the new type.
   |
32 | instance ParseTagContent "document.meta" where
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

src/Neorg/Parser/Tags.hs:47:9: warning: [-Wunused-do-bind]
    A do-notation statement discarded a result of type ‘Char’
    Suppress this warning by saying ‘_ <- P.char ':'|
47 |         P.char ':'
   |         ^^^^^^^^^^

src/Neorg/Parser/Tags.hs:54:1: warning: [-Worphans]
    Orphan instance: instance ParseTagContent "table"
    To avoid this
        move the instance declaration to the module of the class or of the type, or
        wrap the type with a newtype and declare the instance on the new type.
   |
54 | instance ParseTagContent "table" where
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
[10 of 12] Compiling Neorg.Document.Tag ( src/Neorg/Document/Tag.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dis
t-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/build/Neorg/Document/Tag.o, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskel
l-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/build/Neorg/Document/Tag.dyn_o )
[11 of 12] Compiling Neorg.Parser.Block ( src/Neorg/Parser/Block.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dis
t-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/build/Neorg/Parser/Block.o, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskel
l-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/build/Neorg/Parser/Block.dyn_o )

src/Neorg/Parser/Block.hs:5:1: warning: [-Wunused-imports]
    The import of ‘empty’
    from module ‘Control.Applicative’ is redundant
  |
5 | import Control.Applicative (Alternative (many, (<|>)), empty)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Neorg/Parser/Block.hs:15:1: warning: [-Wunused-imports]
    The import of ‘Debug.Trace’ is redundant
      except perhaps to import instances from ‘Debug.Trace’
    To import instances alone, use: import Debug.Trace()
   |
15 | import Debug.Trace
   | ^^^^^^^^^^^^^^^^^^
[12 of 12] Compiling Neorg.Parser.Main ( src/Neorg/Parser/Main.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-
newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/build/Neorg/Parser/Main.o, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-p
arser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/build/Neorg/Parser/Main.dyn_o )
Installing   semialign-1.2.0.1 (lib)
Installing   witherable-0.4.2 (lib)
Completed    semialign-1.2.0.1 (lib)
Completed    witherable-0.4.2 (lib)
Starting     aeson-2.0.2.0 (lib)
Building     aeson-2.0.2.0 (lib)
Installing   aeson-2.0.2.0 (lib)
Completed    aeson-2.0.2.0 (lib)
Starting     pandoc-types-1.22.1 (lib)
Building     pandoc-types-1.22.1 (lib)
Installing   pandoc-types-1.22.1 (lib)
Completed    pandoc-types-1.22.1 (lib)
Configuring executable 'neorg-pandoc' for neorg-0.1.0.0..
Preprocessing executable 'neorg-pandoc' for neorg-0.1.0.0..
Building executable 'neorg-pandoc' for neorg-0.1.0.0..
[1 of 1] Compiling Main             ( pandoc/Main.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/buil
d/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/x/neorg-pandoc/build/neorg-pandoc/neorg-pandoc-tmp/Main.o )

pandoc/Main.hs:9:1: warning: [-Wunused-imports]
    The import of ‘Text’ from module ‘Data.Text’ is redundant
  |
9 | import Data.Text (Text, pack)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

pandoc/Main.hs:14:1: warning: [-Wunused-imports]
    The import of ‘Neorg.Parser.Block’ is redundant
      except perhaps to import instances from ‘Neorg.Parser.Block’
    To import instances alone, use: import Neorg.Parser.Block()
   |
14 | import Neorg.Parser.Block (definition)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

pandoc/Main.hs:16:1: warning: [-Wunused-imports]
    The import of ‘<&>’ from module ‘Optics.Core’ is redundant
   |
16 | import Optics.Core ((<&>), (^.))
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

pandoc/Main.hs:19:1: warning: [-Wunused-imports]
    The qualified import of ‘Text.Pandoc.Definition’ is redundant
      except perhaps to import instances from ‘Text.Pandoc.Definition’
    To import instances alone, use: import Text.Pandoc.Definition()
   |
19 | import qualified Text.Pandoc.Definition as P
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

pandoc/Main.hs:39:35: warning: [-Wname-shadowing]
    This binding for ‘blocks’ shadows the existing binding
      imported from ‘Neorg.Parser.Main’ at pandoc/Main.hs:15:1-24
      (and originally defined in ‘Neorg.Parser.Block’)
   |
39 | convertDocument handler (Document blocks) = runConvert $ P.doc . V.foldMap id <$> traverse (convertBlock handler) blocks
   |                                   ^^^^^^

pandoc/Main.hs:43:11: warning: [-Wname-shadowing]
    This binding for ‘heading’ shadows the existing binding
      imported from ‘Neorg.Parser.Main’ at pandoc/Main.hs:15:1-24
      (and originally defined in ‘Neorg.Parser.Block’)
   |
43 |   Heading heading -> convertHeading handler heading
   |           ^^^^^^^

pandoc/Main.hs:45:10: warning: [-Wname-shadowing]
    This binding for ‘marker’ shadows the existing binding
      imported from ‘Neorg.Parser.Main’ at pandoc/Main.hs:15:1-24
      (and originally defined in ‘Neorg.Parser.Block’)
   |
45 |   Marker marker -> convertMarker marker
   |          ^^^^^^

pandoc/Main.hs:47:14: warning: [-Wname-shadowing]
    This binding for ‘definition’ shadows the existing binding
      imported from ‘Neorg.Parser.Main’ at pandoc/Main.hs:15:1-24
      (and originally defined in ‘Neorg.Parser.Block’)
   |
47 |   Definition definition -> convertDefinition handler definition
   |              ^^^^^^^^^^

pandoc/Main.hs:51:7: warning: [-Wname-shadowing]
    This binding for ‘tag’ shadows the existing binding
      imported from ‘Neorg.Parser.Main’ at pandoc/Main.hs:15:1-24
      (and originally defined in ‘Neorg.Parser.Block’)
   |
51 |   Tag tag -> handleSomeTag handler tag
   |       ^^^

pandoc/Main.hs:53:9: warning: [-Wname-shadowing]
    This binding for ‘quote’ shadows the existing binding
      imported from ‘Neorg.Parser.Main’ at pandoc/Main.hs:15:1-24
      (and originally defined in ‘Neorg.Parser.Block’)
   |
53 |   Quote quote -> convertQuote quote
   |         ^^^^^

pandoc/Main.hs:73:30: warning: [-Wunused-matches]
    Defined but not used: ‘taskStatus’
   |
73 |     let convertTaskListBlock taskStatus lb = convertPureBlock handler lb
   |                              ^^^^^^^^^^

pandoc/Main.hs:79:14: warning: [-Wname-shadowing]
    This binding for ‘quote’ shadows the existing binding
      imported from ‘Neorg.Parser.Main’ at pandoc/Main.hs:15:1-24
      (and originally defined in ‘Neorg.Parser.Block’)
   |
79 | convertQuote quote = P.blockQuote . P.para <$> convertInline (quote ^. quoteContent)
   |              ^^^^^

pandoc/Main.hs:82:16: warning: [-Wunused-matches]
    Defined but not used: ‘handler’
   |
82 | convertHeading handler heading = do
   |                ^^^^^^^

pandoc/Main.hs:82:24: warning: [-Wname-shadowing]
    This binding for ‘heading’ shadows the existing binding
      imported from ‘Neorg.Parser.Main’ at pandoc/Main.hs:15:1-24
      (and originally defined in ‘Neorg.Parser.Block’)
   |
82 | convertHeading handler heading = do
   |                        ^^^^^^^

pandoc/Main.hs:87:27: warning: [-Wname-shadowing]
    This binding for ‘definition’ shadows the existing binding
      imported from ‘Neorg.Parser.Main’ at pandoc/Main.hs:15:1-24
      (and originally defined in ‘Neorg.Parser.Block’)
   |
87 | convertDefinition handler definition = do
   |                           ^^^^^^^^^^

pandoc/Main.hs:98:17: warning: [-Wincomplete-patterns]
    Pattern match(es) are non-exhaustive
    In a case alternative: Patterns not matched: Link (AnchorCons _)
   |
╭─     neorg-haskell-parser     main    
╰

question: When building with cabal build neorg-pandoc, should I expect there to be a binary under dist-newstyle, because if so I cannot find it.
I shall try the generate_binary.sh command, but from a quick look it doesn't seem to be compat with macos? We'll see :P

@molleweide
Copy link
Author

molleweide commented Jan 17, 2022

running generate_binary.sh on macos outputs the following. it turns out the generate command did not work straight off the bat.

?? ./generate_binary.sh
Build profile: -w ghc-8.10.7 -O2
In order, the following will be built (use -v for more details):
    - neorg-0.1.0.0 (lib) (first run)
- neorg-0.1.0.0 (exe:neorg-pandoc) (first run)
    Configuring library for neorg-0.1.0.0..
    Preprocessing library for neorg-0.1.0.0..
    Building library for neorg-0.1.0.0..
    [ 1 of 12] Compiling Control.Monad.GetPut ( src/Control/Monad/GetPut.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/opt/build/Control/Monad/GetPut.o, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/opt/build/Control/Monad/GetPut.dyn_o )
    [ 2 of 12] Compiling Neorg            ( src/Neorg.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/opt/build/Neorg.o, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/opt/build/Neorg.dyn_o )
    [ 3 of 12] Compiling Type.Forall      ( src/Type/Forall.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/opt/build/Type/Forall.o, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/opt/build/Type/Forall.dyn_o )
[ 4 of 12] Compiling Type.Set         ( src/Type/Set.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/opt/build/Type/Set.o, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/opt/build/Type/Set.dyn_o )

    src/Type/Set.hs:113:9: warning: [-Wunticked-promoted-constructors]
    Unticked promoted constructor: ÔEmptyÕ.
    Use Ô'EmptyÕ instead of ÔEmptyÕ.
    |
    113 |   Merge Empty big   = big
    |         ^^^^^

    src/Type/Set.hs:114:15: warning: [-Wunticked-promoted-constructors]
    Unticked promoted constructor: ÔEmptyÕ.
    Use Ô'EmptyÕ instead of ÔEmptyÕ.
    |
    114 |   Merge small Empty = small
    |               ^^^^^

    src/Type/Set.hs:121:12: warning: [-Wunticked-promoted-constructors]
    Unticked promoted constructor: ÔEmptyÕ.
    Use Ô'EmptyÕ instead of ÔEmptyÕ.
    |
    121 |   Remove t Empty = Empty
    |            ^^^^^

    src/Type/Set.hs:121:20: warning: [-Wunticked-promoted-constructors]
    Unticked promoted constructor: ÔEmptyÕ.
    Use Ô'EmptyÕ instead of ÔEmptyÕ.
    |
    121 |   Remove t Empty = Empty
    |                    ^^^^^

    src/Type/Set.hs:130:22: warning: [-Wunticked-promoted-constructors]
    Unticked promoted constructor: ÔEmptyÕ.
    Use Ô'EmptyÕ instead of ÔEmptyÕ.
    |
    130 |   RemoveImpl 'EQ t a Empty rbst = rbst
    |                      ^^^^^

    src/Type/Set.hs:131:27: warning: [-Wunticked-promoted-constructors]
    Unticked promoted constructor: ÔEmptyÕ.
    Use Ô'EmptyÕ instead of ÔEmptyÕ.
    |
    131 |   RemoveImpl 'EQ t a lbst Empty = lbst
    |                           ^^^^^

    src/Type/Set.hs:172:18: warning: [-Wunticked-promoted-constructors]
    Unticked promoted constructor: ÔEmptyÕ.
    Use Ô'EmptyÕ instead of ÔEmptyÕ.
    |
    172 |   FromList '[] = Empty
    |                  ^^^^^
    [ 5 of 12] Compiling Neorg.Document   ( src/Neorg/Document.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/opt/build/Neorg/Document.o, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/opt/build/Neorg/Document.dyn_o )
    [ 6 of 12] Compiling Neorg.Parser.Utils ( src/Neorg/Parser/Utils.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/opt/build/Neorg/Parser/Utils.o, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/opt/build/Neorg/Parser/Utils.dyn_o )
    [ 7 of 12] Compiling Neorg.Parser.Types ( src/Neorg/Parser/Types.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/opt/build/Neorg/Parser/Types.o, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/opt/build/Neorg/Parser/Types.dyn_o )
[ 8 of 12] Compiling Neorg.Parser.Paragraph ( src/Neorg/Parser/Paragraph.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/opt/build/Neorg/Parser/Paragraph.o, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/opt/build/Neorg/Parser/Paragraph.dyn_o )

    src/Neorg/Parser/Paragraph.hs:125:28: warning: [-Wname-shadowing]
    This binding for ÔcÕ shadows the existing binding
    bound at src/Neorg/Parser/Paragraph.hs:120:22
    |
125 |             withNextChar (\c -> P.choice [attachedOpenings c, word c])
    |                            ^

    src/Neorg/Parser/Paragraph.hs:245:5: warning: [-Wunused-local-binds]
    Defined but not used: ÔlinkÕ
    |
    245 |     link = \case
    |     ^^^^

    src/Neorg/Parser/Paragraph.hs:247:9: warning: [-Wunused-matches]
    Defined but not used: ÔtargetÕ
    |
    247 |         target <- linkTarget
    |         ^^^^^^

    src/Neorg/Parser/Paragraph.hs:248:9: warning: [-Wunused-matches]
    Defined but not used: ÔtextÕ
    |
    248 |         text <- linkText
    |         ^^^^
[ 9 of 12] Compiling Neorg.Parser.Tags ( src/Neorg/Parser/Tags.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/opt/build/Neorg/Parser/Tags.o, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/opt/build/Neorg/Parser/Tags.dyn_o )

    src/Neorg/Parser/Tags.hs:18:1: warning: [-Worphans]
    Orphan instance: instance ParseTagContent "code"
    To avoid this
    move the instance declaration to the module of the class or of the type, or
    wrap the type with a newtype and declare the instance on the new type.
    |
    18 | instance ParseTagContent "code" where
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

    src/Neorg/Parser/Tags.hs:19:21: warning: [-Wunused-matches]
    Defined but not used: ÔargsÕ
    |
    19 |   parseTagContent _ args = P.takeWhileP (Just "Code block") (const True)
    |                     ^^^^

    src/Neorg/Parser/Tags.hs:21:1: warning: [-Worphans]
    Orphan instance: instance ParseTagContent "math"
    To avoid this
    move the instance declaration to the module of the class or of the type, or
    wrap the type with a newtype and declare the instance on the new type.
    |
    21 | instance ParseTagContent "math" where
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

    src/Neorg/Parser/Tags.hs:22:21: warning: [-Wunused-matches]
    Defined but not used: ÔargsÕ
    |
    22 |   parseTagContent _ args = P.takeWhileP (Just "Math block") (const True)
    |                     ^^^^

    src/Neorg/Parser/Tags.hs:24:1: warning: [-Worphans]
    Orphan instance: instance ParseTagContent "comment"
    To avoid this
    move the instance declaration to the module of the class or of the type, or
    wrap the type with a newtype and declare the instance on the new type.
    |
    24 | instance ParseTagContent "comment" where
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

    src/Neorg/Parser/Tags.hs:25:21: warning: [-Wunused-matches]
    Defined but not used: ÔargsÕ
    |
    25 |   parseTagContent _ args = P.takeWhileP (Just "Comment block") (const True)
    |                     ^^^^

    src/Neorg/Parser/Tags.hs:27:1: warning: [-Worphans]
    Orphan instance: instance ParseTagContent "embed"
    To avoid this
    move the instance declaration to the module of the class or of the type, or
    wrap the type with a newtype and declare the instance on the new type.
    |
    27 | instance ParseTagContent "embed" where
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

    src/Neorg/Parser/Tags.hs:32:1: warning: [-Worphans]
    Orphan instance: instance ParseTagContent "document.meta"
    To avoid this
    move the instance declaration to the module of the class or of the type, or
    wrap the type with a newtype and declare the instance on the new type.
    |
    32 | instance ParseTagContent "document.meta" where
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

    src/Neorg/Parser/Tags.hs:47:9: warning: [-Wunused-do-bind]
    A do-notation statement discarded a result of type ÔCharÕ
    Suppress this warning by saying Ô_ <- P.char ':'Õ
    |
    47 |         P.char ':'
    |         ^^^^^^^^^^

    src/Neorg/Parser/Tags.hs:54:1: warning: [-Worphans]
    Orphan instance: instance ParseTagContent "table"
    To avoid this
    move the instance declaration to the module of the class or of the type, or
    wrap the type with a newtype and declare the instance on the new type.
    |
    54 | instance ParseTagContent "table" where
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
    [10 of 12] Compiling Neorg.Document.Tag ( src/Neorg/Document/Tag.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/opt/build/Neorg/Document/Tag.o, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/opt/build/Neorg/Document/Tag.dyn_o )
[11 of 12] Compiling Neorg.Parser.Block ( src/Neorg/Parser/Block.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/opt/build/Neorg/Parser/Block.o, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/opt/build/Neorg/Parser/Block.dyn_o )

    src/Neorg/Parser/Block.hs:5:1: warning: [-Wunused-imports]
    The import of ÔemptyÕ
    from module ÔControl.ApplicativeÕ is redundant
    |
5 | import Control.Applicative (Alternative (many, (<|>)), empty)
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    src/Neorg/Parser/Block.hs:15:1: warning: [-Wunused-imports]
    The import of ÔDebug.TraceÕ is redundant
    except perhaps to import instances from ÔDebug.TraceÕ
    To import instances alone, use: import Debug.Trace()
    |
    15 | import Debug.Trace
    | ^^^^^^^^^^^^^^^^^^
[12 of 12] Compiling Neorg.Parser.Main ( src/Neorg/Parser/Main.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/opt/build/Neorg/Parser/Main.o, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/opt/build/Neorg/Parser/Main.dyn_o )
    Configuring executable 'neorg-pandoc' for neorg-0.1.0.0..
    Preprocessing executable 'neorg-pandoc' for neorg-0.1.0.0..
    Building executable 'neorg-pandoc' for neorg-0.1.0.0..
[1 of 1] Compiling Main             ( pandoc/Main.hs, /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/x/neorg-pandoc/opt/build/neorg-pandoc/neorg-pandoc-tmp/Main.o )

    pandoc/Main.hs:9:1: warning: [-Wunused-imports]
    The import of ÔTextÕ from module ÔData.TextÕ is redundant
    |
9 | import Data.Text (Text, pack)
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    pandoc/Main.hs:14:1: warning: [-Wunused-imports]
    The import of ÔNeorg.Parser.BlockÕ is redundant
    except perhaps to import instances from ÔNeorg.Parser.BlockÕ
    To import instances alone, use: import Neorg.Parser.Block()
    |
14 | import Neorg.Parser.Block (definition)
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    pandoc/Main.hs:16:1: warning: [-Wunused-imports]
    The import of Ô<&>Õ from module ÔOptics.CoreÕ is redundant
    |
16 | import Optics.Core ((<&>), (^.))
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    pandoc/Main.hs:19:1: warning: [-Wunused-imports]
    The qualified import of ÔText.Pandoc.DefinitionÕ is redundant
    except perhaps to import instances from ÔText.Pandoc.DefinitionÕ
    To import instances alone, use: import Text.Pandoc.Definition()
    |
    19 | import qualified Text.Pandoc.Definition as P
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    pandoc/Main.hs:39:35: warning: [-Wname-shadowing]
    This binding for ÔblocksÕ shadows the existing binding
    imported from ÔNeorg.Parser.MainÕ at pandoc/Main.hs:15:1-24
(and originally defined in ÔNeorg.Parser.BlockÕ)
    |
    39 | convertDocument handler (Document blocks) = runConvert $ P.doc . V.foldMap id <$> traverse (convertBlock handler) blocks
    |                                   ^^^^^^

    pandoc/Main.hs:43:11: warning: [-Wname-shadowing]
    This binding for ÔheadingÕ shadows the existing binding
    imported from ÔNeorg.Parser.MainÕ at pandoc/Main.hs:15:1-24
(and originally defined in ÔNeorg.Parser.BlockÕ)
    |
    43 |   Heading heading -> convertHeading handler heading
    |           ^^^^^^^

    pandoc/Main.hs:45:10: warning: [-Wname-shadowing]
    This binding for ÔmarkerÕ shadows the existing binding
    imported from ÔNeorg.Parser.MainÕ at pandoc/Main.hs:15:1-24
(and originally defined in ÔNeorg.Parser.BlockÕ)
    |
    45 |   Marker marker -> convertMarker marker
    |          ^^^^^^

    pandoc/Main.hs:47:14: warning: [-Wname-shadowing]
    This binding for ÔdefinitionÕ shadows the existing binding
    imported from ÔNeorg.Parser.MainÕ at pandoc/Main.hs:15:1-24
(and originally defined in ÔNeorg.Parser.BlockÕ)
    |
    47 |   Definition definition -> convertDefinition handler definition
    |              ^^^^^^^^^^

    pandoc/Main.hs:51:7: warning: [-Wname-shadowing]
    This binding for ÔtagÕ shadows the existing binding
    imported from ÔNeorg.Parser.MainÕ at pandoc/Main.hs:15:1-24
(and originally defined in ÔNeorg.Parser.BlockÕ)
    |
    51 |   Tag tag -> handleSomeTag handler tag
    |       ^^^

    pandoc/Main.hs:53:9: warning: [-Wname-shadowing]
    This binding for ÔquoteÕ shadows the existing binding
    imported from ÔNeorg.Parser.MainÕ at pandoc/Main.hs:15:1-24
(and originally defined in ÔNeorg.Parser.BlockÕ)
    |
    53 |   Quote quote -> convertQuote quote
    |         ^^^^^

    pandoc/Main.hs:73:30: warning: [-Wunused-matches]
    Defined but not used: ÔtaskStatusÕ
    |
    73 |     let convertTaskListBlock taskStatus lb = convertPureBlock handler lb
    |                              ^^^^^^^^^^

    pandoc/Main.hs:79:14: warning: [-Wname-shadowing]
    This binding for ÔquoteÕ shadows the existing binding
    imported from ÔNeorg.Parser.MainÕ at pandoc/Main.hs:15:1-24
(and originally defined in ÔNeorg.Parser.BlockÕ)
    |
79 | convertQuote quote = P.blockQuote . P.para <$> convertInline (quote ^. quoteContent)
    |              ^^^^^

    pandoc/Main.hs:82:16: warning: [-Wunused-matches]
    Defined but not used: ÔhandlerÕ
    |
    82 | convertHeading handler heading = do
    |                ^^^^^^^

    pandoc/Main.hs:82:24: warning: [-Wname-shadowing]
    This binding for ÔheadingÕ shadows the existing binding
    imported from ÔNeorg.Parser.MainÕ at pandoc/Main.hs:15:1-24
(and originally defined in ÔNeorg.Parser.BlockÕ)
    |
    82 | convertHeading handler heading = do
    |                        ^^^^^^^

    pandoc/Main.hs:87:27: warning: [-Wname-shadowing]
    This binding for ÔdefinitionÕ shadows the existing binding
    imported from ÔNeorg.Parser.MainÕ at pandoc/Main.hs:15:1-24
(and originally defined in ÔNeorg.Parser.BlockÕ)
    |
    87 | convertDefinition handler definition = do
    |                           ^^^^^^^^^^

    pandoc/Main.hs:98:17: warning: [-Wincomplete-patterns]
    Pattern match(es) are non-exhaustive
    In a case alternative: Patterns not matched: Link (AnchorCons _)
    |
    98 | convertInline = \case
    |                 ^^^^^...

    pandoc/Main.hs:108:18: warning: [-Wunused-matches]
    Defined but not used: ÔtargetÕ
    |
    108 |   Link (LinkCons target inlines maybeId) -> applicativeConcatMap convertInline inlines -- TODO: Investigate title field
    |                  ^^^^^^

    pandoc/Main.hs:108:33: warning: [-Wunused-matches]
    Defined but not used: ÔmaybeIdÕ
    |
    108 |   Link (LinkCons target inlines maybeId) -> applicativeConcatMap convertInline inlines -- TODO: Investigate title field
    |                                 ^^^^^^^

    pandoc/Main.hs:120:41: warning: [-Wunused-matches]
    Defined but not used: ÔtextÕ
    |
    120 |     comment = handleTag @"comment" $ \_ text -> pure mempty
    |                                         ^^^^
    Linking /Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/x/neorg-pandoc/opt/build/neorg-pandoc/neorg-pandoc ...
    cp: dist-newstyle/build/x86_64-linux/ghc-8.10.7/neorg-0.1.0.0/x/neorg-pandoc/build/neorg-pandoc/neorg-pandoc: No such file or directory

    ```

    </details>

@Simre1
Copy link
Owner

Simre1 commented Jan 17, 2022

cabal build neorg-pandoc produces a binary. For me, it is here:
...project-folder/dist-newstyle/build/x86_64-linux/ghc-8.10.7/neorg-0.1.0.0/x/neorg-pandoc/build/neorg-pandoc/neorg-pandoc
I think it should be in a similar place on macos, but I do not know for certain.

@molleweide
Copy link
Author

sorry, I believe I found it at

/Users/hjalmarjakobsson/code/repos/github.com/Simre1/neorg-haskell-parser/dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/x/neorg-pandoc/build/neorg-pandoc/neorg-pandoc

@molleweide
Copy link
Author

molleweide commented Jan 17, 2022

update

if I run

./dist-newstyle/build/x86_64-osx/ghc-8.10.7/neorg-0.1.0.0/x/neorg-pandoc/build/neorg-pandoc/neorg-pandoc testing/test.norg | pandoc -f json -o testing/out.pdf

it returns

pandoc: pdflatex: createProcess: posix_spawnp: illegal operation (Inappropriate ioctl for device)

I found an issue documenting this message: jgm/pandoc#7570

and it is because I don't have pdflatex installed or something along those lines.

I will investigate this and submit a pr with basic macos support.

@Simre1
Copy link
Owner

Simre1 commented Jan 17, 2022

That seems to be pandoc issue.
jgm/pandoc#7570

@molleweide
Copy link
Author

molleweide commented Jan 17, 2022

That seems to be pandoc issue. jgm/pandoc#7570

Yes exactly!! So I probably won't have to add much - maybe just a simple if darwin use osx path test script.

After having installed mactex with brew it is not found in my path so there is probably just some path shenanigans.

But it is super cool it was building successfully on mac!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants