• Stars
    star
    21
  • Rank 1,084,038 (Top 22 %)
  • Language
    Scala
  • License
    Apache License 2.0
  • Created almost 8 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

sbt-hepek

Maven Central

An sbt plugin for writing Scala objects to files.
See also hepek, static content generator that builds upon this plugin.

Installation

Add the plugin to project/plugins.sbt:

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

and enable it in build.sbt:

myProject.enablePlugins(HepekPlugin)

Usage

The main task of sbt-hepek is hepek.
When executed, it will:

  1. copy all files from src/main/resources/public to hepek_output folder
  2. write all object .. extends Renderable from the files package to hepek_output folder
  3. write accessors for src/main/resources/public files, so you don't have to type it, or make mistakes

Minimal example:

package files // mandatory !!

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

object RenderMe extends Renderable {

  // access `src/main/resources/public` files through autogenerated files.<TAB>
  override def render =
    "Some text" // arbitrary Scala code
  
  override def relPath = 
    Paths.get("renderme.txt")
}

When you run sbt hepek, you'll find the hepek_output/renderme.txt file,
with text Some text.

Examples / docs


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... ^_^


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.

More Repositories

1

hepek

Typesafe HTML templates and static site generator in pure Scala
Scala
104
star
2

nand2tetris

Nand2Tetris course solutions
Scala
64
star
3

sharaf

Minimalistic Scala 3 web framework
Scala
31
star
4

notes

My book notes, tutorials sketches and stuff
HTML
27
star
5

writing-an-interpreter

Writing a simple interpreter in ANTLR4 and by hand in Scala
Java
14
star
6

squery

Simple SQL queries in Scala 3
Scala
11
star
7

tupson

Stupid simple Scala 3 library for writing and reading JSON
Scala
6
star
8

kalem

Scalafix rules for generating Withers
Scala
6
star
9

hepek-examples

Self-contained examples of using hepek
Shell
6
star
10

PlayGuiceExample

PlayFramework, Scala, Guice, DI, Testing, ScalaTest
Scala
6
star
11

sake-ba-source

Source code of sake.ba
Scala
5
star
12

sharaf-petclinic

A PetClinic web app based on sharaf, hepek, and squery
Scala
4
star
13

cakum-pakum

Spring REST starter
Java
4
star
14

hepek-classycle

Classycle ressurection
Java
4
star
15

RxTags

Simple, reactive UIs in ScalaJS
Scala
4
star
16

Scalarizmi

Algorithms and data structures, in Scala
Scala
4
star
17

scalajs-router

ScalaJS frontend router
Scala
4
star
18

stone

URL (de)construct. Withers.
Scala
4
star
19

hepek-starter

Starter template for static blog with Hepek
Shell
4
star
20

causality

Event driven CQRS example
Java
4
star
21

scala-spec-hepek

Scala specification written with hepek
Scala
3
star
22

mimdex

Search. Memes.
JavaScript
2
star
23

playful-scala

Full-stack Scala with Play, ScalaJS, Hepek templates, Stone routes
Scala
2
star
24

hepek-cask-example

Combine Cask with Hepek
Shell
2
star
25

rpnhma

JavaScript
2
star
26

mill-hepek

Mill plugin for rendering Scala objects to files
Scala
2
star
27

fp4noobs

FP for beginners
Scala
2
star
28

mill-scala-hello.g8

Giter8 template for Scala hello world with Mill
Scala
2
star
29

hepek-play-example

Example of using Hepek with Play
Scala
2
star
30

hepek-kt

Hepek for Kotlin
Kotlin
2
star
31

hepek-zio-example

Scala
2
star
32

hepek-http4s-example

Example of using Hepek with Http4s
Scala
2
star
33

sharaf-fullstack.g8

Giter8 template for a Sharaf fullstack web app
Scala
2
star
34

mill-scala3-library-starter.g8

Giter8 template for a Scala 3 library with Mill
Shell
2
star
35

spring-session-example

Example of using spring-session project
Java
1
star
36

mill-powershell-completion

Basic TAB completion for Mill in PowerShell
PowerShell
1
star
37

PlayBootstrap

Play, Bootstrap, forms
Scala
1
star
38

Win32NamedPipe

Java
1
star
39

java-amber

Code from my presentation on Amber project
Java
1
star
40

sake-ba-blog-source

Source code of blog.sake.ba
Scala
1
star
41

hepek-core

The core of hepek project
Java
1
star
42

sharaf-todo-backend

Shell
1
star
43

capture-treasure-game

Self-playing "capture the treasure" game
Java
1
star
44

scala-guice

Guice examples with Scala
Scala
1
star
45

RxTags-Starter

RxTags starter template
Scala
1
star
46

sake92

1
star
47

spring-boot-mill

Shell
1
star
48

yugioh-abridged-calculator

yugioh abridged calculator
JavaScript
1
star