diff --git a/.assets/diagram.svg b/.assets/diagram.svg
deleted file mode 100644
index 80706929..00000000
--- a/.assets/diagram.svg
+++ /dev/null
@@ -1,107 +0,0 @@
-
diff --git a/.github/diagram.png b/.github/diagram.png
new file mode 100644
index 00000000..13713480
Binary files /dev/null and b/.github/diagram.png differ
diff --git a/.assets/fabric.svg b/.github/fabric.svg
similarity index 100%
rename from .assets/fabric.svg
rename to .github/fabric.svg
diff --git a/.github/styles/config/vocabularies/fabric-vocab/accept.txt b/.github/styles/config/vocabularies/fabric-vocab/accept.txt
index 75d5e680..4979bbae 100644
--- a/.github/styles/config/vocabularies/fabric-vocab/accept.txt
+++ b/.github/styles/config/vocabularies/fabric-vocab/accept.txt
@@ -1,4 +1,8 @@
-GitHub
Fabric
+GitHub
boolean
namespace
+Sonoma
+API
+LLM
+Splunk
diff --git a/README.md b/README.md
index a727af7d..f89d879e 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-
+
@@ -14,39 +14,102 @@ Codifying and automating mission-critical communications with standardized and r
-> [!NOTE]
-> Fabric is currently in the early stages of development, and there may be some issues. If you have any suggestions, ideas, or encounter bugs, please share them in [Fabric Community slack](https://fabric-community.slack.com/).
-
-Fabric is an open-source CLI tool and a configuration language that codifies and automates content generation.
+**Fabric** is an open-source Command Line Interface (CLI) tool coupled with a configuration language designed to encode and automate content generation for cyber-security and compliance.
-
+
-Fabric produces Markdown documents from the templates that define data requirements and content structure. The templates are written in Fabric Configuration Language and consist of reusable blocks, powered by plugins.
-Data blocks fetch data from various external sources -- data stores, security solutions, and platforms. The content blocks render the template into a Markdown document.
+Fabric generates documents based on modular templates written in [Fabric Configuration Language](https://blackstork.io/fabric/docs/language/) (FCL). Template authors can delineate data requirements and content structures within the template, significantly reducing the manual effort associated with data consolidation and improving re-usability.
+
+The plugin ecosystem expands Fabric's capabilities by offering integrations with various platforms, data stores, and security solutions, including [JSON/CSV files](https://blackstork.io/fabric/docs/plugins/builtin/), [Elastic](https://blackstork.io/fabric/docs/plugins/elastic/), [OpenCTI](https://blackstork.io/fabric/docs/plugins/opencti/), [Splunk Cloud](https://blackstork.io/fabric/docs/plugins/splunk/), [GitHub](https://blackstork.io/fabric/docs/plugins/github/), and more. A comprehensive list of supported plugins is available in [the documentation](https://blackstork.io/fabric/docs/plugins/).
+
+To facilitate flexible content generation, Fabric content providers leverage powerful [Go templates](https://pkg.go.dev/text/template) and incorporate capabilities such as generative AI/LLMs (OpenAI API, Azure OpenAI, etc).
-See [Documentation](https://blackstork.io/fabric/docs/) for more details on the Fabric language and Fabric CLI.
+Refer to [the documentation](https://blackstork.io/fabric/docs/) for in-depth details about Fabric.
+
+> [!NOTE]
+> Fabric is currently in the early stages of development, and there may be some issues. If you have any suggestions, ideas, or bug reports, please share them in [Fabric Community slack](https://fabric-community.slack.com/).
# Installation
-To get started with Fabric, follow these simple steps for installation across various operating systems:
+## Installing Fabric
+
+Fabric binaries for Windows, macOS, and Linux are available at ["Releases"](https://github.com/blackstork-io/fabric/releases) page in the project's GitHub.
+
+To install Fabric:
+
+- **download a release archive**: choose and download Fabric release archive appropriate for your operating system (Windows, macOS/Darwin, or Linux) and architecture from ["Releases"](https://github.com/blackstork-io/fabric/releases) page;
+- **unpack**: extract the contents of the downloaded release archive into a preferred directory.
+
+For example, the steps for macOS (arm64) are:
+
+```bash
+# Create a folder
+mkdir fabric-bin
+
+# Download the latest release of Fabric
+wget https://github.com/blackstork-io/fabric/releases/latest/download/fabric_darwin_arm64.tar.gz \
+ -O ./fabric_darwin_arm64.tar.gz
+
+# Unpack Fabric release archive into `fabric-bin` folder
+tar -xvzf ./fabric_darwin_arm64.tar.gz -C ./fabric-bin
+
+# Verify that `fabric` runs
+./fabric-bin/fabric --help
+```
-- **download release archives**: choose and download the appropriate release for your operating system (Windows, macOS/Darwin, or Linux) and architecture in ["Releases" section](https://github.com/blackstork-io/fabric/releases);
-- **unpack the archives**: extract the contents of the downloaded archives to a preferred directory;
+## Installing Fabric plugins
-That's it! You're now ready to use Fabric. For more details on usage and configuration options, refer to the "Usage" paragraph below or [Fabric CLI](https://blackstork.io/fabric/docs/cli) documentation.
+Fabric relies on [the plugins](https://blackstork.io/fabric/docs/plugins/) for implementing the integrations with various data sources, platforms, and services.
+
+Before the plugins can be used during the template rendering, they must be installed. Fabric's sub-command `install` can install the plugins automatically from the registry.
+
+To install the plugins:
+
+- **add all necessary plugins into the global configuration**: [the global configuration](https://blackstork.io/fabric/docs/language/configs/#global-configuration) has a list of plugins dependencies in `plugin_versions` map. Add the plugins you would like to install in the map with a preferred version constraint.
+
+ ```hcl
+ fabric {
+ plugin_versions = {
+ "blackstork/openai" = ">= 0.0.1",
+ "blackstork/elastic" = ">= 0.0.1",
+ }
+ }
+ ```
+
+- **install the plugins**: run `install` sub-command to install the plugins. For example:
+
+ ```bash
+ $ ./fabric install
+ Mar 11 19:20:09.085 INF Searching plugin name=blackstork/elastic constraints=">=v0.0.1"
+ Mar 11 19:20:09.522 INF Installing plugin name=blackstork/elastic version=0.4.0
+ Mar 11 19:20:10.769 INF Searching plugin name=blackstork/openai constraints=">=v0.0.1"
+ Mar 11 19:20:10.787 INF Installing plugin name=blackstork/openai version=0.4.0
+ $
+ ```
+
+The plugins are downloaded and installed in `./fabric` folder.
+
+{{< hint note >}}
+
+> [!NOTE]
+> It's not necessary to install any plugins if you are only using built-in [data sources](https://blackstork.io/fabric/docs/plugins/builtin/#data-sources) and [content providers](https://blackstork.io/fabric/docs/plugins/builtin/#content-providers) in your templates
# Usage
-The command line interface to Fabric is `fabric` CLI tool. It supports two sub-commands:
+The command line interface to Fabric is `fabric` CLI tool.
+
+The core sub-commands are:
+- `install` — installs all required plugins.
- `data` — executes the data block and prints out prettified JSON to standard output.
-- `render` — renders the specified target (a document template) into Markdown and outputs the result to standard output or to a file.
+- `render` — renders the specified target (a document template) and prints out the result to standard output or to a file.
-```text
-$ fabric --help
+To get more details, run `fabric --help`:
+```text
+$ ./fabric --help
Usage:
fabric [command]
@@ -54,24 +117,22 @@ Available Commands:
completion Generate the autocompletion script for the specified shell
data Execute a single data block
help Help about any command
+ install Install plugins
render Render the document
Flags:
- --color enables colorizing the logs and diagnostics (if supported by the terminal and log format) (default true)
- -h, --help help for fabric
- --log-format string format of the logs (plain or json) (default "plain")
- --log-level string logging level ('debug', 'info', 'warn', 'error') (default "info")
- --plugins-dir string override for plugins dir from fabric configuration
- --source-dir string a path to a directory with *.fabric files (default ".")
- -v, --verbose a shortcut to --log-level debug
- --version version for fabric
+ --color enables colorizing the logs and diagnostics (if supported by the terminal and log format) (default true)
+ -h, --help help for fabric
+ --log-format string format of the logs (plain or json) (default "plain")
+ --log-level string logging level ('debug', 'info', 'warn', 'error') (default "info")
+ --source-dir string a path to a directory with *.fabric files (default ".")
+ -v, --verbose a shortcut to --log-level debug
+ --version version for fabric
Use "fabric [command] --help" for more information about a command.
```
-## Source directory
-
-Fabric loads `*.fabric` files from a source directory. By default, the current directory (`.`) is a source directory. If you wish to specify a different location, use `--source-dir` argument when running `fabric`.
+# Templates
You can find a collection of free Fabric templates in [Fabric Templates](https://github.com/blackstork-io/fabric-templates) repository.
@@ -81,9 +142,9 @@ Visit [https://blackstork.io/fabric/docs/](https://blackstork.io/fabric/docs/) f
# Security
-Please report any suspected security vulnerabilities through GitHub's [security advisory reporting](https://github.com/blackstork-io/fabric/security/advisories/new). We treat every report with utmost seriousness and will conduct a comprehensive investigation.
+If you suspect any security vulnerabilities within Fabric, please promptly report them using GitHub's [security advisory reporting](https://github.com/blackstork-io/fabric/security/advisories/new). Every report is treated with the utmost seriousness, and we commit to conducting a thorough investigation.
-We kindly request that you talk to us before making any public disclosures. This ensures that no excessive information is revealed before a patch is ready and users have enough time to upgrade.
+We kindly request that you engage in a conversation with us before making any public disclosures. This precautionary step ensures that no excessive information is divulged prematurely, allowing us to prepare a patch. Additionally, it provides users with enough time to upgrade and enhance their system security.
# License
diff --git a/docs/_index.md b/docs/_index.md
index c0461b79..a0569ad1 100644
--- a/docs/_index.md
+++ b/docs/_index.md
@@ -16,6 +16,9 @@ Fabric Configuration Language (FCL) allows users to define the document data req
## Get started
- [Install]({{< ref "install.md" >}}) — how to install and run Fabric.
-- [Language]({{< ref "language.md" >}}) — Fabric Configuration Language details and main concepts.
- [Fabric CLI]({{< ref "cli.md" >}}) — Fabric CLI usage details.
+- [Tutorial]({{< ref "tutorial.md" >}}) — an extensive tutorial for starting with Fabric.
+- [Language]({{< ref "language.md" >}}) — Fabric Configuration Language details and main concepts.
+- [Data Sources]({{< ref "data-sources.md" >}}) — the data sources supported.
+- [Content Providers]({{< ref "content-providers.md" >}}) — the content providers supported.
- [Plugins]({{< ref "plugins.md" >}}) — the documentation for the plugins Fabric supports.
diff --git a/docs/cli.md b/docs/cli.md
index eb4a7501..4a117f1a 100644
--- a/docs/cli.md
+++ b/docs/cli.md
@@ -1,19 +1,23 @@
---
title: Fabric CLI
type: docs
-weight: 4
+weight: 20
---
# Fabric CLI
-The command line interface to Fabric is `fabric` CLI tool. It supports two sub-commands:
+The command line interface to Fabric is `fabric` CLI tool.
-- `fabric data` — executes the data block and prints out prettified JSON to standard output
-- `fabric render` — renders the specified target (a document template) into Markdown and outputs the result to standard output or to a file.
+The core sub-commands are:
-```text
-$ fabric --help
+- `install` — installs all required plugins, listed in the [global configuration]({{< ref "language/configs.md#global-configuration" >}}). See [plugin installation docs]({{< ref "install.md#installing-plugins" >}}) for more details.
+- `data` — executes the data block and prints out prettified JSON to standard output.
+- `render` — renders the specified target (a document template) and prints out the result to standard output or to a file.
+
+To get more details, run `fabric --help`:
+```text
+$ ./fabric --help
Usage:
fabric [command]
@@ -21,22 +25,25 @@ Available Commands:
completion Generate the autocompletion script for the specified shell
data Execute a single data block
help Help about any command
+ install Install plugins
render Render the document
Flags:
- --color enables colorizing the logs and diagnostics (if supported by the terminal
- and log format) (default true)
- -h, --help help for fabric
- --log-format string format of the logs (plain or json) (default "plain")
- --log-level string logging level ('debug', 'info', 'warn', 'error') (default "info")
- --plugins-dir string override for plugins dir from fabric configuration
- --source-dir string a path to a directory with *.fabric files (default ".")
- -v, --verbose a shortcut to --log-level debug
- --version version for fabric
+ --color enables colorizing the logs and diagnostics (if supported by the terminal and log format) (default true)
+ -h, --help help for fabric
+ --log-format string format of the logs (plain or json) (default "plain")
+ --log-level string logging level ('debug', 'info', 'warn', 'error') (default "info")
+ --source-dir string a path to a directory with *.fabric files (default ".")
+ -v, --verbose a shortcut to --log-level debug
+ --version version for fabric
Use "fabric [command] --help" for more information about a command.
```
## Source directory
-Fabric loads `*.fabric` files from a source directory. By default, a source directory is the current directory (`.`). To load Fabric files from a different location, set `--source-dir` argument when running `fabric`.
+Fabric loads `*.fabric` files from a source directory. By default, a source directory is the current directory (`.`) but it's possible to set `--source-dir` argument when running `fabric` to load files from a different location.
+
+## Next step
+
+Take a look at [the tutorial]({{< ref "tutorial.md" >}}) to see the commands in action.
diff --git a/docs/content-providers.md b/docs/content-providers.md
new file mode 100644
index 00000000..1c851f42
--- /dev/null
+++ b/docs/content-providers.md
@@ -0,0 +1,9 @@
+---
+title: Content Providers
+type: docs
+weight: 58
+---
+
+# Content providers
+
+{{< plugin-resources "" "content-provider" >}}
diff --git a/docs/data-sources.md b/docs/data-sources.md
new file mode 100644
index 00000000..3d0244ba
--- /dev/null
+++ b/docs/data-sources.md
@@ -0,0 +1,9 @@
+---
+title: Data Sources
+type: docs
+weight: 52
+---
+
+# Data sources
+
+{{< plugin-resources "" "data-source" >}}
diff --git a/docs/install.md b/docs/install.md
index eb2d9441..30a5568c 100644
--- a/docs/install.md
+++ b/docs/install.md
@@ -1,19 +1,22 @@
---
title: Install
type: docs
-weight: 2
+weight: 10
+code_blocks_no_wrap: true
---
# Install
-## GitHub releases
+## Installing Fabric
-The archives of compiled binaries for Fabric and Fabric plugins are available for Windows, macOS, and Linux at the project's ["Releases"](https://github.com/blackstork-io/fabric/releases) page.
+### GitHub releases
-To get started with Fabric:
+Fabric binaries for Windows, macOS, and Linux are available at ["Releases"](https://github.com/blackstork-io/fabric/releases) page in the project's GitHub.
-- **download release archives**: choose and download the appropriate Fabric and Fabric plugin releases for your operating system (Windows, macOS/Darwin, or Linux) and architecture from ["Releases" section](https://github.com/blackstork-io/fabric/releases);
-- **unpack the archives**: extract the contents of the downloaded archives to a preferred directory;
+To install Fabric:
+
+- **download a release archive**: choose and download Fabric release archive appropriate for your operating system (Windows, macOS/Darwin, or Linux) and architecture from ["Releases"](https://github.com/blackstork-io/fabric/releases) page;
+- **unpack**: extract the contents of the downloaded release archive into a preferred directory;
For example, the steps for macOS (arm64) are:
@@ -24,17 +27,49 @@ mkdir fabric-bin
# Download the latest release of Fabric
wget https://github.com/blackstork-io/fabric/releases/latest/download/fabric_darwin_arm64.tar.gz -O ./fabric_darwin_arm64.tar.gz
-# Download the latest release of Fabric plugins
-wget https://github.com/blackstork-io/fabric/releases/latest/download/plugins_darwin_arm64.tar.gz -O ./plugins_darwin_arm64.tar.gz
-
# Unpack Fabric release archive into `fabric-bin` folder
tar -xvzf ./fabric_darwin_arm64.tar.gz -C ./fabric-bin
-# Unpack Fabric plugins release archive into `fabric-bin` folder
-tar -xvzf ./plugins_darwin_arm64.tar.gz -C ./fabric-bin
-
# Verify that `fabric` runs
./fabric-bin/fabric --help
```
-That's it! You're now ready to use Fabric. For more details on usage and configuration options, refer [Fabric CLI]({{< ref "cli.md" >}}) documentation.
+## Installing plugins
+
+Fabric relies on [the plugins]({{< ref "plugins.md" >}}) for implementing the integrations with various data sources, platforms, and services. Before the plugins can be used during the template rendering, they must be installed. Fabric's sub-command `install` can install the plugins automatically from the registry (`https://registry.blackstork.io`).
+
+To install the plugins:
+
+- **add all necessary plugins into the global configuration**: [the global configuration]({{< ref "language/configs.md#global-configuration" >}}) has a list of plugins dependencies in `plugin_versions` map. Add the plugins you would like to install in the map with a preferred version constraint.
+
+ ```hcl
+ fabric {
+ plugin_versions = {
+ "blackstork/openai" = ">= 0.0.1",
+ "blackstork/elastic" = ">= 0.0.1",
+ }
+ }
+ ```
+
+- **install the plugins**: run `install` sub-command to install the plugins. For example:
+
+ ```bash
+ $ ./fabric install
+ Mar 11 19:20:09.085 INF Searching plugin name=blackstork/elastic constraints=">=v0.0.1"
+ Mar 11 19:20:09.522 INF Installing plugin name=blackstork/elastic version=0.4.0
+ Mar 11 19:20:10.769 INF Searching plugin name=blackstork/openai constraints=">=v0.0.1"
+ Mar 11 19:20:10.787 INF Installing plugin name=blackstork/openai version=0.4.0
+ $
+ ```
+
+The plugins are downloaded and installed in `./fabric` folder or in the location specified in `cache_dir` in [the global configuration]({{< ref "language/configs.md#global-configuration" >}}).
+
+{{< hint note >}}
+
+It's not necessary to install any plugins if you are only using built-in [data sources]({{< ref "plugins/builtin/_index.md#data-sources" >}}) and [content providers]({{< ref "plugins/builtin/_index.md#content-providers" >}}) in your templates
+
+{{ hint >}}
+
+## Next step
+
+That's it! You're now ready to use Fabric. Take a look at [the tutorial]({{< ref "tutorial.md" >}}) to see how to create and render the templates.
diff --git a/docs/language/_index.md b/docs/language/_index.md
index 6a1c9752..4af0b262 100644
--- a/docs/language/_index.md
+++ b/docs/language/_index.md
@@ -1,25 +1,23 @@
---
title: Language
type: docs
-weight: 2
+weight: 40
---
# Fabric configuration language
-Fabric Configuration Language (FCL) serves as the core feature for Fabric — a powerful tool designed to streamline document generation. FCL enables users to express data requirements and template structures within configuration files with lightweight syntax.
+Fabric Configuration Language (FCL) serves as the core feature for Fabric, a powerful tool designed to streamline document generation. FCL enables users to express data requirements and template structures within configuration files using a lightweight syntax.
-The document templates defined in the configuration files act as blueprints for data consolidation and creation of Markdown documents.
+The document templates, defined in the configuration files, act as blueprints for consolidating data and creating Markdown documents. FCL empowers users to define, manage, and automate the document production process, delivering a sturdy and adaptable solution for content generation.
-FCL empowers users to define, manage, and automate the document production process, delivering a sturdy and adaptable solution for content generation.
-
-Fabric configuration files have extension `.fabric` and contain configurations, data requirements and content definitions. Fabric configuration codebase can consist of many files and sub-directories.
+Fabric configuration files have the extension `.fabric` and contain configurations, data requirements, and content definitions. The Fabric configuration codebase may consist of many files and subdirectories.
## Core concepts
-Similar to [Terraform Configuration Language](https://developer.hashicorp.com/terraform/language), Fabric language builds upon [HashiCorp Configuration Language](https://github.com/hashicorp/hcl) (HCL), and consists of two core elements:
+Building upon the [HashiCorp Configuration Language](https://github.com/hashicorp/hcl) (HCL), Fabric language shares similarities with the [Terraform Configuration Language](https://developer.hashicorp.com/terraform/language) and comprises two fundamental elements:
-- **Blocks** are containers that define an object, like a configuration, a data requirement or a content structure. Blocks always have a block type and zero or more labels.
-- **Arguments** assign a value to a name inside a blocks.
+- **Blocks**: serve as containers defining objects, such as configurations, data requirements, or content structures. Blocks always include a block type and may have zero or more labels.
+- **Arguments** assign values to names within blocks, facilitating the configuration process.
```hcl
# Named data block:
@@ -33,15 +31,12 @@ data elasticsearch "alerts" {
=
}
-
# Anonymous configuration block for a data plugin:
-
config data elasticsearch {
cloud_id = "my-elastic-cloud-id"
api_key = "my-elastic-cloud-api-key"
}
-
{
=
}
@@ -51,8 +46,8 @@ See [Syntax](./syntax/) for more details on the FCL syntax.
## IDE support
-Since Fabric configuration language builds on HCL, IDE extensions for HCL syntax highlighting will work with Fabric files as well. You might need to explicitly set a file type for `*.fabric` files to HCL.
+Given that Fabric configuration language is built on HCL, IDE extensions designed for HCL syntax highlighting are applicable to Fabric files. It may be necessary to explicitly set the file type for `*.fabric` files to HCL.
-If you are using Microsoft Visual Studio Code, take a look at [Fabric Extension for Visual Studio Code](https://github.com/blackstork-io/vscode-fabric).
+For users of Microsoft Visual Studio Code, there is a dedicated [Fabric Extension for Visual Studio Code](https://github.com/blackstork-io/vscode-fabric) available, providing enhanced support for Fabric configurations within the IDE.
![A screenshot of Fabric Extension for Visual Studio Code](./vscode-fabric-screenshot.png)
diff --git a/docs/language/configs.md b/docs/language/configs.md
index c3351b02..53e6b4f8 100644
--- a/docs/language/configs.md
+++ b/docs/language/configs.md
@@ -8,7 +8,7 @@ weight: 20
## Global configuration
-The `fabric` configuration block defines a global configuration for Fabric. It's used for defining plugin dependencies, the paths to local directories, etc.
+The `fabric` configuration block serves as the global configuration for Fabric, offering a centralized space for defining essential aspects such as plugin dependencies and local directory paths.
```hcl
fabric {
@@ -16,24 +16,26 @@ fabric {
}
```
-There can be only one `fabric` block defined within the codebase.
+Within the codebase, only one `fabric` block can be defined.
### Supported arguments
-- `plugin_versions`: (required) a map that matches name-spaced plugin names to the version constraints in SemVer (see Terraform [version constraint syntax](https://developer.hashicorp.com/terraform/language/expressions/version-constraints#version-constraint-syntax)).
-- `cache_dir`: (optional) a path to a directory on the local file system. The default value is `.fabric` directory in the current folder. If the directory doesn't exist, Fabric will create it on the first run.
+- `plugin_versions`: (required) a map that aligns namespaced plugin names with version constraints in SemVer (refer to Terraform [version constraint syntax](https://developer.hashicorp.com/terraform/language/expressions/version-constraints#version-constraint-syntax)).
+- `cache_dir`: (optional) a path to a directory on the local file system. The default value is `.fabric` directory in the current folder. If the directory doesn't exist, Fabric creates it upon the first run.
### Supported nested blocks
-- `plugin_registry` – (optional) a block that defines available plugin registries. At the moment, the block accepts only one attribute:
+- `plugin_registry`: (optional) a block defines available plugin registries and can include the following arguments:
```hcl
plugin_registry {
+ base_url = ""
mirror_dir = ""
}
```
- - `mirror_dir` – (optional) a path to a directory on the local filesystem with plugin binaries.
+ - `base_url`: (optional) the base URL of the plugin registry. Default value: `https://registry.blackstork.io`
+ - `mirror_dir`: (optional) the path to a directory on the local filesystem containing plugin binaries.
### Example
@@ -47,7 +49,7 @@ fabric {
}
plugin_versions = {
- "blackstork/elasticsearch" = "1.2.3"
+ "blackstork/elastic" = "1.2.3"
"blackstork/openai" = "=11.22.33"
}
}
@@ -57,9 +59,9 @@ fabric {
A Fabric plugin can include one or more data sources. For example, `blackstork/github` plugin includes `github_issues` data source.
-A data source loads data from a local or an external data store, platform, and service.
+A data source within Fabric serves the purpose of loading data from either a local or an external data store, platform, or service.
-Data sources are configured using `config` block:
+Configuration for data sources is accomplished through the use of the `config` block:
```hcl
config data "" {
@@ -148,3 +150,7 @@ document "test-document" {
}
}
```
+
+## Next steps
+
+See [Documents]({{< ref "documents.md" >}}) to learn how to build document templates in Fabric configuration language.
diff --git a/docs/language/content-blocks.md b/docs/language/content-blocks.md
index 3888f2df..8c6bca35 100644
--- a/docs/language/content-blocks.md
+++ b/docs/language/content-blocks.md
@@ -6,21 +6,22 @@ weight: 60
# Content blocks
-`content` blocks define document segments: text paragraphs, tables, graphs, lists, etc. The order of the `content` blocks in the template determines the order of the generated content in the document.
+`content` blocks define document segments: text paragraphs, tables, graphs, lists, etc. The block signature includes the name of the content provider that will execute the content block. Fabric supports many [content pproviders]({{< ref "content-providers.md" >}}) through its [plugin ecosystem]({{< ref "plugins.md" >}}).
```hcl
-# Root-level definition of the content block
+# Root-level definition of a content block
content "" {
...
}
document "foobar" {
- # In-document definition of the content block
+ # In-document named definition of a content block
content "" {
...
}
+ # In-document anonymous definition of a content block
content {
...
}
@@ -28,11 +29,13 @@ document "foobar" {
}
```
-If the block is defined at the root level of the file, outside of the `document` block, both names – the content provider name and the block name – are required. A combination of block type `content`, content provider name, and block name serves as a unique identifier of a block within the codebase.
+The order of the `content` blocks in the template determines the order of the generated content in the document.
+
+If the block is placed at the root level of the file, outside of the `document` block, both names – the content provider name and the block name – are required. A combination of block type `content`, content provider name, and block name serves as a unique identifier of a block within the codebase.
If the content block is defined within the document template, only a content provider name is required and a block name is optional.
-A content block is rendered by a specified content provider. See [Plugins]({{< ref "plugins.md" >}}) for the list of the content providers supported by Fabric.
+A content block is rendered by a specified content provider. See [Content Providers]({{< ref "content-providers.md" >}}) for the list of the content providers supported by Fabric.
## Supported arguments
@@ -51,19 +54,21 @@ The arguments provided in the block are either generic arguments or plugin-speci
Content provider specific are defined by a plugin specification. See [Plugins]({{< ref "plugins.md" >}}) for the details on the supported arguments per plugin.
+Content provider arguments differ per content provider. See the documentation for a specific content provider (find it in [supported content providers]({{< ref "content-providers.md" >}})) for the details on the supported arguments.
+
## Supported nested blocks
- `meta`: (optional) a block containing metadata for the block.
-- `config`: (optional) an inline configuration for the block. If provided, it takes precedence over the `config` argument and default configuration for the plugin.
+- `config`: (optional) an inline configuration for the block. If provided, it takes precedence over the `config` argument and default configuration for the content provider.
## Context
-When Fabric renders a content block, a corresponding content plugin is called. Along with the [content provider configuration]({{< ref "configs/#content-provider-configuration" >}}) and input parameters, a plugin receives the context object with all data available.
+When Fabric renders a content block, a corresponding content provider is executed. Along with the [configuration]({{< ref "configs/#content-provider-configuration" >}}) and the input parameters, the provider receives the context object with the data available for the provider.
The context object is a JSON dictionary with pre-defined root-level fields:
-- `data` points to a map of all resolved data definitions for the document. The JSON path to a specific data point follows the data block signature: `data..`.
-- `query_result` points to a result of the execution of a JQ query provided in `query` attribute, as requested by `query_input_required` attribute. This is mostly used in `ref` blocks to explicitly pre-filter the data for the JQ query set in `query` attribute.
+- `data` points to a map of all resolved data definitions for the document. The JSON path to a specific data point follows the data block signature: `data..`.
+- `query_result` points to a result of the execution of a JQ query provided in `query` argument.
## References
@@ -71,6 +76,8 @@ See [References]({{< ref references.md >}}) for the details about referencing co
## Example
+The template `document.test-doc` with one `data.inline` block, one `content.text` block and one `content.openai_text` block:
+
```hcl
config content openai_text "test_account" {
api_key = ""
@@ -103,9 +110,19 @@ document "test-doc" {
}
```
-produces the output
-```
+produces the following output:
+
+```text
There are 3 items
-In the vast expanse of the universe, three brave astronauts, aaa, bbb, and ccc, embarked on a daring mission of space exploration. As they soared through the galaxies, their unwavering determination and unyielding teamwork propelled them towards uncharted territories, uncovering hidden wonders and pushing the boundaries of human understanding. Together, aaa, bbb, and ccc, etched their names in the stars as pioneers of a new era, forever inspiring generations to dream beyond the confines of Earth.
+In the vast expanse of the universe, three brave astronauts, aaa, bbb, and ccc, embarked on
+a daring mission of space exploration. As they soared through the galaxies, their unwavering
+determination and unyielding teamwork propelled them towards uncharted territories,
+uncovering hidden wonders and pushing the boundaries of human understanding.
+Together, aaa, bbb, and ccc, etched their names in the stars as pioneers of a new era,
+forever inspiring generations to dream beyond the confines of Earth.
```
+
+## Next steps
+
+See [Section Blocks]({{< ref "section-blocks.md" >}}) documentation to learn how to group the content into the sections for better maintainability and re-usability.
diff --git a/docs/language/data-blocks.md b/docs/language/data-blocks.md
index e1f18e30..b37094cf 100644
--- a/docs/language/data-blocks.md
+++ b/docs/language/data-blocks.md
@@ -6,15 +6,17 @@ weight: 50
# Data blocks
-`data` blocks define data requirements for the template. In its signature, the block specifies the data source Fabric will fetch the data from.
+`data` blocks define data requirements for the template. The block signature includes the name of the data source that will execute the data block and load the data from external source. Fabric supports many [data sources]({{< ref "data-sources.md" >}}) through its [plugin ecosystem]({{< ref "plugins.md" >}}).
```hcl
+# Root-level definition of a data block
data "" {
...
}
document "foobar" {
+ # In-document definition of a data block
data "" {
...
}
@@ -30,20 +32,20 @@ When Fabric starts rendering the template, the data sources for the data blocks
## Supported arguments
-The arguments provided in the block are either generic arguments or plugin-specific input parameters.
+The arguments provided in the block are either generic arguments or data-source-specific input parameters.
### Generic arguments
- `config`: (optional) a reference to a named configuration block for the data source or a content provider. If provided, it takes precedence over the default configuration. See [Data source configuration]({{< ref "configs.md#data-source-configuration" >}}) for the details.
-### Plugin-specific Arguments
+### Data source arguments
-Plugin-specific arguments are defined by a plugin specification. See [Plugins]({{< ref "plugins.md" >}}) for the details on the supported arguments per plugin.
+Data source arguments differ per data source. See the documentation for a specific data source (find it in [supported data sources]({{< ref "data-sources.md" >}})) for the details on the supported arguments.
-## Supported Nested Blocks
+## Supported nested blocks
- `meta`: (optional) a block containing metadata for the block.
-- `config`: (optional) an inline configuration for the block. If provided, it takes precedence over the `config` argument and default configuration for the plugin.
+- `config`: (optional) an inline configuration for the block. If provided, it takes precedence over the `config` argument and default configuration for the content provider.
## References
@@ -52,7 +54,6 @@ See [References]({{< ref references.md >}}) for the details about referencing da
## Example
```hcl
-
config data csv {
delimiter = ";"
}
@@ -76,3 +77,7 @@ document "test-document" {
}
}
```
+
+## Next steps
+
+See [Content Blocks]({{< ref "content-blocks.md" >}}) documentation to learn how to define content, like text paragraphs, tables, graphs and images, in the template.
diff --git a/docs/language/documents.md b/docs/language/documents.md
index 13f6cbdc..7f80062b 100644
--- a/docs/language/documents.md
+++ b/docs/language/documents.md
@@ -10,14 +10,16 @@ Document blocks are the most important element of the Fabric configuration. `doc
```hcl
document "" {
+
+ title = ""
+
...
}
```
-A block type `document` and a document name are used as an unique identifier for the document template within the codebase.
-The document blocks must be on a root level of the configuration file and can not be inside other blocks.
+A block type `document` and a document name are an unique identifier for the document template within the codebase. The document blocks must defined be on a root level of the configuration file and can not be inside other blocks.
-The `document` block is a structure that groups the data definitions, the section, and the content blocks together.
+The `document` block is a structure that groups the data definitions, the sections, and the content blocks together, and describes the document to be rendered.
## Supported arguments
@@ -29,3 +31,7 @@ The `document` block is a structure that groups the data definitions, the sectio
- `data`: see [Data Blocks]({{< ref data-blocks.md >}}) for the details.
- `content`: see [Content Blocks]({{< ref content-blocks.md >}}) for the details.
- `section`: see [Section Blocks]({{< ref section-blocks.md >}}) for the details.
+
+## Next steps
+
+See [Data Blocks]({{< ref "data-blocks.md" >}}) documentation to learn how to define data requirements in the templates.
diff --git a/docs/language/syntax.md b/docs/language/syntax.md
index 5832b97b..3aff5cc0 100644
--- a/docs/language/syntax.md
+++ b/docs/language/syntax.md
@@ -6,13 +6,13 @@ weight: 10
# Syntax
-This page describes native syntax of the Fabric Configuration Language (FCL). FCL is based on [HCL](https://github.com/hashicorp/hcl/blob/main/hclsyntax/spec.md) (HashiCorp Configuration Language) favored by many applications for simplicity, readability, and clarity.
+This page describes the native syntax of the Fabric Configuration Language (FCL). Leveraging the foundation laid by the [HashiCorp Configuration Language](https://github.com/hashicorp/hcl/blob/main/hclsyntax/spec.md) (HCL), FCL aligns itself with a syntax favored by numerous applications for its simplicity, readability, and clarity.
-Fabric language syntax has two core components: arguments and blocks.
+The syntax of the Fabric language revolves around two fundamental components: arguments and blocks. These elements constitute the building blocks for crafting configurations within the Fabric Configuration Language.
## Arguments
-The arguments are used for assigning a value to a name inside a block:
+The arguments play a crucial role in assigning values to names within a block. An example of using arguments is as follows:
```hcl
... {
@@ -20,11 +20,11 @@ The arguments are used for assigning a value to a name inside a block:
}
```
-The argument name (`query_string` in the snippet above) can contain letters, digits, underscores (`_`), and hyphens (`-`). The first character of an identifier must not be a digit.
+The argument name, `query_string` in the snippet above, is allowed to contain letters, digits, underscores (`_`), and hyphens (`-`). However, the first character of an identifier must not be a digit.
## Blocks
-A block is a container that defines a configuration, a data requirement or a content structure.
+In the Fabric Configuration Language (FCL), a block serves as a versatile container defining configurations, data requirements, or content structures. An example is provided below:
```hcl
document "alerts_overview" {
@@ -37,7 +37,7 @@ document "alerts_overview" {
}
```
-A block has a type (`document` and `content` in the example above) that defines how many labels can be used in a block signature. A block can have a name (`"alerts_overview"`) or be anonymous (as a `content text` in the snippet above).
+A block is characterized by a type (`document` and `content` in the example above), dictating the number of labels permissible in a block signature. Additionally, a block can either bear a name (for example, "`alerts_overview`") or remain anonymous, as seen in the case of content text in the provided snippet. This flexibility in block composition contributes to the expressive and modular nature of FCL configurations.
Supported categories of blocks:
@@ -60,3 +60,7 @@ It's recommend to use `#` single-line comment style usually. Future Fabric code
## Character encoding
Fabric configuration files must be UTF-8 encoded. Fabric allows non-ASCII characters in comments, and string values.
+
+## Next steps
+
+See [Configuration]({{< ref "configs.md" >}}) documentation to learn how to configure Fabric and Fabric plugins.
diff --git a/docs/plugins/_index.md b/docs/plugins/_index.md
index 939aafab..f481e8b4 100644
--- a/docs/plugins/_index.md
+++ b/docs/plugins/_index.md
@@ -1,16 +1,21 @@
---
title: Plugins
type: docs
-weight: 5
+weight: 60
+hideChildren: true
---
# 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).
+Fabric relies on plugins for implementing integrations with data sources and content providers. 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 themselves 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).
+A plugin name consists of a namespace (a name of a plugin vendor) and a short name. For example, `blackstork/elastic` plugin built by [BlackStork](https://blackstork.io) implements Elasticsearch and Elastic Security Cases data sources.
## Where to get the plugins
-Plugins are released and distributed independently from Fabric, with their own release cycle and version.
+Plugin releases are independent from Fabric releases. Plugins are distributed independently and have 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.
+
+## Available plugins
+
+{{< plugins >}}
diff --git a/docs/plugins/builtin.md b/docs/plugins/builtin.md
deleted file mode 100644
index 10bdd836..00000000
--- a/docs/plugins/builtin.md
+++ /dev/null
@@ -1,182 +0,0 @@
----
-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 = # optional
-}
-```
-
-#### Usage
-
-The data source supports the following parameters in the data blocks:
-
-```hcl
-data csv {
- path = # 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 = # 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 = # 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 =