GithubHelp home page GithubHelp logo

kqr / braceml Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 88 KB

[DONE] A simple markup language that is better than Markdown. Only very rudimentary current implementation, but I will not improve it further since I have discovered the Org format which is everything this wanted to be except so, so, so much more

Java 98.16% Makefile 1.84%

braceml's Introduction

BraceML

A convenient markup language for simple articles. No, I don't think markdown is quite good enough.

Todo

  • Should it be unixy and read from stdin and barf rendered to stdout? Or work on file paths?
  • Comments!
  • Tests!
  • Blogs

Concepts that aren't supported yet

  • Images: trivial (suggested syntax: {! inline alt-text | url !} )
  • sup and sub (are these really necessary?)

Possibilities

This way of dealing with writing blog posts opens up a lot of possibilities that were previously unaccessible to me. Here are some:

  • Anchors on every heading
  • Table of contents
  • Hovering over a footnote reveals it without a click?

Specification

The basic syntax is meant to be something along these lines. This sketch has some bugs. To see how it actually works, reading the code gives you accurate results.

DOCUMENT     ::= BLOCK DOCUMENT | e
     "A document is a sequence of block elements"

BLOCK        ::= BLOCKTAG | PARAGRAPH
     "If the block does not start with a block tag, it must be a paragraph"


BLOCKTAG     ::= H | HH | HHH | ULI | OLI | CODEBLOCK | QUOTE | IMG
     "A block tag is one of these things (H = heading, ULI = UL + LI)"

H            ::= {. INLINE .}
HH           ::= {.. INLINE ..}
HHH          ::= {... INLINE ...}
ULI          ::= {- DOCUMENT -}
OLI          ::= {# DOCUMENT #}
CODEBLOCK    ::= {{ NEWLINE VERBATIM }}
QUOTE        ::= {" DOCUMENT "}
HR           ::= {_ INLINE _}
IMG          ::= {! VERBATIM | HREF !}


PARAGRAPH    ::= INLINE PARAEND
PARAEND      ::= \n PARAEND | BLOCKTAG | e

      "A paragraph contains inline content and ends with either a
       number of newlines greater than 1, or a blocktag, or the end
       of the document."


INLINE       ::= NEWLINE LINE | LINE
      "Inline content is either a single newline followed by a line,
       or just the line by itself."

LINE         ::= TEXT INLINE | e
      "A line is text followed by more inline content."

TEXT         ::= INLINETAG | REGULAR
      "Text is either an inline tag or regular text."


INLINETAG    ::= EMPH | STRONG | ABBR | DFN | CODE | FOOTNOTE | HREF

EMPH         ::= {/ INLINE /}
STRONG       ::= {** INLINE **}
ABBR         ::= {[ INLINE ]}
DFN          ::= {= INLINE =}
CODE         ::= {{ VERBATIM }}
FOOTNOTE     ::= {^ DOCUMENT ^}
HREF         ::= {@ INLINE | URL @}

REGULAR      ::= anything
VERBATIM     ::= anything other than }}
URL          ::= anything other than @}

Example

I'll put an example here while I wait for a better place to put it.

This is mostly meant for my own memory, and not public consumption.

{. BraceML .}

A convenient markup language {^ like {[ html ]} ^} for simple articles.

Includes more than one paragraph! {^ We can even handle multiple
paragraphs in these footnotes!

Are you not impressed? ^}


{.. Todo ..}

{# Fix stuff

    {# Start by doing the thing #}

    {# Then try the other thing #} #}

{# This will take two paragraphs.

   In no particular order you should

    {- Something else -}

    {- Yet more things -} #}


The {{ inline code }} should be easy to put in.

{{
Also applies to code blocks!

Which, importantly, must have nice html generated for them.
}}

If you want to quote {@ someone
| http://en.wikipedia.org/wiki/Weasel_words @} and the "quote is too
large" to do inline, you can always resort to

{"
Block quoting them across the page!!
"}

You may want to {= insert =} (tricky terminology gets <dfn>-ed!) images:

{! Images should have an alt text | image.jpg !}

At this point, {/ you /} may think I'm {** crazy **} but that's just
different degrees of emphasis.

braceml's People

Contributors

kqr avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.