Skip to content

Commit

Permalink
Ressurect Play Framework support
Browse files Browse the repository at this point in the history
  • Loading branch information
sake92 committed Dec 4, 2023
1 parent 4087c75 commit 294c080
Show file tree
Hide file tree
Showing 9 changed files with 136 additions and 10 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ See these posts for motivation:

### [Hepek Components](https://sake92.github.io/hepek/hepek/components/index.html) [![Maven Central](https://img.shields.io/maven-central/v/ba.sake/hepek-components_3.svg?style=flat-square&label=Scala+3)](https://mvnrepository.com/artifact/ba.sake/hepek-components)
Typesafe templates, grids, forms, code highlighting, markdown etc.
JVM and ScalaJS supported!
JVM and ScalaJS supported!

---
### [Hepek SSG](https://sake92.github.io/hepek/hepek/index.html) [![Maven Central](https://img.shields.io/maven-central/v/ba.sake/hepek_3.svg?style=flat-square&label=Scala+3)](https://mvnrepository.com/artifact/ba.sake/hepek)
Expand All @@ -24,4 +24,14 @@ Resources:
- [source code](https://github.com/sake92/sake-ba-source) of sake.ba
- [source code](https://github.com/sake92/sake-ba-blog-source) of blog.sake.ba (code examples, math snippets etc.)

---
### Integrations

#### [Sharaf](https://github.com/sake92/sharaf)
Shraf integration.
- [fullstack example](https://github.com/sake92/sharaf/tree/main/examples/fullstack)
- [petclinic implementation](https://github.com/sake92/sharaf-petclinic)

#### [Hepek Play](https://sake92.github.io/hepek/integrations/play-framework.html) [![Maven Central](https://img.shields.io/maven-central/v/ba.sake/hepek-play_3.svg?style=flat-square&label=Scala+3)](https://mvnrepository.com/artifact/ba.sake/hepek-play)
Play framework integration.
- [fullstack example](https://github.com/sake92/play-hepek-example)
7 changes: 6 additions & 1 deletion hepek-docs/src/main/scala/files/Index.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@ object Index extends templates.HepekDocsStaticPage {
Hepek is a collection of useful projects for making websites in Scala:
- [Components](${hepek.components.Index.ref})
- [Static site generator](${hepek.Index.ref})
- [Integrations](${integrations.Index.ref})

Components can be used in any project, they have minimal dependencies.
Components is a standalone library with minimal dependencies.
They provide utilites for grid, form inputs, panels, navbars, markdown, code highlighting, maths rendering and lots more.
Components support frameworks like Bootstrap 5, Bulma etc.
You can switch to a different framework with minimal effort and override parts you don't like.

SSG has support for automatic relative links, PDF rendering and lots more.

Integrations provide Hepek Components support for various frameworks:
[Sharaf](https://github.com/sake92/sharaf),
[Play](https://www.playframework.com/).
""".md
),
super.pageContent
Expand Down
9 changes: 4 additions & 5 deletions hepek-docs/src/main/scala/files/hepek-components/Index.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package files.hepek.components

import utils.Imports.Bundle.*, Tags.*
import utils.Site

object Index extends HepekComponentsDocsPage {

Expand All @@ -13,8 +14,6 @@ object Index extends HepekComponentsDocsPage {
introSection
)

val hepekComponentsV = "0.18.0"

val introSection = Section(
"Hepek Components",
frag(
Expand All @@ -23,16 +22,16 @@ object Index extends HepekComponentsDocsPage {
```scala
// mill
def ivyDeps = Agg(
ivy"ba.sake::hepek-components:${hepekComponentsV}"
ivy"ba.sake::hepek-components:${Site.hepekVersion}"
)
// sbt
libraryDependencies ++= Seq(
"ba.sake" %% "hepek-components" % "${hepekComponentsV}"
"ba.sake" %% "hepek-components" % "${Site.hepekVersion}"
)

// scala-cli
//> using dep ba.sake::hepek-components:${hepekComponentsV}
//> using dep ba.sake::hepek-components:${Site.hepekVersion}
```

Components are mostly *interface-based* so we can compose them and replace with minimal effort.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package files.integrations

import files.hepek.HepekDocsPage

trait HepekIntegrationsDocsPage extends HepekDocsPage {
override def categoryPosts = List(
Index,
SharafFramework,
PlayFramework
)

override def pageCategory = Some(Index.pageSettings.label)
}

27 changes: 27 additions & 0 deletions hepek-docs/src/main/scala/files/integrations/Index.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package files.integrations

import utils.Imports.Bundle.*, Tags.*

object Index extends HepekIntegrationsDocsPage {

override def pageSettings =
super.pageSettings
.withTitle("Hepek Integrations")
.withDescription("Hepek Integrations")

override def blogSettings = super.blogSettings.withSections(
introSection
)


val introSection = Section(
"Hepek Integrations",
frag(
s"""
Use Hepek Components in your favorite framework:
- [Sharaf](${SharafFramework.ref})
- [Play Framework](${PlayFramework.ref})
""".md
)
)
}
39 changes: 39 additions & 0 deletions hepek-docs/src/main/scala/files/integrations/PlayFramework.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package files.integrations

import utils.Imports._
import utils.Imports.Bundle.*, Tags.*
import utils.Site

object PlayFramework extends HepekIntegrationsDocsPage {

override def pageSettings =
super.pageSettings
.withTitle("Play Framework")
.withLabel("Play Framework")
.withDescription("Play Framework - Hepek integrations")

override def blogSettings =
super.blogSettings.withSections(pfSection)

val pfSection = Section(
"Quick start",
frag(
s"""
Hepek Play Framework integration:
```scala
// mill
def ivyDeps = Agg(
ivy"ba.sake::hepek-play:${Site.hepekVersion}"
)
// sbt
libraryDependencies ++= Seq(
"ba.sake" %% "hepek-play" % "${Site.hepekVersion}"
)
```

See the [example repo](https://github.com/sake92/play-hepek-example)
""".md
)
)
}
31 changes: 31 additions & 0 deletions hepek-docs/src/main/scala/files/integrations/SharafFramework.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package files.integrations

import utils.Imports._
import utils.Imports.Bundle.*, Tags.*
import utils.Site

object SharafFramework extends HepekIntegrationsDocsPage {

override def pageSettings =
super.pageSettings
.withTitle("Sharaf")
.withLabel("Sharaf")
.withDescription("Sharaf - Hepek integrations")

override def blogSettings =
super.blogSettings.withSections(pfSection)

val pfSection = Section(
"Quick start",
frag(
s"""
Hepek is supported natively in Sharaf.
Examples:
- [fullstack example](https://github.com/sake92/sharaf/tree/main/examples/fullstack)
- [petclinic implementation](https://github.com/sake92/sharaf-petclinic)

""".md
)
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ trait HepekDocsStaticPage extends StaticPage with AnchorjsDependencies with FADe
override def staticSiteSettings =
super.staticSiteSettings
.withIndexPage(files.Index)
.withMainPages(files.hepek.components.Index, files.hepek.Index)
.withMainPages(files.hepek.components.Index, files.hepek.Index, files.integrations.Index)

override def navbar = Some(Navbar)

Expand Down
5 changes: 3 additions & 2 deletions hepek-docs/src/main/scala/utils/Site.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package utils

object Site {
val url = "https://sake92.github.io/hepek"
val name = "hepek"
val url = "https://sake92.github.io/hepek"
val name = "hepek"
val hepekVersion = "0.19.0"
}

0 comments on commit 294c080

Please sign in to comment.