Packages

  • package root
    Definition Classes
    root
  • package laika
    Definition Classes
    root
  • package helium
    Definition Classes
    laika
  • class Helium extends AnyRef

    Configuration API for the Helium theme settings.

    Configuration API for the Helium theme settings.

    Helium can be fully configured with its Scala API and does not require any configuration files.

    The entry point for all configuration steps is always Helium.defaults to ensure there are sensible defaults in place for all the options you omit in your configuration.

    For each configuration step you need to choose one of the four selectors, either all to specify options for all three output formats or site, epub or pdf to select a single format. Not all options are available for all formats, but the IDE's context help and the documentation below can guide you.

    In the minimal example below we only specify some metadata for all formats as well as the navigation depth for EPUB and PDF:

    val theme = Helium.defaults
    .all.metadata(
    title = Some("Project Name"),
    language = Some("de"),
    )
    .epub.navigationDepth(4)
    .pdf.navigationDepth(4)
    .build

    Laika also provides convenient constructors for some of the data types used frequently in its theme API. You can import laika.theme.Color._ for specifying colors with hex("ffaaff") or rgb(255, 0, 0) and laika.ast.LengthUnit._ for specifying sizes with px(12) or pt(9) or other available units.

    The final call to build produces a ThemeProvider that can be passed to Laika's transformers or the laikaTheme sbt setting:

    Example for sbt plugin:

    laikaTheme := theme

    Example for the library API:

    val transformer = Transformer
      .from(Markdown)
      .to(EPUB)
      .parallel[IO]
      .withTheme(theme)
      .build
    Definition Classes
    helium
  • all
  • epub
  • pdf
  • site

object epub extends EPUBOps

Selects the configuration options available for EPUB generation.

