Skip to main content

Slate backend for Foliant documentation generator.

Project description

Slate Backend for Foliant

Slate backend generates API documentation from Markdown using Slate docs generator.

This backend operates two targets:

  • site — build a standalone website;
  • slate — generate a slate project out from your Foliant project.

Installation

$ pip install foliantcontrib.slate

Usage

To use this backend Slate should be installed in your system. Follow the instruction in Slate repo.

To test if you've installed Slate properly head to the cloned Slate repo in your terminal and try the command below. You should get similar response.

$ bundle exec middleman
== The Middleman is loading
== View your site at ...
== Inspect your site configuration at ...

To convert Foliant project to Slate:

$ foliant make slate
✔ Parsing config
✔ Making slate
─────────────────────
Result: My_Project-2018-09-19.src/

Build a standalone website:

$ foliant make site
✔ Parsing config
✔ Making site
─────────────────────
Result: My_Project-2018-09-19.slate/

Config

You don't have to put anything in the config to use Slate backend. If it is installed, Foliant detects it.

To customize the output, use options in backend_config.slate section:

backend_config:
  slate:
    shards: data/shards
    header:
        title: My API documentation
        language_tabs:
          - xml: Response example
        search: true

shards : Path to the shards directory relative to Foliant project dir or list of such paths. Shards allow you to customize Slate's layout, add scripts etc. More info on shards in the following section. Default: shards

header : Params to be copied into the beginning of Slate main Markdown file index.html.md. They allow you to change the title of the website, toggle search and add language tabs. More info in Slate Wiki.

About shards

Shards is just a folder with files which will be copied into the generated Slate project replacing all files in there. If you follow the Slate project structure you can replace stylesheets, scripts, images, layouts etc to customize the view of the resulting site.

If shards is a string — it is considered a path to single shards directory relative to Foliant project dir:

slate:
    shards: 'data/shards'

If shards is a list — each list item is considered as a shards dir. They will be copied into the Slate project subsequently with replace.

slate:
    shards:
        - 'common/shards'
        - 'custom/shards'
        - 'new_design'

For example, I want to customize standard Slate stylesheets. I look at the Slate repo and see that they lie in the folder <slate>/source/stylesheets. I create new stylesheets with the same names as the original ones and put them into my shards dir like that:

shards\
    source\
        stylesheets\
            _variables.scss
            screen.css.scss

These stylesheets will replace the original ones in the Slate project just before the website is be baked. So the page will have my styles in the end.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

foliantcontrib.slate-1.0.7.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

foliantcontrib.slate-1.0.7-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file foliantcontrib.slate-1.0.7.tar.gz.

File metadata

  • Download URL: foliantcontrib.slate-1.0.7.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.1

File hashes

Hashes for foliantcontrib.slate-1.0.7.tar.gz
Algorithm Hash digest
SHA256 20c743a13811e241ae08e43675b7095bb58acbc9f5baba2dc69c42364272618e
MD5 a3473ea1b6d6a24004351e1d386654ac
BLAKE2b-256 89c166bdba4d19c64bcff7f32276084ddb56cee3957ebe51fc127caa949f2e0f

See more details on using hashes here.

File details

Details for the file foliantcontrib.slate-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: foliantcontrib.slate-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.1

File hashes

Hashes for foliantcontrib.slate-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e355d697e7778be2f1d37b59d295eebcf51c6af99a10efd47396e6eb7bc7a89d
MD5 dd25b9323c653adb8c5f4e16ca54c76d
BLAKE2b-256 f1c763700869fa70d5bed2fa60fa3df92a27730dcbea9e4600ea14759e6237f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page