Skip to content

Commit 6eefb61

Browse files
committed
Organize README and add doctoc table of contents
1 parent 48a9437 commit 6eefb61

File tree

2 files changed

+59
-17
lines changed

2 files changed

+59
-17
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
/bin-test-lib
88
target/
99
/bin
10+
/node_modules

README.md

+58-17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,38 @@
1+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
2+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
3+
**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*
4+
5+
- [Overview](#overview)
6+
- [Essential Information](#essential-information)
7+
- [License](#license)
8+
- [Binary Releases](#binary-releases)
9+
- [Release Notes](#release-notes)
10+
- [API docs](#api-docs)
11+
- [Bugs and Patches](#bugs-and-patches)
12+
- [Build](#build)
13+
- [Using the Library](#using-the-library)
14+
- [API Example](#api-example)
15+
- [Longer Examples](#longer-examples)
16+
- [Schemas and Validation](#schemas-and-validation)
17+
- [Standard behavior](#standard-behavior)
18+
- [Merging config trees](#merging-config-trees)
19+
- [How to handle defaults](#how-to-handle-defaults)
20+
- [Using HOCON, the JSON Superset](#using-hocon-the-json-superset)
21+
- [Features of HOCON](#features-of-hocon)
22+
- [Examples of HOCON](#examples-of-hocon)
23+
- [Uses of Substitutions](#uses-of-substitutions)
24+
- [Factor out common values](#factor-out-common-values)
25+
- [Inheritance](#inheritance)
26+
- [Optional system or env variable overrides](#optional-system-or-env-variable-overrides)
27+
- [Concatenation](#concatenation)
28+
- [Miscellaneous Notes](#miscellaneous-notes)
29+
- [Debugging Your Configuration](#debugging-your-configuration)
30+
- [Java version](#java-version)
31+
- [Rationale for Supported File Formats](#rationale-for-supported-file-formats)
32+
- [Other APIs](#other-apis)
33+
34+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
35+
136
Configuration library for JVM languages.
237

338
## Overview
@@ -32,11 +67,13 @@ custom code. The library has nice support for merging
3267
configurations so if you build one from a custom source it's easy
3368
to merge it in.
3469

35-
## License
70+
## Essential Information
71+
72+
### License
3673

3774
The license is Apache 2.0, see LICENSE-2.0.txt.
3875

39-
## Binary Releases
76+
### Binary Releases
4077

4178
You can find published releases (compiled for Java 6 and above) on
4279
Maven Central.
@@ -51,20 +88,20 @@ Obsolete releases are here, but you probably don't want these:
5188

5289
- http://repo.typesafe.com/typesafe/releases/com/typesafe/config/config/
5390

54-
## Release Notes
91+
### Release Notes
5592

5693
Please see NEWS.md in this directory,
5794
https://github.com/typesafehub/config/blob/master/NEWS.md
5895

59-
## API docs
96+
### API docs
6097

6198
- Online: http://typesafehub.github.com/config/latest/api/
6299
- also published in jar form
63100
- consider reading this README first for an intro
64101
- for questions about the `.conf` file format, read HOCON.md in
65102
this directory
66103

67-
## Bugs and Patches
104+
### Bugs and Patches
68105

69106
Report bugs to the GitHub issue tracker. Send patches as pull
70107
requests on GitHub.
@@ -74,20 +111,22 @@ Typesafe Contributor License Agreement online, using your GitHub
74111
account - it takes 30 seconds. You can do this at
75112
http://www.typesafe.com/contribute/cla
76113

77-
## Build
114+
### Build
78115

79116
The build uses sbt and the tests are written in Scala; however,
80117
the library itself is plain Java and the published jar has no
81118
Scala dependency.
82119

83-
## API Example
120+
## Using the Library
121+
122+
### API Example
84123

85124
Config conf = ConfigFactory.load();
86125
int bar1 = conf.getInt("foo.bar");
87126
Config foo = conf.getConfig("foo");
88127
int bar2 = foo.getInt("bar");
89128

90-
## Longer Examples
129+
### Longer Examples
91130

92131
See the examples in the `examples/` directory.
93132

@@ -107,7 +146,7 @@ In brief, as shown in the examples:
107146
format or data source you like with the methods in
108147
`ConfigValueFactory`.
109148

110-
## Schemas and Validation
149+
### Schemas and Validation
111150

112151
There isn't a schema language or anything like that. However, two
113152
suggested tools are:
@@ -132,7 +171,7 @@ In Scala, a Settings class might look like:
132171

133172
See the examples/ directory for a full compilable program.
134173

135-
## Standard behavior
174+
### Standard behavior
136175

137176
The convenience method `ConfigFactory.load()` loads the following
138177
(first-listed are higher priority):
@@ -183,7 +222,7 @@ configuration. In the replacement config file, you can use
183222
file; after the include statement you could go on to override
184223
certain settings.
185224

186-
## Merging config trees
225+
### Merging config trees
187226

188227
Any two Config objects can be merged with an associative operation
189228
called `withFallback`, like `merged = firstConfig.withFallback(secondConfig)`.
@@ -209,7 +248,7 @@ Then you could code something like:
209248

210249
There are lots of ways to use `withFallback`.
211250

212-
## How to handle defaults
251+
### How to handle defaults
213252

214253
Many other configuration APIs allow you to provide a default to
215254
the getter methods, like this:
@@ -304,7 +343,7 @@ Whatever you do, please remember not to cut-and-paste default
304343
values into multiple places in your code. You have been warned!
305344
:-)
306345

307-
## JSON Superset
346+
## Using HOCON, the JSON Superset
308347

309348
Tentatively called "Human-Optimized Config Object Notation" or
310349
HOCON, also called `.conf`, see HOCON.md in this directory for more
@@ -534,7 +573,9 @@ Note: Play/Akka 2.0 have an earlier version that supports string
534573
concatenation, but not object/array concatenation. `+=` does not
535574
work in Play/Akka 2.0 either.
536575

537-
## Debugging
576+
## Miscellaneous Notes
577+
578+
### Debugging Your Configuration
538579

539580
If you have trouble with your configuration, some useful tips.
540581

@@ -545,12 +586,12 @@ If you have trouble with your configuration, some useful tips.
545586
- Use `myConfig.root().render()` to get a `Config` printed out as a
546587
string with comments showing where each value came from.
547588

548-
## Java version
589+
### Java version
549590

550591
Currently the library is maintained against Java 6. It does not
551592
build with Java 5.
552593

553-
## Rationale
594+
### Rationale for Supported File Formats
554595

555596
(For the curious.)
556597

@@ -595,7 +636,7 @@ Two alternatives to HOCON syntax could be:
595636
allow mixing true JSON files into the config but also support
596637
a nicer format.
597638

598-
## Other APIs
639+
### Other APIs
599640

600641
This may not be comprehensive - if you'd like to add mention of
601642
your wrapper, just send a pull request for this README. We would

0 commit comments

Comments
 (0)