<commit_before>
# Lanyon, a markdown web server

Lanyon is a simple web server, which reads directories of markdown files and
converts them to HTML and serves. An intuitive and easy way to create a website. 

Lanyon was derived from my static site generator,
[Hastie](https://github.com/mkaz/hastie). I grew tired of the multiple steps for
creating, generating and publishing. Plus, using a static site generator has a
duplicate source tree and generated tree, with some assets in each. Lanyon
simplifies this with one set of directories with content and assets.

---

## Getting Started

#### Install

Binaries are available in the `binaries` folder for Mac OS X and Linux (amd64).
You can also build a binary from the available Go source code. 

The only dependency for building is the `github.com/russross/blackfriday`
library for markdown parsing. So to build yourself, assuming you have [Golang
installed](http://golang.org/doc/install):

```bash
$ git clone https://github.com/mkaz/lanyon
$ cd lanyon/src
$ go get github.com/russross/blackfriday
$ go build -o lanyon 
```

Once you have the binary built or downloaded, copy it to a directory within your
path, `~/bin/` or `/usr/local/bin/` are two great spots.


#### Run Site

A quick way to see what's going on is to check out the example site. You can run
the example site by running the binary from that directory. Lanyon looks for the
config file `lanyon.json` in the directory it was started in. The config file
tells it where to look for templates and what directory to serve content from.

```bash
$ cd lanyon/example
$ lanyon
>>> Lanyon listening on http://localhost:9999
```

You can now go to that URL and see the demo site running. All markdown files,
files with the extension `.md` are reference on the web server with .html
extension.

For example a call to `/giraffe.html` will first check to see if the html file
exists, if so it will server the file. Otherwise it will check if `giraffe.md`
exists and convert that to HTML.

---

## Configuration

The configuration file is in JSON format, here is an example with all parameters
set:

```json
{
    "PortNum": 9999,
    "TemplateDir": "templates",
    "PublicDir": "public",
    "RedirectDomain": ["www.mkaz.com", "www.mkaz.com"]
}<commit_msg>Fix typo in readme<commit_after>
# Lanyon, a markdown web server

Lanyon is a simple web server, which reads directories of markdown files and
converts them to HTML and serves. An intuitive and easy way to create a website. 

Lanyon was derived from my static site generator,
[Hastie](https://github.com/mkaz/hastie). I grew tired of the multiple steps for
creating, generating and publishing. Plus, using a static site generator has a
duplicate source tree and generated tree, with some assets in each. Lanyon
simplifies this with one set of directories with content and assets.

---

## Getting Started

#### Install

Binaries are available in the `binaries` folder for Mac OS X and Linux (amd64).
You can also build a binary from the available Go source code. 

The only dependency for building is the `github.com/russross/blackfriday`
library for markdown parsing. So to build yourself, assuming you have [Golang
installed](http://golang.org/doc/install):

```bash
$ git clone https://github.com/mkaz/lanyon
$ cd lanyon/src
$ go get github.com/russross/blackfriday
$ go build -o lanyon 
```

Once you have the binary built or downloaded, copy it to a directory within your
path, `~/bin/` or `/usr/local/bin/` are two great spots.


#### Run Site

A quick way to see what's going on is to check out the example site. You can run
the example site by running the binary from that directory. Lanyon looks for the
config file `lanyon.json` in the directory it was started in. The config file
tells it where to look for templates and what directory to serve content from.

```bash
$ cd lanyon/example
$ lanyon
>>> Lanyon listening on http://localhost:9999
```

You can now go to that URL and see the demo site running. All markdown files,
files with the extension `.md` are reference on the web server with .html
extension.

For example a call to `/giraffe.html` will first check to see if the html file
exists, if so it will serve the file. Otherwise it will check if `giraffe.md`
exists and convert that to HTML.

---

## Configuration

The configuration file is in JSON format, here is an example with all parameters
set:

```json
{
    "PortNum": 9999,
    "TemplateDir": "templates",
    "PublicDir": "public",
    "RedirectDomain": ["www.mkaz.com", "www.mkaz.com"]
}
{'fraction_non_alphanumeric': 0.07980599647266313, 'fraction_numerical': 0.004409171075837742, 'mean_word_length': 3.9857142857142858, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1385960', 'n_tokens_mistral': 1346, 'n_tokens_neox': 1262, 'n_words': 667}