Skip to content

Commit

Permalink
Improve docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
brendandburns committed Jan 9, 2020
1 parent d510ce6 commit 73c76f6
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Configula

Configula is a configuration generation language and processor. It's goal is to make the programattic
Configula is a configuration generation language and processor. It's goal is to make the programmatic
definition of declarative configuration easy and intuitive.

### Inspiration
Expand All @@ -15,7 +15,7 @@ my_object = foo: bar
It's neither Python, nor YAML. It combines the syntax of both. Instead of being a templating language like [Jinja](https://www.palletsprojects.com/p/jinja/) or others, or a Domain-Specific Language (DSL) like [HCL](https://www.terraform.io/docs/configuration/syntax.html), [ARM templates](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-syntax) or [jsonnet](https://jsonnet.org/), it combines the power of`
a full programming language with the ease of a declarative syntax like YAML.

### Example
### Programmatic Example

Let's generate a Kubernetes namespace for a collection of users. Each namespace get's the user's name.

Expand Down Expand Up @@ -65,6 +65,32 @@ metadata:
---
```

### Templating Example
The previous example is programming centric. If your configuration is mostly data and not much code, sometimes it makes
sense to have a data-centric template. Such templates look more like YAML than Python.

Here is a simple example:

```yaml
first = "brendan"
last = "burns"

apiVersion: v1
kind: Namespace
metadata:
name: !~ first + ' ' + last
```
When you run this with `configula namespace.yml` it will output:

```yaml
apiVersion: v1
kind: Namespace
metadata:
name: brendan burns
```


### Getting Started
Download Configula for your platform
* [darwin](https://github.com/brendandburns/configula/releases/download/0.0.1/darwin.tgz)
Expand Down
8 changes: 8 additions & 0 deletions examples/namespace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
first = "brendan"
last = "burns"

apiVersion: v1
kind: Namespace
metadata:
name: !~ first + ' ' + last

0 comments on commit 73c76f6

Please sign in to comment.