Subatomic

Watch this space, but please don't use it yet
HomeBuildersInternalsScala.js support Search

Builders

Common scenarios (such as LibrarySite and Blog) are provided, which wrap raw APIs.

For example, here's the entire code for building Subatomic's own website as a single Ammonite script:

subatomic-site.sc

import $ivy.`com.indoorvivants::subatomic-builders:0.0.6+14-4431eb4c-SNAPSHOT`

import subatomic.builders.librarysite._
import subatomic.builders._

@main
def main(args: String*) = Docs.main(args)

object Docs extends LibrarySite.App {
  override def extra(site: Site[LibrarySite.Doc]) = {
    site
      .addCopyOf(SiteRoot / "CNAME", os.pwd / "docs" / "assets" / "CNAME")
  }

  def config =
    LibrarySite(
      name = "Subatomic",
      contentRoot = os.pwd / "docs" / "pages" / "internals",
      assetsRoot = Some(os.pwd / "docs" / "assets"),
      copyright = Some("© 2020 Anton Sviridov"),
      githubUrl = Some("https://github.com/indoorvivants/subatomic"),
      highlightJS = HighlightJS.default.copy(
        languages = List("scala"),
        theme = "monokai-sublime"
      )
    )
}

All builders provide some useful CLI flags:

Usage:
    subatomic build
    subatomic search

static site builder

Options and flags:
    --help
        Display this help text.

Subcommands:
    build
        Build the site
    search
        Test the generated search index

And running the script will provide a detailed overview of the static files being created:

$ amm subatomic-site.sc build --disable-mdoc
Creating site in /tmp/8122105690097307631

internals/index.html
    ^--content--> <html><head><title>Subatomic: Internals</title>...
search/index.html
    ^--content--> <html><head><title>Subatomic: Search </title><l...
assets/search-index.js
    ^--copy-of--> /tmp/65804036567470595.tmp
assets/search.js
    ^--copy-of--> /tmp/1955007035686849412.tmp
assets/subatomic-search.css
    ^--content--> div.searchContainer {\n  flex-grow: 2;\n}\n\ndiv.se...
assets/logo.png
    ^--copy-of--> /home/runner/work/subatomic/subatomic/docs/assets/logo.png
assets/test.html
    ^--copy-of--> /home/runner/work/subatomic/subatomic/docs/assets/test.html
assets/script.js
    ^--copy-of--> /home/runner/work/subatomic/subatomic/docs/assets/script.js
assets/template.css
    ^--content--> body {\n  font-size: 19px;\n  color: black;\n  bac...
CNAME
    ^--copy-of--> /home/runner/work/subatomic/subatomic/docs/assets/CNAME
index.html
    ^--content--> <html><head><title>Subatomic: Home</title><link...
    ^--processed-from--> Doc(Home,/home/runner/work/subatomic/subatomic/docs/pages/index.md,false,true...
builders/index.html
    ^--content--> <html><head><title>Subatomic: Builders</title><...
    ^--processed-from--> Doc(Builders,/home/runner/work/subatomic/subatomic/docs/pages/builders/index....
internals/raw/index.html
    ^--content--> <html><head><title>Subatomic: Raw API</title><l...
    ^--processed-from--> Doc(Raw API,/home/runner/work/subatomic/subatomic/docs/pages/internals/raw.md...
internals/classpath/index.html
    ^--content--> <html><head><title>Subatomic: Mdoc and classpat...
    ^--processed-from--> Doc(Mdoc and classpath,/home/runner/work/subatomic/subatomic/docs/pages/inter...
scalajs/index.html
    ^--content--> <html><head><title>Subatomic: Scala.js support ...
    ^--processed-from--> Doc(Scala.js support ,/home/runner/work/subatomic/subatomic/docs/pages/scalaj...