YAML lib for Elm?

217 views
Skip to first unread message

fxmy wang

unread,
Jan 16, 2017, 1:00:45 AM1/16/17
to Elm Discuss
Hello guys,
Is there any yaml parser existing for Elm?

Cherrs.

Brian Hicks

unread,
Jan 16, 2017, 9:12:50 PM1/16/17
to Elm Discuss
It doesn't look like there is, unfortunately. What are you trying to accomplish? Maybe there's another way around. :)

fxmy wang

unread,
Jan 17, 2017, 7:44:41 AM1/17/17
to elm-d...@googlegroups.com
Well short story would be: I need to parse some yaml. =)

Long version: I'm using commentit.io for storing comments on my handmade blog (powered by Elm of course). And commentit.io stores comments the jekyll way. Hence in format of yaml like this.

So I need a way to parse and display comments for my blog.

Cheers.

--
You received this message because you are subscribed to a topic in the Google Groups "Elm Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elm-discuss/s8dy6zlQaYM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elm-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Zinggi

unread,
Jan 17, 2017, 9:51:50 AM1/17/17
to Elm Discuss
Probably not the answer you'd like, but there doesn't exist one.
Please do us all a favor and create one yourself ;) (probably with the help of this.)
If that's too much effort, you can use some JS lib and use ports to bring it over to elm.
To unsubscribe from this group and all its topics, send an email to elm-discuss...@googlegroups.com.

Brian Hicks

unread,
Jan 17, 2017, 11:09:54 AM1/17/17
to Elm Discuss
Creating a YAML parser is going to be a ton more work than you bargained for. That spec is hairy! That said, it probably would be the best way.

But there are workarounds! Since you're rendering the YAML in Jekyll anyway, is there a conversion function to JSON you could use? Or, could you add a step in your build process to convert the comments as files to load?

fxmy wang

unread,
Jan 17, 2017, 10:00:37 PM1/17/17
to elm-d...@googlegroups.com
Indeed, latest YAML spec is 84 pages long =(   silent screaming).

And I'm not using Jekyll at all, it's just commentit.io stores comments in Jekyll compatible way.

Thanks for mentioning the Combine package though, will see what I can do =)

Cheers.

To unsubscribe from this group and all its topics, send an email to elm-discuss+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Elm Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elm-discuss/s8dy6zlQaYM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elm-discuss+unsubscribe@googlegroups.com.

Jan Tojnar

unread,
Jan 18, 2017, 4:15:01 AM1/18/17
to Elm Discuss
Indeed, latest YAML spec is 84 pages long =(   silent screaming).
 
Maybe it would be easier to send a pull request adding support for JSON output to commentit.io. It is open source after all.

https://github.com/guilro/commentit

Reply all
Reply to author
Forward
0 new messages