GithubHelp home page GithubHelp logo

chipsenkbeil / grus Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 0.0 87 KB

Static site generator written in Scala using Scalatags for templates and Flexmark for markdown.

Home Page: http://get-grus.io

License: Apache License 2.0

Scala 100.00%
scala static-site-generator scalatags flexmark cms

grus's Introduction

grus

(G)enerate (R)esources (U)sing (S)cala

Static site generator written in Scala using Scalatags for templates and Flexmark for markdown.

Running

Via homebrew

Install via the following:

brew install chipsenkbeil/personal/grus

Then run on the command line via:

grus ...

Via binary

Grab one of the fat jars listed below and run via java -jar DOWNLOADED_JAR.jar.

You can view help information by adding --help to the base jar or any of its commands. E.g. java -jar DOWNLOADED_JAR.jar --help or java -jar DOWNLOADED_JAR.jar generate --help.

Via sbt

To use in sbt (0.13.x) to generate your own content, add the following plugin:

addSbtPlugin("org.senkbeil" %% "sbt-grus" % "0.1.1")
  • sbt grusSkeleton will create a new theme or website outline in the specified output directory
  • sbt grusGenerate will generate the website and put the contents in an output directory
  • sbt grusServe will generate the website and start a server to display it locally
  • sbt grusPublish will publish the contents output from grusGenerate

You can add --help to any of the above commands to display help information for the specific command. E.g. sbt "grusGenerate --help".

Building a Theme

To use the API to create a custom theme, add the following dependency:

libraryDependencies += "org.senkbeil" %% "grus-layouts" % "0.1.1"

Examples

See the Scala Debugger docs module for an example of how to write a custom theme.

See the Scala Debugger grus.toml for an example of how to write a config file to fill in values.

grus's People

Contributors

chipsenkbeil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

grus's Issues

Add ability to compile local theme

In the case of an sbt target directory not existing, grus could try to compile the code via sbt and then check again. Not sure if this is overkill.

Add skeleton generation support

Something along the lines of grus init or grus create to be able to create a new repository with a grus.toml file and basic files to act as a skeleton hello world. Maybe provide a default theme as well.

Support Scala Native Build

Needs investigation, but I'm assuming all dependencies need to be supported by Scala Native.

  • Work needed on project

    • Add Scala Native build support
    • Update code where necessary to exclude or use alternatives where blocked for native
    • Wait for Scala Native to support dynamic libraries so themes can be loaded on the fly
  • Core Dependencies

    • Scalatags (demonstrated https://github.com/lihaoyi/scala-native-example-app)
      • Needed for
    • Scallop (indicated in README experimental support available)
      • Needed for CLI option support
    • Flexmark (Java dependency -- not possible?)
      • Needed to parse Markdown, metadata, etc.
    • Apache Commons IO (Java dependency -- not possible?)
      • Used for nicer file copying via org.apache.commons.io.FileUtils
      • Used for file filtering via org.apache.commons.io.filefilter.*
  • Optional Dependencies

    • Toml4J (Java dependency -- not possible?)
      • This is used for config parsing and isn't a requirement to be supported
    • JGit (Java dependency -- not possible?)
      • This is used for publish support, which isn't a hard requirement, but is a nice to have
    • Coursier (in the works? coursier/coursier#458)
      • This is used to download theme jars from Maven, which isn't a hard requirement, but is a nice to have
    • Unfiltered (Scala dependency -- no support?)
      • This is used to serve content for local testing, which isn't a hard requirement, but is a nice to have
    • Slf4J-log4J (Java dependency -- no support?)
      • This is used purely for Unfiltered
    • Apache Commons Codec (Java dependency -- no support?)
      • This is used for the image resource loader, which is currently unused (dead code!)

Decide on a unique name

Just having site-generator as the name is a bit weak both for searching and when installing a binary. Should figure out a unique name to give the project and refactor accordingly.

Running `publishSite` prints out a warning

When running publishSite on the Scala Debugger project docs, I'm seeing the following warning pop up at the beginning:

17/08/04 21:43:00 [WARN] o.e.j.u.FS - Exception caught during execution of command '[git, config, --system, --edit]' in '/usr/bin', return code '128', error message 'fatal: Could not switch to '/Library/Developer/CommandLineTools/usr/etc/': No such file or directory

This does not appear to be fatal and publishes anyway. This is being run on Mac OS X 10.9.5.

Support themes

Thought is a theme is merely an organization, artifact, and version that would be loaded via the Coursier API. Once the classes for a theme are in the tool, it's just a matter of loading them with the proper class loader like usual.

Scala Debugger project would publish its site theme? Or do we need a way to point to a target directory (after compiling to class files) as well?

Support implicit Scala version from theme

If given something like "org.senkbeil,my-theme,0.1.0", should convert to my-theme_2.10 or whatever version is associated with the tool itself via the BuildInfo data.

Add assembled jars to build

Assembly plugin was already added and worked earlier, but I forgot to include standalone jars, which would be good for binary packages like ArchLinux's pacman and Mac's homebrew.

Support optional arguments fed to layouts

Enable passing a map of key/value pairs that come from grus via --extra key=value or something that can be used in layouts. Example use case is to provide a pixel id as an extra argument. Can be included repeatedly via config file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.