Skip to main content

Extending Markdown further by adding a few more useful notations.

Project description

Marquedown

Extending Markdown further by adding a few more useful notations. It can be used in place of markdown as it also uses and applies it.

Examples

Blockquote with citation

This is currently limited to the top scope with no indentation. Surrounding dotted lines are optional.

Example

Marquedown
......................................................
> You have enemies? Good. That means you've stood up
> for something, sometime in your life.
-- Winston Churchill
''''''''''''''''''''''''''''''''''''''''''''''''''''''
HTML
<blockquote>
    <p>
        You have enemies? Good. That means you've stood up
        for something, sometime in your life.
    </p>
    <cite>Winston Churchill</cite>
</blockquote>

Embed video

YouTube

Marquedown
![dimweb](https://youtu.be/VmAEkV5AYSQ "An embedded YouTube video")
HTML
<iframe
    src="https://www.youtube.com/embed/VmAEkV5AYSQ"
    title="An embedded YouTube video" frameborder="0"
    allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
    allowfullscreen>
</iframe>

BBCode HTML tags

These tags allow you to put Marquedown inside HTML tags. This is done by finding and replacing them with their represented HTML after all other Marquedown has been rendered.

Tags and classes

The naming scheme is the same as in CSS, e.g. tag.class1.class2 If tag is omitted, it is treated to be div

ID:s

ID:s are supported using #beans at the end of the tag, ex. [p#beans]

Example

Marquedown
[section]
[.bingo]
A regular **paragraph** written in Marquedown, but *within* other HTML tags.
[//]

[tag.class1.class2] [/tag]
HTML
<section>
<div class="bingo">
    <p>
        A regular <strong>paragraph</strong> written in Marquedown, but <em>within</em> other HTML tags.
    </p>
</div></section>

<tag class="class1 class2"> </tag>

Label list

Example

Marquedown
(| email: [jon@webby.net](mailto:jon@webby.net)
(| matrix: [@jon:webby.net](https://matrix.to/#/@jon:webby.net)
(| runescape: jonathan_superstar1777
HTML
<ul class="labels">
    <li class="label label-email">
        <a href="mailto:jon@webby.net">
            jon@webby.net
        </a>
    </li>
    <li class="label label-matrix">
        <a href="https://matrix.to/#/@jon:webby.net">
            @jon:webby.net
        </a>
    </li>
    <li class="label label-runescape">
        jonathan_superstar1777
    </li>
</ul>

QR codes

QR codes can be generated and referenced automatically via the render command. If you want to generate QR codes with marquedown.marquedown, you can follow the example below.

Example

Marquedown
![qr:monero-wallet](monero:abcdefghijklmnopqrstuvwxyz)
Python
from marquedown import marquedown

with open('document.mqd', 'r') as f:
    document = f.read()

with open('public/document.html', 'w') as f:
    rendered = marquedown(document, qrgen='public/qr:qr')
    f.write(rendered)

The string provided to qrgen is two paths separated by a colon.

  1. Where to save the generated images
  2. What directory to reference in the HTML src parameter
The generated HTML
<img src="qr/qr-0-monero-wallet.png" alt="monero-wallet">

Commands

render: Render documents

You can render an entire directory and its subdirectories of Markdown or Marquedown documents. This can be used to automate rendering pages for your website.

Do python -m marquedown render --help for list of options.

Example

For a few of my websites hosted on GitLab, I have it set up to run this on push:

# Render document
python -m marquedown render -i "./mqd" -o "./public" -t "./templates/page.html"

# This is for the GitLab Pages publication
mkdir .public
cp -r public .public
mv .public public  

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

marquedown-0.9.0.tar.gz (21.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

marquedown-0.9.0-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file marquedown-0.9.0.tar.gz.

File metadata

  • Download URL: marquedown-0.9.0.tar.gz
  • Upload date:
  • Size: 21.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.10.5 Linux/5.10.133-1-MANJARO

File hashes

Hashes for marquedown-0.9.0.tar.gz
Algorithm Hash digest
SHA256 ef6e012a49f396f0edb0e80537c452d78cf7064a57e31fef67074119dd30175f
MD5 f5797b8ed7f4723539d80b690c375c71
BLAKE2b-256 454a29405f471013f4158109f911b7e1c04d9b0b14f4a677fcfd37fa4e5bb7a3

See more details on using hashes here.

File details

Details for the file marquedown-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: marquedown-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 22.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.10.5 Linux/5.10.133-1-MANJARO

File hashes

Hashes for marquedown-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49a1a744ed26344f7a3a2588e819e569f33b3f4d8da10944ca1062d52496f808
MD5 182000177419722a98f6e99947f8bdd5
BLAKE2b-256 d9e61fc2e5daae12efc648237b0930519552fcb720005e1614c320c25541616a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page