Linear Supertypes
EPUBOps, CopyOps, SingleConfigOps, ColorOps, CommonConfigOps, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. epub
  2. EPUBOps
  3. CopyOps
  4. SingleConfigOps
  5. ColorOps
  6. CommonConfigOps
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addFontResources(defn: FontDefinition*): Helium

    Adds one or more font resources to the theme, either based on a local classpath or file system resource, or a web font URL, or both.

    Adds one or more font resources to the theme, either based on a local classpath or file system resource, or a web font URL, or both.

    E-book formats like EPUB or PDF require a local font file to be available for embedding. A web font URL can only be used for website generation.

    When using this method, all default fonts of the Helium theme will be de-registered.

    Definition Classes
    CommonConfigOps
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  7. def copyWith(pdfSettings: PDFSettings): Helium
    Attributes
    protected
    Definition Classes
    CopyOps
  8. def copyWith(epubSettings: EPUBSettings): Helium
    Attributes
    protected
    Definition Classes
    CopyOps
  9. def copyWith(siteSettings: SiteSettings): Helium
    Attributes
    protected
    Definition Classes
    CopyOps
  10. def coverImages(images: CoverImage*): Helium

    Specifies one or more cover images for the EPUB document.

    Specifies one or more cover images for the EPUB document.

    Multiple cover images are only relevant when the @:select directive is used to generate different versions of the same e-book which can all have their own cover image. See the documentation for the @:select directive in the chapter "Standard Directives" in the manual for details.

    Definition Classes
    EPUBOps
  11. def currentColors: ColorSet
    Attributes
    protected
    Definition Classes
    EPUBOps → ColorOps
  12. def currentLayout: EPUBLayout
    Attributes
    protected
    Definition Classes
    EPUBOps
  13. def currentMetadata: DocumentMetadata
    Attributes
    protected
    Definition Classes
    EPUBOps → SingleConfigOps
  14. def darkMode: DarkModeOps

    Allows to add a second color set for dark mode.

    Allows to add a second color set for dark mode. The implementation is based on the prefers-color-scheme media query and requires e-book readers supporting dark mode.

    Definition Classes
    EPUBOps
  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  17. def fontFamilies(body: String, headlines: String, code: String): Helium

    Specifies which font family to use for the body text, for headlines and for inline code and code blocks.

    Specifies which font family to use for the body text, for headlines and for inline code and code blocks.

    All specified fonts need to be made available for the theme first by using the fontResources method. The body font needs to be available at least as regular, italic, bold and bold italic. The headline font needs to support bold and bold italic. For the code font a regular font weight is sufficient.

    Definition Classes
    SingleConfigOps → CommonConfigOps
  18. def fontResources(defn: FontDefinition*): Helium
    Definition Classes
    EPUBOps → SingleConfigOps → CommonConfigOps
  19. def fontSizes(body: Length, code: Length, title: Length, header2: Length, header3: Length, header4: Length, small: Length): Helium

    Configure the theme's font sizes.

    Configure the theme's font sizes. Most property names are self-explanatory, the small font is currently only used for footnote references in PDF output.

    Definition Classes
    SingleConfigOps → CommonConfigOps
  20. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  22. def helium: Helium
    Attributes
    protected
    Definition Classes
    epub → CopyOps
  23. def inlineCSS(content: String, condition: (Document) ⇒ Boolean = _ => true): Helium

    Inserts inline style declarations into the HTML head.

    Inserts inline style declarations into the HTML head.

    The condition attribute can be used to only include the CSS when some user-defined predicates are satisfied.

    Definition Classes
    EPUBOps
  24. def inlineJS(content: String, isModule: Boolean = false, condition: (Document) ⇒ Boolean = _ => true): Helium

    Inserts inline scripts into the HTML head.

    Inserts inline scripts into the HTML head.

    The condition attribute can be used to only include the CSS when some user-defined predicates are satisfied.

    Definition Classes
    EPUBOps
  25. def internalCSS(searchPath: Path, attributes: StyleAttributes = StyleAttributes.defaults, condition: (Document) ⇒ Boolean = _ => true): Helium

    Auto-links CSS documents from the specified path, which may point to a single CSS document or a directory.

    Auto-links CSS documents from the specified path, which may point to a single CSS document or a directory. In case of a directory it will be searched recursively and all CSS files found within it will be linked in the HTML head.

    The condition attribute can be used to only include the CSS when some user-defined predicates are satisfied.

    Definition Classes
    EPUBOps
  26. def internalJS(searchPath: Path, attributes: ScriptAttributes = ScriptAttributes.defaults, condition: (Document) ⇒ Boolean = _ => true): Helium

    Auto-links JavaScript documents from the specified path, which may point to a single JS document or a directory.

    Auto-links JavaScript documents from the specified path, which may point to a single JS document or a directory. In case of a directory it will be searched recursively and all *.js files found within it will be linked in the HTML head.

    The condition attribute can be used to only include the CSS when some user-defined predicates are satisfied.

    Definition Classes
    EPUBOps
  27. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  28. def layout(defaultBlockSpacing: Length = currentLayout.defaultBlockSpacing, defaultLineHeight: Double = currentLayout.defaultLineHeight, keepTogetherDecoratedLines: Int = ...): Helium

    Allows to override the defaults for Helium's EPUB layout.

    Allows to override the defaults for Helium's EPUB layout.

    You can use the constructors found in the LengthUnit companion to create length values, e.g. LengthUnit.px(12). It's usually most convenient to import laika.ast.LengthUnit._ for your configuration code.

    Most arguments should be self-explanatory. The keepTogetherDecoratedLines value controls the number of lines for decorated blocks like code examples or callouts that should always be kept on the same page. With a setting of 12 for example only blocks with more than 12 lines are allowed to be split across multiple pages. If you choose very high numbers for this setting you might see pages with a lot of blank space when it has to move a large block to the next page.

    Definition Classes
    EPUBOps
  29. def messageColors(info: Color, infoLight: Color, warning: Color, warningLight: Color, error: Color, errorLight: Color): Helium
    Definition Classes
    ColorOps
  30. def metadata(title: Option[String] = None, description: Option[String] = None, identifier: Option[String] = None, authors: Seq[String] = Nil, language: Option[String] = None, datePublished: Option[OffsetDateTime] = None, dateModified: Option[OffsetDateTime] = None, version: Option[String] = None): Helium

    Allows to define a small set of metadata that describes the output.

    Allows to define a small set of metadata that describes the output.

    In the generated site it will be used to populate the <head> section of the HTML output, for EPUB and PDF it will be used to embed the information into the generated files in a way that the respective readers understand.

    When using the sbt plugin the title, description and version metadata will be pre-populated by the standard sbt settings name, description and version respectively. When using the library API no medata will be defined by default. It is recommended to always define the language and title as the minimum set of metadata.

    title

    the title of the site and/or e-book

    description

    a short description of the site and/or e-book

    identifier

    a unique identifier for the e-book, not used for site generation

    authors

    one or more author names

    language

    the language of the site and/or e-book, should always be defined

    datePublished

    the publication date as a UTC date-time

    dateModified

    the modification date as a UTC date-time

    version

    the version string for the output

    Definition Classes
    SingleConfigOps → CommonConfigOps
  31. def navigationDepth(depth: Int): Helium

    The navigation depth of the main navigation structure provided to the EPUB reader.

    The navigation depth of the main navigation structure provided to the EPUB reader. The depth value counts all elements that form the hierarchy, directories, documents and sections within documents.

    Definition Classes
    EPUBOps
  32. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  33. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  34. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  35. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  36. def syntaxHighlightingColors(base: ColorQuintet, wheel: ColorQuintet): Helium
    Definition Classes
    ColorOps
  37. def tableOfContent(title: String, depth: Int): Helium

    Adds a dedicated page for a table of content, in addition to the left navigation bar.

    Adds a dedicated page for a table of content, in addition to the left navigation bar.

    title

    the title to display on the page and in navigation that links to the page

    depth

    the navigation depth which may be different than the one for the navigation bar

    Definition Classes
    EPUBOps → CommonConfigOps
  38. def themeColors(primary: Color, primaryMedium: Color, primaryLight: Color, secondary: Color, text: Color, background: Color, bgGradient: (Color, Color)): Helium
    Definition Classes
    ColorOps
  39. def toString(): String
    Definition Classes
    AnyRef → Any
  40. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  42. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. def withColors(colors: ColorSet): Helium
    Attributes
    protected
    Definition Classes
    EPUBOps → SingleConfigOps → ColorOps
  44. def withFontFamilies(fonts: ThemeFonts): Helium
    Attributes
    protected
    Definition Classes
    EPUBOps → SingleConfigOps
  45. def withFontSizes(sizes: FontSizes): Helium
    Attributes
    protected
    Definition Classes
    EPUBOps → SingleConfigOps
  46. def withMetadata(metadata: DocumentMetadata): Helium
    Attributes
    protected
    Definition Classes
    EPUBOps → SingleConfigOps

Deprecated Value Members

  1. def autoLinkCSS(paths: Path*): Helium
    Definition Classes
    EPUBOps
    Annotations
    @deprecated
    Deprecated

    (Since version 0.19.4) Use internalCSS

  2. def autoLinkJS(paths: Path*): Helium
    Definition Classes
    EPUBOps
    Annotations
    @deprecated
    Deprecated

    (Since version 0.19.4) Use internalJS

  3. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from EPUBOps

Inherited from CopyOps

Inherited from SingleConfigOps

Inherited from ColorOps

Inherited from CommonConfigOps

Inherited from AnyRef

Inherited from Any

Ungrouped