Skip to content

Commit

Permalink
Implement plugin documentation generator (#86)
Browse files Browse the repository at this point in the history
Co-authored-by: traut <[email protected]>
  • Loading branch information
dobarx and traut authored Feb 16, 2024
1 parent 48038cc commit 924170e
Show file tree
Hide file tree
Showing 17 changed files with 735 additions and 13 deletions.
1 change: 1 addition & 0 deletions .github/styles/config/vocabularies/fabric-vocab/accept.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
GitHub
Fabric
boolean
namespace
9 changes: 0 additions & 9 deletions docs/plugins.md

This file was deleted.

16 changes: 16 additions & 0 deletions docs/plugins/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: Plugins
type: docs
weight: 5
---

# Plugins

Fabric relies on plugins to implement data sources and content providers. To utilise a plugin's data sources and content providers, it must be installed by Fabric. The global configuration should specify all required plugins (see [Global configuration]({{< ref "../language/configs.md/#global-configuration" >}}) for the details). Additionally, some data sources and content providers require configuration (for example, API keys, URLs, credentials, etc).

A plugin name consists of a namespace (a name of a plugin vendor) and a short name. For example, `blackstork/elasticsearch` plugin implements Elasticsearch client data source and is released by [BlackStork](https://blackstork.io).

## Where to get the plugins

Plugins are released and distributed independently from Fabric, with their own release cycle and version.
You can find a list of plugins released by BlackStork at the [Releases page](https://github.com/blackstork-io/fabric/releases) in Fabric GitHub.
163 changes: 163 additions & 0 deletions docs/plugins/builtin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
---
title: Built-in
weight: 10
type: docs
---

# Built-in data sources and content providers

`fabric` binary includes a set of built-in data sources and content providers, available out-of-the-box.

## Data sources

### `csv`

#### Configuration

The data source supports the following configuration parameters:

```hcl
config data csv {
delimiter = <string> # optional
}
```

#### Usage

The data source supports the following parameters in the data blocks:

```hcl
data csv {
path = <string> # required
}
```

### `inline`

#### Configuration

The data source doesn't support configuration.

#### Usage

The data source doesn't define any parameters in the `data` block.

### `json`

#### Configuration

The data source doesn't support configuration.

#### Usage

The data source supports the following parameters in the data blocks:

```hcl
data json {
glob = <string> # required
}
```

### `txt`

#### Configuration

The data source doesn't support configuration.

#### Usage

The data source supports the following parameters in the data blocks:

```hcl
data txt {
path = <string> # required
}
```

## Content providers

### `frontmatter`

#### Configuration

The content provider doesn't support configuration.

#### Usage

The content source supports the following parameters in the content blocks:

```hcl
content frontmatter {
content = <map of dynamic> # optional
format = <string> # optional
}
```

### `image`

#### Configuration

The content provider doesn't support configuration.

#### Usage

The content source supports the following parameters in the content blocks:

```hcl
content image {
alt = <string> # optional
src = <string> # required
}
```

### `list`

#### Configuration

The content provider doesn't support configuration.

#### Usage

The content source supports the following parameters in the content blocks:

```hcl
content list {
format = <string> # optional
item_template = <string> # required
}
```

### `table`

#### Configuration

The content provider doesn't support configuration.

#### Usage

The content source supports the following parameters in the content blocks:

```hcl
content table {
columns = <list of object> # required
}
```

### `text`

#### Configuration

The content provider doesn't support configuration.

#### Usage

The content source supports the following parameters in the content blocks:

```hcl
content text {
absolute_title_size = <number> # optional
code_language = <string> # optional
format_as = <string> # optional
text = <string> # required
}
```
56 changes: 56 additions & 0 deletions docs/plugins/elasticsearch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: blackstork/elasticsearch
weight: 20
type: docs
---

# `blackstork/elasticsearch` plugin

## Installation

To install the plugin, add it to `plugin_versions` map in the Fabric global configuration block (see [Global configuration]({{< ref "configs.md#global-configuration" >}}) for more details), with a version constraint restricting which available versions of the plugin the codebase is compatible with:

```hcl
fabric {
plugin_versions = {
"blackstork/elasticsearch" = "=> v0.0.0-dev"
}
}
```

## Data sources

The plugin has the following data sources available:

### `elasticsearch`

#### Configuration

The data source supports the following configuration parameters:

```hcl
config data elasticsearch {
api_key = <list of string> # optional
api_key_str = <string> # optional
base_url = <string> # required
basic_auth_password = <string> # optional
basic_auth_username = <string> # optional
bearer_auth = <string> # optional
ca_certs = <string> # optional
cloud_id = <string> # optional
}
```

#### Usage

The data source supports the following parameters in the data blocks:

```hcl
data elasticsearch {
fields = <list of string> # optional
id = <string> # optional
index = <string> # required
query = <map of dynamic> # optional
query_string = <string> # optional
}
```
55 changes: 55 additions & 0 deletions docs/plugins/github.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: blackstork/github
weight: 20
type: docs
---

# `blackstork/github` plugin

## Installation

To install the plugin, add it to `plugin_versions` map in the Fabric global configuration block (see [Global configuration]({{< ref "configs.md#global-configuration" >}}) for more details), with a version constraint restricting which available versions of the plugin the codebase is compatible with:

```hcl
fabric {
plugin_versions = {
"blackstork/github" = "=> v0.0.0-dev"
}
}
```

## Data sources

The plugin has the following data sources available:

### `github_issues`

#### Configuration

The data source supports the following configuration parameters:

```hcl
config data github_issues {
github_token = <string> # required
}
```

#### Usage

The data source supports the following parameters in the data blocks:

```hcl
data github_issues {
assignee = <string> # optional
creator = <string> # optional
direction = <string> # optional
labels = <list of string> # optional
limit = <number> # optional
mentioned = <string> # optional
milestone = <string> # optional
repository = <string> # required
since = <string> # optional
sort = <string> # optional
state = <string> # optional
}
```
46 changes: 46 additions & 0 deletions docs/plugins/graphql.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: blackstork/graphql
weight: 20
type: docs
---

# `blackstork/graphql` plugin

## Installation

To install the plugin, add it to `plugin_versions` map in the Fabric global configuration block (see [Global configuration]({{< ref "configs.md#global-configuration" >}}) for more details), with a version constraint restricting which available versions of the plugin the codebase is compatible with:

```hcl
fabric {
plugin_versions = {
"blackstork/graphql" = "=> v0.0.0-dev"
}
}
```

## Data sources

The plugin has the following data sources available:

### `graphql`

#### Configuration

The data source supports the following configuration parameters:

```hcl
config data graphql {
auth_token = <string> # optional
url = <string> # required
}
```

#### Usage

The data source supports the following parameters in the data blocks:

```hcl
data graphql {
query = <string> # required
}
```
Loading

0 comments on commit 924170e

Please sign in to comment.