🐺 Freki

Β§ 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.

Β§ 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