Skip to content
Permalink
Browse files

Updating documentation

  • Loading branch information...
Depado committed May 21, 2018
1 parent 13ee328 commit 19748a086abf215a52d6a3e53d457ab8c57f8fa0
Showing with 36 additions and 3 deletions.
  1. +34 −2 README.md
  2. +2 −1 main.go
@@ -1,9 +1,41 @@
# chromarkdown
# Chromarkdown

![Go Version](https://img.shields.io/badge/Go%20Version-latest-brightgreen.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/Depado/chromarkdown)](https://goreportcard.com/report/github.com/Depado/chromarkdown)
[![Build Status](https://drone.depado.eu/api/badges/Depado/chromarkdown/status.svg)](https://drone.depado.eu/Depado/chromarkdown)
[![codecov](https://codecov.io/gh/Depado/chromarkdown/branch/master/graph/badge.svg)](https://codecov.io/gh/Depado/chromarkdown)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Depado/chromarkdown/blob/master/LICENSE)
[![Godoc](https://godoc.org/github.com/Depado/chromarkdown?status.svg)](https://godoc.org/github.com/Depado/chromarkdown)
[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/Depado)
[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/Depado)

Build single-file static HTML page with Chroma (syntax highlighting) and Markdown

## Introduction

Chromarkdown is a tool to generate single-file static HTML pages from a
Markdown file input. This tool has no external dependecies and performs the
following operations:

- Syntax highlighting thanks to [chroma](https://github.com/alecthomas/chroma)
- Markdown rendering using [blackfriday](https://github.com/russross/blackfriday)
- Embedded [Roboto](https://fonts.google.com/specimen/Roboto) and
[Roboto-mono](https://fonts.google.com/specimen/Roboto+Mono) fonts
- Dynamic CSS for Syntax Highlighter according to the chosen theme
- Single-file (one HTML file) output with embedded styles and fonts (no network
call)
- Responsive page with simple design according to
[bettermotherfuckingwebsite](http://bettermotherfuckingwebsite.com/)

## Build

For a standalone installation, chromarkdown is using [packr](https://github.com/gobuffalo/packr)
to embed the template in the go binary.

```sh
$ go get -u github.com/gobuffalo/packr/...
$ packr build
$ # or, to embed and install:
$ packr install
```

## Install
@@ -33,7 +33,7 @@ func render(input []byte) []byte {
r := bfchroma.NewRenderer(
bfchroma.WithoutAutodetect(),
bfchroma.Extend(bf.NewHTMLRenderer(bf.HTMLRendererParameters{Flags: flags})),
bfchroma.Style("monokai"),
bfchroma.Style(viper.GetString("theme")),
bfchroma.ChromaOptions(html.WithClasses()),
)
if GlobCSS == "" && r.Formatter.Classes {
@@ -89,6 +89,7 @@ It generates standalone HTML files that includes fonts, a grid system and extra
func init() {
rootCmd.PersistentFlags().StringP("output", "o", "out.html", "specify the path of the output HTML")
rootCmd.PersistentFlags().StringP("title", "t", "Ouput", "Specify the title of the HTML page")
rootCmd.PersistentFlags().String("theme", "monokai", "Specify the theme for syntax highlighting")
if err := viper.BindPFlags(rootCmd.PersistentFlags()); err != nil {
logrus.WithError(err).Fatal("Couldn't bind flags")
}

0 comments on commit 19748a0

Please sign in to comment.
You can’t perform that action at this time.