Skip to content

wmartinmimi/md.html

Repository files navigation

md.html

Images

Convert markdown to html on the fly, client-based js pre-styled markdown viewer.

Simple and easy to deploy.

Quick deploy

md.html pratically have a zero-config deploy!

In your server root:

curl https://raw.githubusercontent.com/wmartinmimi/md.html/main/md.html -o index.html

And you can now view .md files in your server!

More information on usage can be found here

Updating

The md.html should dynamically fetch the latest required code, meaning that usually no manual intervention is required. However, the file md.html itself would not automatically update itself and therefore requires manual intervention. Warning to update the md.html file will be displayed in the console starting from v2.6. (Error 1)

To update the md.html file, see Quick Deploy and follow the normal download procedure.

If you want to disable automatic update, after downloading, modifiy the following line in flags section.

from:

let auto_update = true;

to:

let auto_update = false;

Style

Similar to Github, with slight differences here and there.

md.html also already do latex rendering and syntax highlighting for you.

Extra feature

  • Dynamic title based on 1st h1 heading
  • Custom save function to save as markdown or styled html for offline viewing
  • Correct 404 error by displaying the 404.html
  • No need for modified internal links, relative/path.md and /absolute/path.md works
  • Latex equations rendering

Error Codes

Error 1

Update of md.html file required. See Quick deploy to download the latest version.

Examples

See this README.md rendered on https://wmartinmimi.github.io/mdhtml/md.html?path=/mdhtml/README.md

Headings

Inline styles such as bold, italic, both, strikethrough, monospace.

Block quotes, including

nested block quotes.

Fenced code blocks
Indented code blocks
# highlighted code block
def lineequ():
  y = kx + c

lineequ()
<!--supports multiple languages-->
<p class="lovely">helloworld</p>
/* A wide range of different languages */

import std.stdio;

void main() {
    writeln("Hello, D!");
}

Latex:

$$c = \pm\sqrt{a^2 + b^2}$$

  1. Numbered lists
  2. Another entry in my numbered list.
  • Unordered lists

    • Nested entry
  • task

  • more task

Tables Tables Tables
Cell 1 Cell 2 Cell 3
Cell 4 Cell 5 Cell 6
Cell 7 Cell 8 Cell 9

Outside Links

absolute link

relative link

bare url: https://example.com

Images:

Images

Image in links:

Images


Issues

Issues and pull requests are always welcome!

You can submit issues the following ways:

Contributions

You are welcomed to create pull requests and add/fix features reasonably. :>

Credits