Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shrink public API surface in laika.theme + laika.helium #466

Merged
merged 1 commit into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion io/src/main/scala/laika/helium/config/HeliumIcon.scala
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ object HeliumIcon {
val github: Icon = InlineSVGIcon(SVGIcons.githubIcon, Some("Source Code"), Styles("github"))
val mastodon: Icon = InlineSVGIcon(SVGIcons.mastodonIcon, Some("Mastodon"), Styles("mastodon"))

val registry: IconRegistry = IconRegistry(
private[helium] val registry: IconRegistry = IconRegistry(
"navigationMenu" -> navigationMenu,
"home" -> home,
"link" -> link,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private[laika] object ConfigGenerator {
/** Utility for splitting a collection into a balanced group of items as opposed to the unbalanced
* `grouped` method of the Scala collection API.
*/
object BalancedGroups {
private[laika] object BalancedGroups {

/** Creates a balanced group of items based on the given desired size.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,7 @@ private[helium] object DownloadPageGenerator {
RootElement(blocks),
config = tree.root.config.withValue("helium.markupEditLinks", false).build
)
val newRoot = tree.root.copy(
tree = tree.root.tree.copy(
content = doc +: tree.root.tree.content
)
)
new ParsedTree(newRoot, tree.staticDocuments)
tree.modifyTree(_.prependContent(doc))
}

Sync[F].fromEither(treeWithDownloadPage.leftMap(ConfigException.apply))
Expand Down
2 changes: 1 addition & 1 deletion io/src/main/scala/laika/helium/generate/FOStyles.scala
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ private[laika] class FOStyles(helium: Helium) {

}

object FOStyles {
private[laika] object FOStyles {

val defaultPath: Path = Root / "styles.fo.css"

Expand Down
5 changes: 2 additions & 3 deletions io/src/main/scala/laika/theme/TreeProcessorBuilder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package laika.theme

import cats.Monad
import cats.data.Kleisli
import cats.effect.Sync
import laika.io.model.ParsedTree
import laika.io.ops.TreeMapperOps
import laika.theme.Theme.TreeProcessor
Expand All @@ -27,7 +26,7 @@ import laika.theme.Theme.TreeProcessor
*
* @author Jens Halm
*/
abstract class TreeProcessorBuilder[F[_]: Monad] extends TreeMapperOps[F] {
class TreeProcessorBuilder[F[_]: Monad] private () extends TreeMapperOps[F] {

type MapRes = TreeProcessor[F]

Expand All @@ -38,6 +37,6 @@ abstract class TreeProcessorBuilder[F[_]: Monad] extends TreeMapperOps[F] {
*/
object TreeProcessorBuilder {

def apply[F[_]: Sync]: TreeProcessorBuilder[F] = new TreeProcessorBuilder[F] {}
def apply[F[_]: Monad]: TreeProcessorBuilder[F] = new TreeProcessorBuilder[F]()

}
4 changes: 3 additions & 1 deletion io/src/main/scala/laika/theme/config/Font.scala
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ object Font {
/** Base trait for the types of embedded fonts Laika supports, which are either a file-system or classpath resource.
*/
sealed trait EmbeddedFont {

/** The virtual path within the output tree that the font resource will be placed at. */
def path: Path
}

Expand All @@ -116,7 +118,7 @@ case class EmbeddedFontFile(file: FilePath) extends EmbeddedFont {
val path: Path = Root / "laika" / "fonts" / file.name
}

/** Represent a font files as a classpath resource.
/** Represent a font file as a classpath resource.
*/
case class EmbeddedFontResource(name: String) extends EmbeddedFont {
val path: Path = Root / "laika" / "fonts" / VirtualPath.parse(name).name
Expand Down