← Back to context

Comment by battery_cowboy

6 years ago

Kinda on-topic (50/50): I'm looking for a flavor of something-like-markdown, but it would have semantic tagging and some abilities to add my own attributes to an element/tag (like for links, I want to be able to specify some to open in another tab, but others to open in the same tab, I'm willing to do that with raw attributes if I can add them on) for conversion to HTML in a static generator, is there something like that anyone knows about? (I prefer not to "roll my own" if I can use a standards-based language)

For instance, I'd want to do the example in the GitHub flavored markdown with tags like <article> or <aside> around markdown-like syntax. Markdown is so easy compared to HTML, so I want that ease in my article-writing workflow.

I was considering using HTML directly in a templating language, but I want it to be a more human-friendly text format, like Markdown.

markdown-it [1] has a number of plugins that let you add extra features to commonmark. For adding attributes, I wrote markdown-it-attrs [2]. Combine that with a flexible static site generator, like metalsmith [3], and you have a solution adjustable to your needs.

1: https://github.com/markdown-it/markdown-it 2: https://github.com/arve0/markdown-it-attrs 3: https://metalsmith.io/

  • I intend to use this setup, modified a bit, it's pretty much just what I was looking for: a very modular static generation tool that still uses a language I can read easily before generation, even if it isn't a 100% standard/stock language.

    I was running into issues where some feature idea I had (ex: a way to expire an article based on some "code", like a function to check if Debian 10 is EOL yet in an article on how to install Debian 10) wouldn't be supported by my static generator, so I wanted to write my own or fork it, but instead I can just write modules for metalsmith or markdown-it for different features I need, it's perfect.

Adding ids to parts of the text and then embedding Turtle in ``` regions would go a long way to making that possible.

  • I'm not sure I know what you mean. Do you have an example?

    • Sure. Here's some Markdown with Turle.

          At 10pm I had a call with [#karl](Karl).
      
          ```turtle
          @prefix p: <http://example.org/person/>
          @prefix r: <http://example.org/relation/>
          @prefix owl: <http://www.w3.org/2002/07/owl#>
          
          p:karl owl:sameAs <#karl> ;
              r:author <http://example.org/books/NestOfTriples>
              r:friend p:pat
          ```