SuperUserNameMan / TMarqueur

TMarqueur is an alternative lightweight markup language for creating formatted text using a plain-text editor.
https://www.terminajones.com/TMarqueur/
Other
0 stars 0 forks source link
asciidoc javascript markdown markup-language php8

TMarqueur

What is TMarqueur ?

TMarqueur is a lightweight yet rich markup language inspired by Markdown and ASCIIdoc and etc.

You can use them to add formating elements to your raw-text documents.

These raw-text documents remain relatively easy and clear to read, and they can be converted to HTML to be displayed in a web browser or in a viewer application.

What does it looks like ?

You can try real-time javascript demo here : https://www.terminajones.com/TMarqueur/

Why TMarqueur ?

Markdown is great, but I never understood why * and _ do the same thing, and why doubling them do something different once converted to HTML ...

Surrounding text using _underscores_ looks like underlining it, so why should it be interpreted as _italic_ and __bold__ ?

The idea that led to TMarqueur is that the basic formating elements should mean what they look like to mean.

For instance : __underscore__ should mean underlined.

From there, I extended the formating elements as much as I could to make it as rich as possible.

How does it differ from Markdown ?

See full documentation here : https://www.terminajones.com/TMarqueur/

What TMarqueur stands for ?

Marqueur is the french spelling of marker.

How to use ?

Javascript :

<link rel="stylesheet" href="https://github.com/SuperUserNameMan/TMarqueur/blob/main/TMarqueur.css">

<script src="https://github.com/SuperUserNameMan/TMarqueur/raw/main/TMarqueur.js"></script>
<script src="https://github.com/SuperUserNameMan/TMarqueur/raw/main/TMarqueur.tables.js"></script>

<script>
function preview() 
{
    var src = document.getElementById('tmarqueur').value  ;
    var dst = TMarqueur.to_html( src );
    document.getElementById('preview').innerHTML = dst ;
}
window.onload = preview ;
</script>

<textarea id="tmarqueur" onkeyup="preview();"></textarea>
<div id="preview"></div>

PHP 8.1

<?php
require_once("TMarqueur.php");
require_once("TMarqueur.tables.php");

$source = file_get_contents( 'doc.tmq' );

$html = \TMarqueur\to_html( $source );