Code Monkey home page Code Monkey logo

fake-format-ml's Introduction

fake-format-ml

Markdown dialect tailored towards prose, and occasional custom markup

Why?

Basically because I spotted Markdown on Stack Overflow too late (i.e. after creating the crappy PHP version of this thing). I decided to keep it.

Basic principles

  • It will have (now so familiar) human-readable markup, somewhat based on old school plain text messaging conventions
  • It can mostly represent arbitrary HTML markup. (the main limitation is that it usually generates <p> tags around text).
  • One single markup language: doesn’t rely on inline HTML.
  • No implicit URLs, URLs are usually enclosed in angle brackets (moderately old school types remember this from e-mail headers).
  • Allow user hooks, for the occasional application-specific markup.

Abstract

A basic example will look very familiar:

List:
 - item
 - item with **bold text**
     
> Quote

To handle the random markup (and images) there are 3 extra constructs:

Span: Text can be grouped into a span with square brackets

This is [text in a span].

Tag: uses curly brackets and XML syntax with a few extensions borrowed from CSS. A tag can decorate a line level or block level construct, or can occur by itself. A few examples:

Boring XML: {class="emoticon" src="http://www.example.org/smile.png"}

Alternative syntax: {.emoticon <http://www.example.org/smile.png>}

{.fancy-p}
On a block element.

{.fancy-em} _On a line level element_.

If the element type cannot be inferred from the construct it is attached to, it will be a semantically empty tag. Unless it has a src property, then it will become an image.

URL: is inside angle brackets. Can exist by itself, or turn a preceding element into a link. That order was borrowed from e-mail conventions.

This is [text in a link] <http://www.example.org>.

This is a link with the URL itself as text: <http://www.example.org>. The fact that the
period is not part of the URL is easy to understand.

fake-format-ml's People

Contributors

roelandschoukens avatar

Watchers

 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.