Skip to content

iizukak/mdsite

Repository files navigation

mdsite

example workflow

mdsite is a command line tool that generates a static site from Markdown files.

demo, repository.

What mdsite do

mdsite converts .md files into .html files in the same directory structure.

For example, if you have these files,

in/index.md
in/foo/bar.md
in/static/image.jpeg
mdsite.yaml # Configulation files

by executing mdsite command, you will get these outputs.

out/index.html
out/foo/bar.html
out/static/image.jpeg
out/mdsite.css

In the current directory, you should have mdsite.yaml configuration file. Please check the example config file.

Installation

mdsite requires Python 3.8 or later and GNU Make.

$ git clone [email protected]:iizukak/mdsite.git
$ cd mdsite
$ make install

Usage

Command

Show help message.

$ mdsite help

Convert .md files into .html files.

$ mdsite

Development

To develop or debug mdsite, You need additional Python libraries.

$ make devinstall

Unit testing.

$ make test

Run the demo site on the local server.

$ make demoserver

Documentation Guide

  • mdsite copies static directory to the output directory.

Syntax highlighting

Syntax highlighting is supported. Use triple ` to write the code.

```python
def hello():
    print("Hello, mdsite")
```

is converted to

def hello():
    print("Hello, mdsite")

MathJax Support

Math equations are supported by python-markdown-math.

Inline equation

Using single $ generate inline equation. For example, $e^x$ is converted to $e^x$ .

Standalone equation

Using double $ generates a standalone equation. For example,

$$
\frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} =
1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}}
{1+\frac{e^{-8\pi}} {1+\ldots} } } }
$$

is converted to

$$ \frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\ldots} } } } $$

FAQ

License

Apache License 2.0