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 site extends SiteOps

Selects the configuration options available for site generation.

Linear Supertypes
SiteOps, CopyOps, SingleConfigOps, ColorOps, CommonConfigOps, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. site
  2. SiteOps
  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 baseURL(url: String): Helium

    Specifies the base URL where the rendered site will be hosted.

    Specifies the base URL where the rendered site will be hosted. This configuration option allows to turn internal links into external ones for documents which will be part of the rendered site, but are not included in other formats like EPUB or PDF.

    Definition Classes
    SiteOps
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  8. def copyWith(pdfSettings: PDFSettings): Helium
    Attributes
    protected
    Definition Classes
    CopyOps
  9. def copyWith(epubSettings: EPUBSettings): Helium
    Attributes
    protected
    Definition Classes
    CopyOps
  10. def copyWith(siteSettings: SiteSettings): Helium
    Attributes
    protected
    Definition Classes
    CopyOps
  11. def currentColors: ColorSet
    Attributes
    protected
    Definition Classes
    SiteOps → ColorOps
  12. def currentContent: WebContent
    Attributes
    protected
    Definition Classes
    SiteOps
  13. def currentLayout: WebLayout
    Attributes
    protected
    Definition Classes
    SiteOps
  14. def currentMetadata: DocumentMetadata
    Attributes
    protected
    Definition Classes
    SiteOps → SingleConfigOps
  15. 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 browsers supporting dark mode.

    Definition Classes
    SiteOps
  16. def downloadPage(title: String, description: Option[String], downloadPath: Path = Root / "downloads", includeEPUB: Boolean = true, includePDF: Boolean = true): Helium

    Adds a download page to the generated site that contains links to EPUB and PDF versions of the site.

    Adds a download page to the generated site that contains links to EPUB and PDF versions of the site. When the sbt plugin is used, this setting will automatically trigger the rendering of the corresponding EPUB and PDF documents when running laikaSite. When the library API is used, this setting only causes the inclusion of the download page itself, the actual EPUB and PDF content must be generated by running the respective renderers manually.

    title

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

    description

    a short description that appears on the download page right under the title

    downloadPath

    the virtual path the EPUB and PDF documents will be generated into

    includeEPUB

    whether EPUB documents will be automatically generated (only having an effect when using the sbt plugin)

    includePDF

    whether PDF documents will be automatically generated (only having an effect when using the sbt plugin)

    Definition Classes
    SiteOps
  17. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  19. def externalCSS(url: String, attributes: StyleAttributes = StyleAttributes.defaults, condition: (Document) ⇒ Boolean = _ => true): Helium

    Links an external CSS resource from the specified URL.

    Links an external CSS resource from the specified URL.

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

    Definition Classes
    SiteOps
  20. def externalJS(url: String, attributes: ScriptAttributes = ScriptAttributes.defaults, condition: (Document) ⇒ Boolean = _ => true): Helium

    Links an external JavaScript resource from the specified URL.

    Links an external JavaScript resource from the specified URL.

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

    Definition Classes
    SiteOps
  21. def favIcons(icons: Favicon*): Helium

    Adds one or more favicons which can be an internal resource or an external URL.

    Adds one or more favicons which can be an internal resource or an external URL.

    Definition Classes
    SiteOps
  22. 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
  23. def fontResources(defn: FontDefinition*): Helium
    Definition Classes
    SiteOps → SingleConfigOps → CommonConfigOps
  24. 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
  25. def footer(html: String): Helium

    Defines a footer as raw HTML output.

    Defines a footer as raw HTML output.

    A horizontal rule will be inserted by the template and should not be part of this sequence.

    Definition Classes
    SiteOps
  26. def footer(spans: Span*): Helium

    Defines a footer as a sequence of AST elements.

    Defines a footer as a sequence of AST elements.

    A horizontal rule will be inserted by the template and should not be part of this sequence. An empty parameter list will only remove the default Laika footer.

    Definition Classes
    SiteOps
  27. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  28. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  29. def helium: Helium
    Attributes
    protected
    Definition Classes
    site → CopyOps
  30. 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
    SiteOps
  31. 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
    SiteOps
  32. 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
    SiteOps
  33. 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
    SiteOps
  34. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  35. def landingPage(logo: Option[Image] = None, title: Option[String] = None, subtitle: Option[String] = None, latestReleases: Seq[ReleaseInfo] = Nil, license: Option[String] = None, titleLinks: Seq[ThemeLink] = Nil, documentationLinks: Seq[TextLink] = Nil, projectLinks: Seq[ThemeLinkSpan] = Nil, teasers: Seq[Teaser] = Nil, styles: Seq[Path] = Nil): Helium

    Adds a dedicated landing page to the site that is tailored for software documentation sites.

    Adds a dedicated landing page to the site that is tailored for software documentation sites. By default no landing page will be included and the site will render the homepage (if present) with the same default template as the main content pages.

    See the section "Website Landing Page" in the "Theme Settings" chapter for visual guide to the layout of the page.

    All arguments of this method are optional, but the page would look strange if you omit most of them.

    Additionally or alternatively you can also add a regular markup document called landing-page.<suffix> to one of your input directories and its content will be inserted at the bottom of this page. This is in case you want to stick with the traditional approach of some sites, which give you 'Getting Started' style content right on the start page. It can also be used to list adopters, provide a feature overview or links to presentations or videos.

    logo

    a logo to be placed on the left hand side of the header

    title

    a title to be placed right under the logo

    subtitle

    a subtitle to be place right under the title

    latestReleases

    a set of release versions to display on the right side of the header

    license

    the license info to render right under the release info

    titleLinks

    a row of links to render beneath the subtitle on the left side of the header

    documentationLinks

    a set of documentation links to render in a dedicated panel on the right side of the header

    projectLinks

    a set of project links to render at the bottom of the right side of the header

    teasers

    a set of teasers containing of headline and description to render below the header

    styles

    internal paths to additional CSS files that should be linked to the landing page

    Definition Classes
    SiteOps
  36. def layout(contentWidth: Length = currentLayout.contentWidth, navigationWidth: Length = currentLayout.navigationWidth, topBarHeight: Length = currentLayout.topBarHeight, defaultBlockSpacing: Length = currentLayout.defaultBlockSpacing, defaultLineHeight: Double = currentLayout.defaultLineHeight, anchorPlacement: AnchorPlacement = currentLayout.anchorPlacement): Helium

    Allows to override the defaults for Helium's layout.

    Allows to override the defaults for Helium's 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.

    contentWidth

    the maximum width of the main content column

    navigationWidth

    the width of the left navigation sidebar

    topBarHeight

    the height of the top navigation bar

    defaultBlockSpacing

    the default space between block elements

    defaultLineHeight

    the default line height

    anchorPlacement

    the placement of anchors for copying the links of section headlines (left, right or none)

    Definition Classes
    SiteOps
  37. def mainNavigation(depth: Int = currentContent.mainNavigation.depth, includePageSections: Boolean = ..., prependLinks: Seq[ThemeNavigationSection] = Nil, appendLinks: Seq[ThemeNavigationSection] = Nil): Helium

    Configures the main (left) navigation pane.

    Configures the main (left) navigation pane.

    By default the navigation is auto-generated from the available sources to a navigation depth of 2. This API allows to override some defaults and to prepend or append additional navigation links.

    If the includePageSections parameter is set to true, the navigation structure will not only reflect the directory structure and the documents within, but also the section headers on individual pages. This option may be attractive if you only have very few pages in your site and want to make better use of the space in the left navigation pane. Note that sections may still be filtered based on your setting for the overall navigation depth.

    You can also append or prepend additional sections of links, each with a section header and one or more links. Prepending may not be desirable if you also configure a table of content or a download page, as the prepended links would appear before them.

    If you increase the depth to a value higher than 3 you might want to include custom CSS for the levels 4 and higher as Laika comes with styling for three layers out of the box.

    depth

    the depth of the navigation structure, two by default

    includePageSections

    indicates whether sections on pages should be included (false by default)

    prependLinks

    navigation sections to place above the auto-generated navigation structure

    appendLinks

    navigation sections to place below the auto-generated navigation structure

    Definition Classes
    SiteOps
  38. def messageColors(info: Color, infoLight: Color, warning: Color, warningLight: Color, error: Color, errorLight: Color): Helium
    Definition Classes
    ColorOps
  39. 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
  40. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  41. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  42. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  43. def pageNavigation(enabled: Boolean = ..., depth: Int = currentContent.pageNavigation.depth, sourceBaseURL: Option[String] = ..., sourceLinkText: String = ..., keepOnSmallScreens: Boolean = ...): Helium

    Configures the page navigation bar on the top-right side of the content pane

    Configures the page navigation bar on the top-right side of the content pane

    enabled

    indicates whether the page navigation should be included.

    depth

    the of the navigation structure, two by default.

    sourceBaseURL

    the base URL for the markup sources of the rendered pages.

    sourceLinkText

    the link text to show on links to markup sources.

    keepOnSmallScreens

    indicates whether the page navigation should be included on small screens, where it will move from a top-right box to the top of the main content pane.

    Definition Classes
    SiteOps
  44. def resetDefaults(mainNavigation: Boolean = false, topNavigation: Boolean = false, favIcons: Boolean = false): Helium

    Resets the specified UI elements receiving a true flag to the defaults.

    Resets the specified UI elements receiving a true flag to the defaults.

    This method can be used in rare cases where a configuration that has been pre-populated with some UI elements beyond the built-in defaults of Helium should get reset without falling back to the basic Helium.defaults. This cannot be done with the regular configuration methods as some properties of type Seq[A] behave in an additive way, meaning that if you call .site.topNavigationBar(navLinks = Seq(...)) those links will be added to those already present.

    If starting from Helium.defaults directly this method has no effect as Laika does not pre-populate those Seq[A] settings. But 3-rd party tools might provide a Helium instance with additional elements.

    mainNavigation

    indicates whether the main (left) navigation pane should reset to the auto-generated list

    topNavigation

    indicates whether the top navigation bar should remove any pre-populated links

    favIcons

    indicates that the list of favicons should be cleared

    Definition Classes
    SiteOps
  45. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  46. def syntaxHighlightingColors(base: ColorQuintet, wheel: ColorQuintet): Helium
    Definition Classes
    ColorOps
  47. 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
    SiteOps → CommonConfigOps
  48. def themeColors(primary: Color, primaryMedium: Color, primaryLight: Color, secondary: Color, text: Color, background: Color, bgGradient: (Color, Color)): Helium
    Definition Classes
    ColorOps
  49. def toString(): String
    Definition Classes
    AnyRef → Any
  50. def topNavigationBar(homeLink: ThemeLink = ..., navLinks: Seq[ThemeLink] = Nil, versionMenu: VersionMenu = ..., highContrast: Boolean = ...): Helium

    Configures the top navigation bar of the main content pages.

    Configures the top navigation bar of the main content pages.

    homeLink

    the link to the homepage, by default pointing to index.html and using the Helium home icon.

    navLinks

    an optional set of links to be placed at the right side of the bar, supported link types are IconLink, ButtonLink, ImageLink and a plain TextLink

    versionMenu

    defines labels and optionally additional links for the version switcher menu

    highContrast

    indicates whether the background color should have a high contrast to the background of the page (darker in light mode and lighter in dark mode).

    Definition Classes
    SiteOps
  51. def versions(versions: Versions): Helium

    Specify the configuration for versioned documentation, a core Laika feature simply exposed via the Helium Config API.

    Specify the configuration for versioned documentation, a core Laika feature simply exposed via the Helium Config API.

    The specified configuration allows to define the current version as well as any older or newer versions. For each version the pathSegment property holds the value that should use as part of URLs (e.g. /0.18/...) whereas the displayValue property holds the text that should be shown in the dropdown menu.

    If the output destination of the render operation contains existing, older versions in sub-folders, those will be scanned to produce additional version information in the JSON loaded by the site. This will be used for "smart linking" where the drop-down will link to the same page of a different version if it exists.

    The corresponding version switcher component of the theme can be configured with topNavigationBar.versionMenu. That setting allows to specify the labels and optionally additional link entries for the menu. Additional version switcher components can be added using the VersionMenu class, for example for adding the menu to the landing page where it is not included by default.

    Definition Classes
    SiteOps
  52. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  53. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  54. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  55. def withColors(colors: ColorSet): Helium
    Attributes
    protected
    Definition Classes
    SiteOps → SingleConfigOps → ColorOps
  56. def withFontFamilies(fonts: ThemeFonts): Helium
    Attributes
    protected
    Definition Classes
    SiteOps → SingleConfigOps
  57. def withFontSizes(sizes: FontSizes): Helium
    Attributes
    protected
    Definition Classes
    SiteOps → SingleConfigOps
  58. def withMetadata(metadata: DocumentMetadata): Helium
    Attributes
    protected
    Definition Classes
    SiteOps → SingleConfigOps

Deprecated Value Members

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

    (Since version 0.19.4) Use internalCSS

  2. def autoLinkJS(paths: Path*): Helium
    Definition Classes
    SiteOps
    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
  4. def markupEditLinks(text: String, baseURL: String): Helium
    Definition Classes
    SiteOps
    Annotations
    @deprecated
    Deprecated

    (Since version 0.19.0) use the corresponding properties of the new pageNavigation method

  5. def pageNavigation(enabled: Boolean, depth: Int, sourceBaseURL: Option[String], sourceLinkText: String): Helium
    Definition Classes
    SiteOps
    Annotations
    @deprecated
    Deprecated

Inherited from SiteOps

Inherited from CopyOps

Inherited from SingleConfigOps

Inherited from ColorOps

Inherited from CommonConfigOps

Inherited from AnyRef

Inherited from Any

Ungrouped