MarkupLang

From Esolang
Jump to navigation Jump to search

MarkupLang is made by Mihai Popa.

Overview

MarkupLang is a simple markup language.

It's designed to be as simple as possible, while still having a lot of features.

Syntax is somewhat similar to AsciiDoc and Markdown.

Syntax

Basic Formatting

Bold

To make some text bold, use 2 pluses at both ends, like this:

++Bolded text!++

Rendered as:

Bolded text!

Italic

To italicize some text, use 2 slashes at both ends, like this:

//Italicized text!//

Rendered as:

Italicized text!

Underline

To underline some text, use 2 underscores at both ends, like this:

__Underlined text!__

Rendered as:

Underlined text!

Strike-through

To cross out some text, use 2 minuses or tildes at both ends, like this:

--Mario Kart 11!-- ~~Oops, this is wrong!~~ Mario Kart 8!

Rendered as:

Mario Kart 11! Oops, this is wrong! Mario Kart 8!

Subscript and superscript

To put some text in superscript, use a star at both ends, like this:

*Superscript text! Text that is higher than normally done*

Rendered as:

Superscript text! Text that is higher than normally done

But to put some text in subscript, use a underscore instead, like this:

_Subscript text! Text that is lower than normally done_

Rendered as:

Subscript text! Text that is lower than normally done

Inline code

To put inline code in your text, put a backtick at both ends, like this:

To print "Hello, world!" in Python, use this: `print("Hello, world!")`

Rendered as:

To print "Hello, world!" in Python, use this: print("Hello, world!")

Standard Formatting

Code Blocks

To make a code block, wrap the second and last lines in 4 tildes. If you want syntax highlighting, put the language after the first set of tildes, like this:

To print "Hello, world!" in Batch, use this piece of code:
~~~~dos
@echo off
echo Hello, world!
pause >nul
~~~~

Rendered as (without syntax highlighting):

To print "Hello, world!" in Batch, use this piece of code:

@echo off
echo Hello, world!
pause >nul

Links

To make a link, put the URL, then wrap the link text in backticks, like this:

Wow, this link is so nice.

Don't click on the link below! Why?
It's a Rickroll!
Here you go! https://www.youtube.com/watch?v=dQw4w9WgXcQ`Rickroll`

Rendered as:

Wow, this link is so nice.


Don't click on the link below! Why?

It's a Rickroll!

Here you go! Rickroll

Multimedia

To put a image, put a colon, then "image", "photo" or "picture", then a colon, then the URL, then wrap the alt text in backticks, if you want, put a pipe, then the resolution by a number and "p" in the backticks, like this:

Here's a image: :image:https://esolangs.org/w/images/0/0c/PIX_logo.png`PIX's official logo|120p`

Rendered as:

Here's a image: PIX's official logo

Videos and audios are similarly defined, "audio", "music" or "sound" for audio files and "video" or "movie" for video files.

Headers

To make headers, put from 1 to 6 dollar signs then the text, like this:

$ Level 1 Header
$$ Level 2 Header
$$$ Level 3 Header
$$$$ Level 4 Header
$$$$$ Level 5 Header
$$$$$$ Level 6 Header

Blockquotes

To make blockquotes, put a double quote or a greater-than sign then the text, like this:

" Why? Of course, you can //format// and ++enhance++ your quotes!
" 
> Markdown!

Rendered as:

Why? Of course, you can format and enhance your quotes!

Markdown!

More of this adjusts the nesting level.

" Oh wow, you're so nice!
"" Bla bla bla...
""" Another one.
""" 
>>> Even another one.
>> Wow!
> Bye bye!

Rendered as:

Oh wow, you're so nice!

Bla bla bla...

Another one.

Even another one.

Wow!

Bye bye!

Advanced Syntax

Paragraphs

To make a paragraph, put a blank line to separate one or more lines of text, like this:

Hello and welcome back to this video!
We show how to learn MarkupLang, a markup language.

And another paragraph goes here.
Put a paragraph in between those paragraphs.

Rendered as:

Hello and welcome back to this video!

We show how to learn MarkupLang, a markup language.


And another paragraph goes here.

Put a paragraph in between those paragraphs.

Lists

To make a unordered list, use a star, a plus or a minus sign, then the text, like this:

* Eggs
* Flour
* Cool thing

Rendered as:

  • Eggs
  • Flour
  • Cool thing

But to make a ordered list, use a number and a dot or a hash sign, then the text, like this:

1. First thing
2. Second thing
3. Third thing

Rendered as:

  1. First thing
  2. Second thing
  3. Third thing

You can even nest lists by putting 2 spaces before the first sign for each nesting level:

1. First thing
2. Second thing
  1. Nested thing
    * I got you
    * This is example
  2. Second list
3. Third thing
4. Other thing

Tables

To make a table, make the header with a pipe for each column, including at start and end. Then still a pipe for each column, but all are composed of tildes for the text. Put the text in the cells. If you want, at the top, put a line with 2 brackets at start and end and write the caption text (this is optional), like this:

[ My First Table that good  ]
| Hello,      | world!      |
|~~~~~~~~~~~~~|~~~~~~~~~~~~~|
| My first    | Bad Thing   |
| That is     | Trash!      |
| How to do   | This Table? |

Rendered as:

My First Table that good
Hello, world!
My first Bad Thing
That is Trash!
How to do This Table?

More Syntax

I will post more syntax examples in MarkupLang/More Syntax but later.

Extra Options

Syntax Highlighting Languages

This is still a work in progress. It may be changed in the future.
Syntax Highlighting Languages
Use this To get syntax highlighting in
x86, asm, assembly or x86asm x86 Assembly
ada Ada
bas or basic BASIC
bat, batch, dos, win or windows Batch
sh, bash or unix Bash
c C
c++ or cpp C++
c# or cs C#
d D
f# or fs F#
go or golang Go
htm or html HTML
java Java
js or javascript JavaScript
json JSON
julia Julia
kotlin Kotlin
lua Lua
pl or perl Perl
php PHP
py or python Python
r R
pl6, perl6 or raku Raku
rb or ruby Ruby
scala Scala
swift Swift
xml XML