🚀 DAY 3 OF LAUNCH WEEK:Announcing Bun and vlt Support in Socket.Learn more →
Socket
Book a DemoInstallSign in
Socket

ba.sake:mill-hepek_mill0.11_2.13

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ba.sake:mill-hepek_mill0.11_2.13

Mill plugin for Hepek static site generator

Source
mavenMaven
Version
0.1.0
Version published
Maintainers
1
Source

mill-hepek

Maven Central

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

Installation

Add the following to your build.sc:

import $ivy.`ba.sake::mill-hepek::0.0.2`
import mill._
import mill.scalalib._
import ba.sake.millhepek.MillHepekModule

object site extends MillHepekModule with ScalaModule {
  def scalaVersion = ...
}

Usage

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

  • copy all files from src/resources/public to hepek_output folder
  • write all object .. extends Renderable from the files package to hepek_output folder
  • write accessors for src/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/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 ./mill site.hepek, you'll find the site/hepek_output/renderme.txt file,
with text Some text.

Examples

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.

FAQs

Package last updated on 23 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts