TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Margin – A lightweight, flexible markup language for structured thought

210 点作者 nobody_nothing大约 5 年前

21 条评论

nobody_nothing大约 5 年前
Hey Show HN!<p>I&#x27;d love some early feedback on Margin, a markup language for hierarchically structured thought.<p>Margin came out of my desire to build a lightweight to-do app – though I soon realized what I <i>really</i> wanted was a markup language to capture structured thought. One that was not only human-readable, but also easily machine parsable.<p>Most importantly, Margin doesn&#x27;t impose strict hierarchical categories (eg. &quot;Header 1&quot;, &quot;Project&quot;, &quot;Task&quot;). Instead it allows the user&#x2F;application to define those categories. The ultimate goal is to democratize your to-do lists, notes, writing, etc. making them portable and platform-independent.<p>Aside from feedback on the specs &amp; philosophy of Margin, which would be very appreciated, I could use some serious help with the parser (<a href="https:&#x2F;&#x2F;margin.love&#x2F;parser&#x2F;" rel="nofollow">https:&#x2F;&#x2F;margin.love&#x2F;parser&#x2F;</a>). I&#x27;m only a casual coder, so this problem was a difficult one for me. The parser is both incomplete and buggy, but hopefully it gets across the basics of how Margin is supposed to work.<p>Thanks!
评论 #23138952 未加载
评论 #23139213 未加载
评论 #23138328 未加载
评论 #23138295 未加载
评论 #23138351 未加载
评论 #23137788 未加载
评论 #23138118 未加载
评论 #23139920 未加载
评论 #23138439 未加载
pgcj_poster大约 5 年前
I&#x27;m very eager to see this project develop. Looking at the examples, here are my thoughts:<p>- It seems like annotations should be excluded from the &quot;value&quot; field. If I write something like &quot;Frankenstein [author:Mary Shelley]&quot;, I&#x27;m probably going to want to access the title &quot;Frankenstein&quot; on its own after parsing.<p>- It would be nice to be able to omit the brackets when there&#x27;s no whitespace inside an annotation. For example, you could write &quot;broccoli type:vegetable&quot; instead of &quot;broccoli [type: vegetable]&quot;<p>- I like that you can use different list decorators, like -, &gt;, or *. But these don&#x27;t show up anywhere except the &quot;raw_data&quot; field—it would be nice if there was a field that contained just the decorator, something like:<p><pre><code> { &quot;raw-data&quot; : &quot;\t- Some Item&quot;, &quot;value&quot; : &quot;Some Item&quot;, &quot;decorator&quot; : &quot;-&quot;, &quot;annotations&quot;: {}, &quot;children&quot;: [] } </code></pre> Then you could easily use different decorators to encode semantic information. For instance, a Pros&#x2F;Cons list could use &#x27;+&#x27; for Pros and &#x27;-&#x27; for Cons, and that distinction would be easy to access programmatically. If you do this, I think &quot;[ ]&quot; and &quot;[x]&quot; should be end up in the decorator field. Or maybe it could be a &quot;prefix&quot; field and &quot;suffix&quot; field, to hold decorators at either the beginning or end?
评论 #23140484 未加载
gorgoiler大约 5 年前
Very enjoyable idea. The <i>ideas first, tidy up later</i> ethos is one with which many other software engineers will agree.<p>I haven’t written any Margin — I’ve only read through you documentation — but maybe this feedback may be useful. (Apologies if you’re already doing all of this, in which case it may be helpful to others at least.)<p>I love the idea of flexibility in how Margin can be used. Because if this though, you will find emergent behavior among your user base. People will do things you could never have imagined and expect Margin not to break their workflow.<p>If you capture these as a standard test suite or set of test cases, it will be very helpful to anyone implementing a Margin parser in another language.<p>You already have a reference parser in JS and if you get to the million user mark (!) you might like to provide it in C instead. Something like libSYCK did for YAML.<p>For now, having a test suite is the next best thing. While Margin is not prescriptive about how you use it, you’ll want Margin <i>parsers</i> to be strictly in agreement in how they interpret Margin, for it to be widely adopted! Then when someone sees Margin, finds it to be a good idea to use in their language of choice, and writes their own parser they can confidently announces “<i>passes 100% of the Margin test suite!</i>”.
评论 #23139004 未加载
Animats大约 5 年前
&quot;An outliner (or outline processor) is a specialized type of text editor (word processor) used to create and edit outlines, which are text files which have a tree structure, for organization.&quot;[1]<p>[1] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Outliner" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Outliner</a>
评论 #23138704 未加载
tathougies大约 5 年前
There should be an internet law that every supposedly new invention can be found pretty much wholesale in GNU emacs
fomojola大约 5 年前
Quite promising: one thing that would probably accelerate adoption would be to provide at least one language parser that can go to&#x2F;from the format to a data structure of some kind.
评论 #23138724 未加载
nihilazo大约 5 年前
As a long time user of vimwiki with an awful lot of hacks and plugins to work for doing something like this, margin seems like the kind of thing I was originally looking for. Vimwiki is great but suffers from having almost no machine readability, which makes integrating it with things like time tracking difficult without large, complex plugins.<p>However, margin doesn&#x27;t really seem to have any equivalent of links between files, which I find essential for organising thoughts in anything beyond small notes. This seems like something that&#x27;s contrary to the philosophy in a sense, but what would be the margin-ish equivalent of something like that, and (following from that) things like file tags? Would those be done with annotations?
评论 #23150006 未加载
pipingdog大约 5 年前
This shows great promise. I&#x27;ve been looking for various ways to impose semantics on markdown for note taking, and they all turn out to be too complex. This is very simple, has goals which are distinct from markdown, and has the potential to build something queryable.
brigandish大约 5 年前
I like this a lot and will think about using it in an app I&#x27;m planning to build, but I have one quibble with something in the docs:<p>&gt; you wouldn’t build a web app in markdown<p>I&#x27;m willing to bet it&#x27;s been done and has already been a Show HN. After all, there&#x27;s &quot;My blog is now generated by Google Docs&quot;[1] currently on the front page of HN. If not then it&#x27;s only a matter of time :)<p>[1] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23134101" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23134101</a>
评论 #23138671 未加载
kortex大约 5 年前
This is excellent! The one thing I really like is the annotations. Been looking for a way to embed k:v attributes in a parseable markdown, for making metadata of codebases and datasets.<p>How are URL&#x27;s handled? One solution would be to just reuse Markdown&#x27;s [link](text) notation, as a subset of annotations. That would be the least-mental-friction route for markdown users.
评论 #23149880 未加载
rcthompson大约 5 年前
You mention that apps can safely ignore annotations of unknown types, but you should probably specify that they are still expected to preserve such annotations even if they don&#x27;t use them for anything, i.e. ignore doesn&#x27;t mean &quot;discard&quot;.
评论 #23150123 未加载
beshrkayali大约 5 年前
Alternately, use Org mode.
solarkraft大约 5 年前
On first look this appears like a great foundation for a new ecosystem of outliners. Awesome!<p>The processing of my 6000 lines Dynalist export (perfectly compatible due to the permissive syntax!) took about 1 second on an i7 from 2015.
cborenstein大约 5 年前
This project looks awesome. I created bytebase.io, a notes app that shares much of the same philosophy - flexible hierarchy, simplicity, user control.<p>We&#x27;ll definitely consider supporting import&#x2F;export to Margin.
评论 #23149951 未加载
michael-ax大约 5 年前
I&#x27;d love to post these notes from my phone to my server, translated into org-mode as they go :)
fernly大约 5 年前
Does it deal in any fashion with longer blocks of text than a single line? Paragraphs under a heading?
评论 #23138658 未加载
auggierose大约 5 年前
For Mac users, I found that these two apps together cover a lot of my needs: Things 3 and Quiver.
ipsum2大约 5 年前
This is awesome! I&#x27;ve had thoughts along these lines, I like your annotation idea. Excited to see how this project grows.
alphachloride大约 5 年前
My understanding is that this is a nested list parser. Nested lists are defined by the indentation level. Metadata for items can be specified by square brackets.<p>I don&#x27;t see how this is different than just opening notepad.exe and writing stuff.
评论 #23150054 未加载
math0ne大约 5 年前
My first thought is I hate tabs.
评论 #23141292 未加载
mirimir大约 5 年前
Is it possible to run locally?
评论 #23140332 未加载