§ Command Line Interface (CLI)

freki --help

§ Flags

Flag Name Description

--directory

The directory to build from. Defaults to the ./docs/ directory if available.

--assets

For now an additional directory to build from. In the future it might be more like a public directory. Defaults to the ~/.config/freki/assets/ directory if available.

--output

The directory to build to. Defaults to the ./html-docs/ directory.

--flavor

Markdown flavor [Common, Extended, Holonomic, All]

--site-title

The site title. Defaults to Freki

--base-url

The base URL (path segment) where the documentation will be served from.

--html-template

HTML template. Defaults to the ./freki-template.html or the ~/.config/freki/freki-template.html file if available.

--config

Configuration file. Defaults to the ./freki-config.json file if available.

§ Priority

  1. frontmatter
  2. args
  3. config
  4. defaults

§ Global Config

The ~/.config/freki directory can used to store global defaults by adding a freki-template.html file and/or assets/ directory.

§ Build Site

§ Basic

To build the most bare bones site only the following is needed.

  1. A ./docs directory.
  2. A /docs/index.md file.
mkdir ./docs
echo "# Hello world." > ./docs/index.md
docs
└── index.md

Running freki will generate the site to the ./html-docs directory.

html-docs
└── index.html
<!DOCTYPE html>
<html
  lang="en"
  class="dark"
  data-theme="dark"
>
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="Freki">
    <title>Freki</title>
  </head>

  <body>
    <header>
      <h1>
        <a href="/">
          Freki
        </a>
      </h1>
    </header>
    <main>
      <article>
        <section>
          <h1>Hello world.</h1>
        </section>
      </article>
    </main>
  </body>
</html>

§ Custom Build

  1. In the project directory initialize a freki-template.html file.

  2. Create a ./custom-docs/ directory and add markdown and other files (style, scripts, and images)

  3. Add additional assets to ./extra-assets directory.

    project-directory
    ├── freki-template.html
    ├── custom-docs
    │   ├── index.md
    │   ├── cats.md
    │   ├── cat.svg
    │   ├── color.css
    └── extra-assets
        ├── mermaid.js
        └── prism.js
    
  4. Run freki with flags

    freki --directory ./custom-docs/ --assets ./extra-assets --output ./custom-site
    
    project-directory
    └── custom-site
        ├── index.html
        ├── cats
        │   └── index.html
        ├── cat.svg
        ├── color.css
        ├── mermaid.js
        └── prism.js