powered by
LOGO

Theme Configuration

Themes should be designed with configuration in mind. Every theme should have a documented variables exposed that can be used to pass data to the theme.

Packages that depend on the theme you are creating would put the configuration in their config.ftd file.

Say the theme you are creating is foo.github.io/st, this is what someone who depends on your theme may put in their config file:

-- import: foo.github.io/st

-- st.primary-color: red
For this to work you will have to define the variable primary-color in your index.ftd file:
index.ftd of foo.github.io/st
-- string primary-color: green
So theme comes with primary color green, but user has changed it to red.

And in your rest of the code you should use these variables:

other files in foo.github.io/st
-- import: index

-- ftd.text heading: $title
caption title:
color: $index.primary-color
By using variables appropriately many aspects of themes can be customizable.

Table Of Content
FASTN comes with toc processor,

-- import: foo.github.io/st

-- st.toc:
$processor$: toc

- https://google.com
  Google
- /some/url/
  Some URL
  - /some/nested/page/
    Supports Nesting as Well
Here we have used toc $processor$ to create table of content. Table of content is quite a versatile data type, it can be used to create table of content in book like contents, or it can be used to create the header navigation links, links in footer and so on.

Themes should consider using table of content processor as much as makes sense so authors can have consistent, familiar experience across themes. One or more instances of variables of type toc-item list should be used.

LOGO

Theme Configuration

Themes should be designed with configuration in mind. Every theme should have a documented variables exposed that can be used to pass data to the theme.

Packages that depend on the theme you are creating would put the configuration in their config.ftd file.

Say the theme you are creating is foo.github.io/st, this is what someone who depends on your theme may put in their config file:

-- import: foo.github.io/st

-- st.primary-color: red
For this to work you will have to define the variable primary-color in your index.ftd file:
index.ftd of foo.github.io/st
-- string primary-color: green
So theme comes with primary color green, but user has changed it to red.

And in your rest of the code you should use these variables:

other files in foo.github.io/st
-- import: index

-- ftd.text heading: $title
caption title:
color: $index.primary-color
By using variables appropriately many aspects of themes can be customizable.

Table Of Content
FASTN comes with toc processor,

-- import: foo.github.io/st

-- st.toc:
$processor$: toc

- https://google.com
  Google
- /some/url/
  Some URL
  - /some/nested/page/
    Supports Nesting as Well
Here we have used toc $processor$ to create table of content. Table of content is quite a versatile data type, it can be used to create table of content in book like contents, or it can be used to create the header navigation links, links in footer and so on.

Themes should consider using table of content processor as much as makes sense so authors can have consistent, familiar experience across themes. One or more instances of variables of type toc-item list should be used.