#dev 2024-01-28
2024-01-28 UTC
gRegor, gRegorLove_, tPoltergeist, [KevinMarks], angelo, bterry, [tantek] and geoffo joined the channel
# tPoltergeist ello, I'm writing a bare-bones web-server/content api in Go.. I write my content in Markdown and need to find a way to parse it to HTML.. has anyone found a simple no-nonsence library for this or is it viable to write your own implementation?
# tPoltergeist ~ I briefly tried gomarkdown/markdown, but found it a little confusing with it's tree structure..
geoffo joined the channel
# colinbate Unless you really want to dive into it, writing your own is probably not worth it. I’ve seen goldmark mentioned a few times recently. https://github.com/yuin/goldmark
# superkuh Do you really want to write Markdown? HTML is fine.
[Caleb_Hearth] joined the channel
# [Caleb_Hearth] Fit this crowd? Microformats must be up there
# [Caleb_Hearth] ↩️ For*
# tPoltergeist thanks! I use markdown for most of my other (non-web related) content writing, so symmetry there would be nice. It can be easy to inject html directly into md content which is nice if I need richer markup (like microformats). My editor is set up to make the md editing experience really nice. It's also a little more portable than html I feel..
# tPoltergeist [tantek] what is meant by "auto-linked/embedded" plain text? Just .txt files of content? How does Slack fit in there? forgive my nievety
geoffo and colinbate joined the channel
# colinbate I think he is referring to having plain text with basic processing to link URLs and possibly provide some additional functionality based on those URLs (embedding YouTube videos, etc.). Presumably making white space a bit more sane as well.
sebbu, colinbate and gxt joined the channel
# colinbate Which works for notes, but for my normal use case which often involves bullet lists and code blocks, you can't beat being able to do that `easily`.
# colinbate Yes, and that is Markdown
# colinbate Sure, but you can use an extension for Markdown to tweak that if it is your preference
# colinbate I agree, which is why when I see implementations of almost but not quite Markdown, I'm a bit disappointed. As for who thought a single asterisk as italic was a good idea, I guess John Gruber did :)
# colinbate I guess either way, if you want full Markdown, or something almost Markdown, it looks like `goldmark` should get you there.
# colinbate Yea, two spaces for a <br>
# colinbate Unfortunately that is just considered as a single collapsed whitespace node
# colinbate I wrote my own parser for plain text blog post formatting back in like 2001 and it treated all line breaks as hard breaks and supported basic lists but I was always finding edge cases and additional things to support, which is fine if that is something you want to take on
# colinbate But when Markdown emerged, it was like, yea, that's what I wanted (more or less)
# tPoltergeist wow, thanks for all the great info! I didn't clarify the project I'm working on will only be used by me, so the semantics of markdown don't matter bc I'm the only user and am comfortable with md. The majority of content will just be plain text which won't need any special parsing to html, so I may try writing a small library to convert my most used md syntax elements to html.. at worst it'll be a learning experience