Project

adocconf

0.0
The project is in a healthy, maintained state
adocconf allows you to create both configuration using AsciiDoc.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

>= 0

Runtime

 Project Readme

adocconf

Gem Version

Inspired by mdconf, adocconf allows you to write configuration in the AsciiDoc format.

Usage:

adocconf parse path/to/file.adoc

An example of valid adocconf is below:

:default-host: default
:default-port: 8080
:env: prod

== Servers

=== server1

Strings like these are ignored by the parser, so you can add comments to your config for clarity.

host:: localhost
port:: 80

=== server2

host:: {default-host}
port:: {default-port}

=== server3

ifeval::["{env}" == "prod"]
host:: prod.example.com
port:: 443
endif::[]

ifeval::["{env}" == "dev"]
host:: dev.example.com
port:: 4343
endif::[]

== Features

* login
* signup
* analytics

== Other Servers

[options="header"]
|===
| Name | Host | Port
| server1 | {default-host} | {default-port}
| server2 | remote | 9090
|===

This will parse as the below JSON object:

{
  "servers": {
    "server1": {
      "host": "localhost",
      "port": "80"
    },
    "server2": {
      "host": "default",
      "port": "8080"
    },
    "server3": {
      "host": "prod.example.com",
      "port": "443"
    }
  },
  "features": [
    "login",
    "signup",
    "analytics"
  ],
  "other_servers": [
    {
      "Name": "server1",
      "Host": "default",
      "Port": "8080"
    },
    {
      "Name": "server2",
      "Host": "remote",
      "Port": "9090"
    }
  ]
}