Skip to content

sake92/sbt-hepek

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

sbt-hepek

Maven Central

Welcome to sbt-hepek, an sbt plugin for rendering Scala objects to files.
See also hepek, static content generator that builds upon this plugin.

Examples

Installing

Make sure you are using sbt 1.x! Adding following line to the project/plugins.sbt file, in your project:

addSbtPlugin("ba.sake" % "sbt-hepek" % "0.2.1")

and enable it in your build.sbt:

enablePlugins(HepekPlugin)
// logLevel in hepek := Level.Debug // enable to see which objects are rendered

Using

Main task of sbt-hepek is called hepek.
When executed, it will render all Scala objects that extend Renderable trait to respective files, relative to the hepekTarget folder.

Example:

import java.nio.file.Paths
import ba.sake.hepek.core.Renderable

object RenderMe extends Renderable {

  override def render =
    "Some text..." // arbitrary Scala code
  
  override def relPath = 
    Paths.get("renderme.txt")
}

Default value for hepekTarget is hepekTarget := target.value / "web" / "public" / "main".
The good old target folder.
When you run sbt hepek task, you'll find the renderme.txt file in the target/web/public/main folder with contents you specified by the render method.


About the name

A "hepek" in Bosnian language is a jargon for a thing/thingy/stuff...
It is used when we don't know the name of a thing: "Give me that ... hepek".
Also, it is used in the famous show called "Top lista nadrealista" as a name for an advanced device which calms down situations of various kinds.

IMAGE ALT TEXT HERE

Fun fact

I think that this is the first project that tried this approach, namely, using first-class Scala objects for this kind of stuff.
Correct me if I'm wrong... ^_^

Contact

Author of the plugin is Sakib Hadžiavdić.
Twitter: @sake_92
Email: sakib@sake.ba

License

This code is open source software licensed under the Apache 2.0 License.

About

Sbt plugin for rendering Scala objects to files. And more!

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages