API / Entities

PageEntity

Represents a documentation page.

Instance Methods

Frontmatter

# data → Hash

Merged data hash. Combines data set in frontmatter with any global default values.

Identity

# id → String

Human-readable unique ID for the entity.

# label → String

Titlized name for use in navigation etc.

Can be customized using the @label tag where supported.

# name → String

Parameter-safe entity name.

# title → String

Page title, as defined in frontmatter. Defaults to the page label if not provided.

# type → Symbol

Entity type identifier.

Paths

# directory_path → Pathname

Full directory path for the entity file.

Aliases:

#dir_path
# file_extension → String

Extension of the entity file.

# file_name (strip_ext = false) → String

Name of the entity file.

Includes file extension unless the strip_ext argument is true.

Arguments:

strip_ext Boolean

Whether or not to remove the file extension

# file_path → Pathname

Full path to the entity file.

Aliases:

#full_path
# last_modified → Time

Time that the entity file was last modified.

# lookup_path → String

Canonical reference path.

Used for generating URL paths and looking up entities.

Aliases:

#path
# relative_directory_path → Pathname

Relative directory path for the entity file.

Returned path is relative to the appropriate base directory (i.e. the preview directory for previews).

# relative_file_path → Pathname

Relative path to the entity file.

Returned path is relative to the appropriate base directory (i.e. the preview directory for previews).

Aliases:

#rel_path

Predicates

# footer? → Boolean

Whether the page footer will be shown.

Set via the footer frontmatter property.

# header? → Boolean

Whether the page header will be shown.

Set via the header frontmatter property.

# landing? → Boolean

Whether the page is the default landing page.

Set via the landing frontmatter property.

# markdown? → Boolean

Whether the page content should be rendered with the Markdown renderer.

Set via the markdown frontmatter property.

URLs

# docs_path → String

The docs URL path for this page.

Aliases:

#url_path

Visibility

# hidden? → Boolean

Whether or not the entity is hidden (i.e. hidden from navigation).

# visible? → Boolean

Whether or not the entity is visible (i.e. present in navigation).

User Guide

Extending Lookbook

API

Elsewhere