Skip to content

i10416/petit

Repository files navigation

Release

Laika Theme: Petit

Simple blog theme for Scala 2.12,2.13 and 3.

scala 2.12 scala 2.13 scala 3
Sonatype Nexus (Snapshots) Sonatype Nexus (Snapshots) Sonatype Nexus (Snapshots)

How to Use

build.sbt

libraryDependencies ++= Seq(
  "org.planet42" %% "laika-core" % "0.18.2",
  "org.planet42" %% "laika-io" % "0.18.2",
  "dev.i10416" %% "petit" % "<version above>",
  "org.typelevel" %% "cats-effect" % "3.3.11",
)

or ammonite scala script

or

import $ivy.`dev.i10416::petit:<version above>`
import $ivy.`org.planet42::laika-core:0.18.2`
import $ivy.`org.planet42::laika-io:0.18.2`
import $ivy.`org.typelevel::cats-effect:3.3.11`

Directory Structure

  • <src>
    • article0
      • README.md
    • article1
      • README.md
    • ...

Script

import dev.i10416.petit.Petit
import cats.effect.{IO, Async, Sync, Resource}
import laika.format
import laika.io.api.TreeTransformer
import laika.directive.std.StandardDirectives
import laika.markdown.github.GitHubFlavor
import laika.parse.code.SyntaxHighlighting
import laika.api._
import cats.effect.unsafe.implicits.global
import laika.io.implicits._

def createTransformer[F[_]: Async]: Resource[F, TreeTransformer[F]] =
  Transformer
    .from(format.Markdown)
    .to(format.HTML)
    .parallel[F]
    .withTheme(Petit)
    .build
createTransformer[IO].use {
  _.fromDirectory("<src>").toDirectory("<dist>").transform
}.unsafeRunSync()

How to contribute?

  • Give it a star⭐
  • Drop the feedback to the author @i10416
  • Send a PR with fixes of typos/bugs/etc🐛

License

Licensed under the Apache License, Version 2.0.

todo

  • publish
    • release snapshot
    • release 0.0.1
  • sitemap generator
  • rss generator
  • minify css
  • automatically generate last modified date time
  • link with ogp info directive
  • add search
  • add line numbers, line highlight,emphasize options for code blocks
  • format scala code before transform
  • enable foo.ext:title syntax for code blocks

About

simple Laika theme for website

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published