Skip to content

Commit

Permalink
Merge pull request #87 from olafurpg/livereload
Browse files Browse the repository at this point in the history
Start LiveReload server under --watch
  • Loading branch information
olafurpg authored Oct 1, 2018
2 parents 1a1cb4d + c50c334 commit 4ff8780
Show file tree
Hide file tree
Showing 15 changed files with 1,760 additions and 30 deletions.
6 changes: 5 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ lazy val mdoc = project
"com.lihaoyi" %% "fansi" % "0.2.5",
"io.methvin" % "directory-watcher" % "0.8.0",
"me.xdrop" % "fuzzywuzzy" % "1.1.10", // for link hygiene "did you mean?"
"ch.epfl.scala" %% "scalafix-core" % V.scalafix
"ch.epfl.scala" %% "scalafix-core" % V.scalafix,
// live reload
"io.undertow" % "undertow-core" % "2.0.13.Final",
"org.jboss.xnio" % "xnio-nio" % "3.6.5.Final",
"org.slf4j" % "slf4j-nop" % "1.8.0-beta2"
)
)
.dependsOn(runtime)
Expand Down
16 changes: 8 additions & 8 deletions docs/readme.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Mdoc: compiled markdown documentation
# mdoc: compiled markdown documentation

[![Build Status](https://travis-ci.org/olafurpg/mdoc.svg?branch=master)](https://travis-ci.org/olafurpg/mdoc)

Mdoc is a documentation tool for Scala inspired by
mdoc is a documentation tool for Scala inspired by
[tut](http://tpolecat.github.io/tut/). Like tut, mdoc interprets Scala code
examples in markdown files allowing you to compile markdown documentation as
part of your build. Distinguishing features of mdoc include:
Expand Down Expand Up @@ -152,7 +152,7 @@ Consult [`--help`](#--help) to learn more about the command-line interface.

## Modifiers

Mdocs supports several modifiers to control the output of code fences.
mdocs supports several modifiers to control the output of code fences.

### Default

Expand Down Expand Up @@ -283,8 +283,8 @@ new ScastieModifier(theme = "dark") // default is "light"

### Performance

Mdoc is designed to provide a tight edit/render/preview feedback loop while
writing documentation. Mdoc achieves good performance through
mdoc is designed to provide a tight edit/render/preview feedback loop while
writing documentation. mdoc achieves good performance through

- [script semantics](#script-semantics): each markdown file compiles into a
single Scala program that executes in one run.
Expand All @@ -297,7 +297,7 @@ writing documentation. Mdoc achieves good performance through

### Good error messages

Mdoc tries to report helpful error messages when things go wrong. Here below,
mdoc tries to report helpful error messages when things go wrong. Here below,
the program that is supposed to compile successfully but it has a type error so
the build is stopped with an error message from the Scala compiler.

Expand Down Expand Up @@ -346,7 +346,7 @@ unknown link.

### Script semantics

Mdoc interprets code fences as normal Scala programs instead of as if they're
mdoc interprets code fences as normal Scala programs instead of as if they're
evaluated in the REPL. This behavior is different from tut that interprets
statements as if they were typed in a REPL session. Using "script semantics"
instead of "repl semantics" has both benefits and downsides.
Expand Down Expand Up @@ -378,7 +378,7 @@ List(User("John"), User("Susan")).sorted

### Variable injection

Mdoc renders constants like `@VERSION@` in markdown with variables provided at
mdoc renders constants like `@VERSION@` in markdown with variables provided at
runtime. This makes it easy to keep documentation up-to-date as new releases are
published. Variables can be passed from the command-line interface with the
syntax
Expand Down
99 changes: 99 additions & 0 deletions mdoc/src/main/resources/github.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/*
github.com style (c) Vasily Polovnyov <[email protected]>
*/

.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
color: #333;
background: #f8f8f8;
}

.hljs-comment,
.hljs-quote {
color: #998;
font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-subst {
color: #333;
font-weight: bold;
}

.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-tag .hljs-attr {
color: #008080;
}

.hljs-string,
.hljs-doctag {
color: #d14;
}

.hljs-title,
.hljs-section,
.hljs-selector-id {
color: #900;
font-weight: bold;
}

.hljs-subst {
font-weight: normal;
}

.hljs-type,
.hljs-class .hljs-title {
color: #458;
font-weight: bold;
}

.hljs-tag,
.hljs-name,
.hljs-attribute {
color: #000080;
font-weight: normal;
}

.hljs-regexp,
.hljs-link {
color: #009926;
}

.hljs-symbol,
.hljs-bullet {
color: #990073;
}

.hljs-built_in,
.hljs-builtin-name {
color: #0086b3;
}

.hljs-meta {
color: #999;
font-weight: bold;
}

.hljs-deletion {
background: #fdd;
}

.hljs-addition {
background: #dfd;
}

.hljs-emphasis {
font-style: italic;
}

.hljs-strong {
font-weight: bold;
}
2 changes: 2 additions & 0 deletions mdoc/src/main/resources/highlight.js

Large diffs are not rendered by default.

Loading

0 comments on commit 4ff8780

Please sign in to comment.