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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: Markdown - tag and target blocks of content

1 点作者 andersnolsen超过 11 年前
I&#x27;m working on a project where I could use some input.<p>I&#x27;m building a tool where a text editor and group chat plays the leading characters. I use Markdown in both instead of WYSIWYG.<p>My requirements for choice of markup language was:<p>- easy to read and write<p>- converts easily to clean HTML, ePub, PDF and other formats<p>- content blocks can be tagged with one or more tags<p>- content blocks can be targeted to one or more user&#x2F;role<p>- allow simple data (key value pairs, lists)<p>TAGGING<p>With the risk of provoking a heart-attack on Markdown purists I present my first implementation of syntax for tagging:<p><i>#tag Header</i><p>Readability is an issue with more than one tag but I can live with only one tag per level of heading.<p>TAGGING EXAMPLE<p>The would allow us to write:<p><i>#chapter At the riviera</i><p><i>...</i><p><i>##scene On the beach</i><p><i>...</i><p><i>##scene The Ice Cream parlour</i><p><i>...</i><p>Which would help to render text differently depending on tagging - use tags as classes when parsed to HTML.<p>TARGETING<p>I use a simple and well known syntax at the start of a line:<p><i>@username ...</i><p><i>...</i><p><i>...</i><p>Is not very loud but allows a parser to understand that content on a certain level and below is targeted to a restricted audience.<p>An alternative way I&#x27;ve been pondering is expanding the {} syntax used for IDs in Kramdown and PHP Markdown Extra.<p><i>{@role,@role2}</i><p><i>{.tag,.tag2} or just {tag,tag2}</i><p>Targeting content will allow soft access control as well as being able to write Markdown in group chat and route parts of the text to different users&#x2F;sub-groups<p>DATA IN MARKDOWN<p>I&#x27;m hoping to solve data with the<p><i>: data</i><p>Or maybe do some mixin with YAML?

暂无评论

暂无评论