This isn't a competitor to markdown. It is a competitor to JSON. Not sure what brashtag does that JSON does not. I'm not at all convinced that brashtag is simpler than JSON.
> It is a competitor to JSON. Not sure what brashtag does that JSON does not. I'm not at all convinced that brashtag is simpler than JSON.
As you have noticed it is poor substitute for json. It would be cumbersome to write config file in brashtag.
> This isn't a competitor to markdown.
You can write blog post in markdown. You can write it just as elegantly in brashtag. Only brashtag does not convert the doc to html for you. It just gives you tree. You write a program that processes the tree and produces html.
Example,
Markdown:
# Lorem ipsum dolor sit amet
Consectetur _adipiscing_ elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.
---
Brashtag:
#h1{Lorem ipsum dolor sit amet}
Consectetur #u{adipiscing} elit, sed do eiusmod tempor incididunt #b{ut labore et dolore} magna aliqua. Ut enim ad minim veniam.
OR you could write
#really big title{Lorem ipsum dolor sit amet}
Consectetur #super duper underline{adipiscing} elit, sed do eiusmod tempor incididunt #emphsize{ut labore et dolore} magna aliqua. Ut enim ad minim veniam.
Not sure you're aware of this... most markdown engines allow you to also use a very constrained set of HTML tags inline.
e.g.:
```
##
<p style="margin-left=4em;font-family: 'Courier,mono">
Life is death's way of giving what it kills time
to grow in. —w.s. burroughs.
</p>
```
Necessarily, inline HTML tags, attributes and CSS is carefully sanitized by engines that support this. And, unfortunately the extent of sanitization, and actual supported tags vary from engine to engine. But it's there, and it is widely supported, and relatively predictable for basic HTML formatting. And mostly manages to excise ever-evolving ways to inject javascript into standard CSS.
HNs markdown engine doesn't support inline HTML; but Github's markdown engine does.
Can you think a little more about your decision to strongly type code blocks. Some domains have no need for code escaping but do need blob text escaping (which you already have defined elsewhere.) Technically you could treat code via 'this is a bag named code with a blob, therefore it is code."
I wanted to keep the famaliar things. We write code blocks with backticks in markdown and slack and everywhere so I used those. In fact I used $ signs earliar then switched to backticks.
> 'this is a bag named code with a blob, therefore it is code."
This would make #code{} a special bag. Right now no bag is special.
Also it would be hard to find the closing } if somebody wrote unbalanced paren code in the bag like #code{ func main() { }.
You could assume that { and } as a structural delimiter only applies to node types that can nest. Since blobs do not nest, then a tag followed by a backtick (or multiple backticks) could be a valid delimiter in lieu of braces. In this case, tags would extend to blobs.
In my opinion, pairing minimal node types with differing delimiters helps legibility and is not overly mentally taxing to learn when node types are few.
If I understand correctly, you mean something like this.
#foo`fmt.Println("Hello world!")`
instead of current
#foo{`fmt.Println("Hello world!")`}
.
This would mean code can have tags too just like bags.
Right now only bags can have tags and children.
If you want to tag something, you have to put it in a bag. This works for tagging blogs, code, other bags.
I think the extra braces are worth suffering for uniformity like the trailing commas.
I think brashtag is more effective than markdown at killing those things.
Because it stops after making you a tree. Markdown takes your document all the way to html. Making it do anything else requires much work.
file.md -> markdown -> file.html
file.bt -> brashtag -> tree -> to-html -> file.html
file.bt -> brashtag -> tree -> todo-list-maker -> todo list
...
file.bt -> brashtag -> tree -> ... -> ...
Brashtag is not about code at all. Most text is already a valid brashtag. It is optimized for human writing. For example, this comment is a valid brashtag document if you surround it with #{} which can be done by a program easily.
I had multiple frustrating experiences. I kept thinking I could just write things in some format in text and have some programs process it to do different things. So I created it.
See how easy it is to write programs to process brashtag [1].
I can chat with llm, interact with jupyter kernel and do literate
programming from any text editor all in the same document [3].
It took me like 10 minutes to build this mermaid like thing [2].
List of frustrations:
- One day Anki crashed. --- You can just write #card{....} in a text file. Some program would read it and show flashcards in browser.
- Another day JabRef crashed. --- You can just write #bib{....} put link to a paper and its citation info there and have a program download the paper and copy the citation to bib file.
- Markdown parser processed mathjax wrong. Why keep trying different markdown parsers? Just write #h1{}, #b{} #i{} and just convert them to html tags.
- Literate programming tool I was using failed at some corner case.
- My notes were scattered across files and tools. I couldn't find anything.
I tried to have a text file where sections were separated by four dashes. But that didn't allow nesting. Also, the parser I wrote for that hit corner cases. Why not just put #note{} #JIRA-334{} etc. in text file.