Skip to content

Ask HN: Markdown - tag and target blocks of content

1 pointandersnolsendiscuss
On HN

I'm working on a project where I could use some input.

I'm building a tool where a text editor and group chat plays the leading characters. I use Markdown in both instead of WYSIWYG.

My requirements for choice of markup language was:

- easy to read and write

- converts easily to clean HTML, ePub, PDF and other formats

- content blocks can be tagged with one or more tags

- content blocks can be targeted to one or more user/role

- allow simple data (key value pairs, lists)

TAGGING

With the risk of provoking a heart-attack on Markdown purists I present my first implementation of syntax for tagging:

#tag Header

Readability is an issue with more than one tag but I can live with only one tag per level of heading.

TAGGING EXAMPLE

The would allow us to write:

#chapter At the riviera

...

##scene On the beach

...

##scene The Ice Cream parlour

...

Which would help to render text differently depending on tagging - use tags as classes when parsed to HTML.

TARGETING

I use a simple and well known syntax at the start of a line:

@username ...

...

...

Is not very loud but allows a parser to understand that content on a certain level and below is targeted to a restricted audience.

An alternative way I've been pondering is expanding the {} syntax used for IDs in Kramdown and PHP Markdown Extra.

{@role,@role2}

{.tag,.tag2} or just {tag,tag2}

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/sub-groups

DATA IN MARKDOWN

I'm hoping to solve data with the

: data

Or maybe do some mixin with YAML?

Comments

No comments yet.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.