-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
16,266 additions
and
521 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
target/ | ||
node_modules/ | ||
site-gen/ | ||
.idea | ||
site/.docusaurus/ | ||
diagram.png | ||
slides/ | ||
.vscode | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,41 +121,16 @@ lazy val demoJS = demo.js | |
) | ||
|
||
val site = project.in(file("site-gen")) | ||
.enablePlugins( | ||
BuildInfoPlugin, | ||
GitBookPlugin, | ||
GhpagesPlugin, | ||
MdocPlugin, | ||
SitePreviewPlugin | ||
) | ||
.enablePlugins(MdocPlugin, DocusaurusPlugin) | ||
.dependsOn(demoJVM) | ||
.settings(commonSettings) | ||
.settings( | ||
name := "reftree-site", | ||
moduleName := "reftree-site", | ||
(publish / skip) := true, | ||
mdoc := (Compile / run).evaluated, | ||
(Compile / mainClass) := Some("reftree.Docs"), | ||
(Compile / resources) ++= { | ||
List((ThisBuild / baseDirectory).value / "docs") | ||
}, | ||
makeSite / mappings ++= Seq( | ||
file("images/teaser.gif") -> "images/teaser.gif", | ||
file("images/queue.gif") -> "images/queue.gif", | ||
file("images/finger.gif") -> "images/finger.gif", | ||
file("images/tree+zipper.gif") -> "images/tree+zipper.gif", | ||
(( demoJS / crossTarget).value / "demo-opt.js") -> "js/demo.js" | ||
mdocVariables := Map( | ||
"VERSION" -> version.value | ||
), | ||
SiteScaladocPlugin.scaladocSettings( { val Jvm = config("jvm"); Jvm }, coreJVM / (Compile / packageDoc / mappings), "api/jvm"), | ||
SiteScaladocPlugin.scaladocSettings( { val Js = config("js"); Js }, coreJS / (Compile / packageDoc / mappings), "api/js"), | ||
// NameFilter := """.*\.(md|json|css|html)""".r, | ||
GitBook / gitbookInstallDir := Some(baseDirectory.value / "node_modules" / "gitbook"), | ||
GitBook / sourceDirectory := mdocOut.value, | ||
makeSite := makeSite.dependsOn(mdoc.toTask("")).dependsOn(demoJS / ( Compile / fullOptJS)).value, | ||
ghpagesNoJekyll := true, | ||
git.remoteRepo := "[email protected]:stanch/reftree.git", | ||
buildInfoKeys := Seq[BuildInfoKey](version), | ||
buildInfoPackage := "reftree.build" | ||
(publish / skip) := true | ||
) | ||
|
||
lazy val root = project.in(file(".")) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
sidebar_position: 2 | ||
--- | ||
|
||
# Getting started | ||
|
||
To use this library you will need to have [GraphViz](http://www.graphviz.org/) installed (and have `dot` on your `PATH`). | ||
I also recommend to install the [Source Code Pro](https://github.com/adobe-fonts/source-code-pro) fonts (regular and *italic*), | ||
as I find they look the best among the free options and therefore are used by default. | ||
|
||
For viewing PNG and animated GIF on Linux I recommend `eog` and `gifview` respectively. | ||
|
||
## Interactive usage | ||
|
||
To jump into an interactive session: | ||
|
||
``` | ||
$ git clone https://github.com/stanch/reftree | ||
$ cd reftree | ||
$ sbt demo | ||
@ render(List(1, 2, 3)) | ||
// display diagram.png with your favorite image viewer | ||
``` | ||
|
||
## Including in your project | ||
|
||
You can depend on the library by adding these lines to your `build.sbt`: | ||
|
||
```scala | ||
// JVM | ||
libraryDependencies += "io.github.stanch" %% "reftree" % "@VERSION@" | ||
|
||
// Scala.js | ||
libraryDependencies += "io.github.stanch" %%% "reftree" % "@VERSION@" | ||
``` | ||
|
||
## Minimal example | ||
|
||
```scala mdoc:invisible | ||
val ImagePath = "site-gen/target/mdoc/images" | ||
``` | ||
|
||
```scala mdoc:silent | ||
import reftree.render.{Renderer, RenderingOptions} | ||
import reftree.diagram.Diagram | ||
import java.nio.file.Paths | ||
|
||
val renderer = Renderer( | ||
renderingOptions = RenderingOptions(density = 100), | ||
directory = Paths.get(ImagePath, "overview") | ||
) | ||
import renderer._ | ||
|
||
case class Person(firstName: String, age: Int) | ||
|
||
Diagram.sourceCodeCaption(Person("Bob", 42)).render("example") | ||
``` | ||
|
||
![bob](images/overview/example.png) | ||
|
||
For more details, please refer to the [guide](Guide.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.