README.md (242b24828472137ec4411826b86e753d49bd2c39) | README.md (11dd9ed6647d821e7b43d4f8e64412a2623fbab5) |
---|---|
1# LIBUCL 2 | 1# LIBUCL 2 |
3[![Build Status](https://travis-ci.org/vstakhov/libucl.svg?branch=master)](https://travis-ci.org/vstakhov/libucl)[![Coverity](https://scan.coverity.com/projects/4138/badge.svg)](https://scan.coverity.com/projects/4138)[![Coverage Status](https://coveralls.io/repos/github/vstakhov/libucl/badge.svg?branch=master)](https://coveralls.io/github/vstakhov/libucl?branch=master) | 3[![Build Status](https://travis-ci.org/vstakhov/libucl.svg?branch=master)](https://travis-ci.org/vstakhov/libucl) 4[![Coverity](https://scan.coverity.com/projects/4138/badge.svg)](https://scan.coverity.com/projects/4138) 5[![Coverage Status](https://coveralls.io/repos/github/vstakhov/libucl/badge.svg?branch=master)](https://coveralls.io/github/vstakhov/libucl?branch=master) |
4 5**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* 6 7- [Introduction](#introduction) 8- [Basic structure](#basic-structure) 9- [Improvements to the json notation](#improvements-to-the-json-notation) 10 - [General syntax sugar](#general-syntax-sugar) 11 - [Automatic arrays creation](#automatic-arrays-creation) --- 200 unchanged lines hidden (view full) --- 212 end of comment 213*/ 214``` 215 216### Macros support 217 218UCL supports external macros both multiline and single line ones: 219```nginx | 6 7**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* 8 9- [Introduction](#introduction) 10- [Basic structure](#basic-structure) 11- [Improvements to the json notation](#improvements-to-the-json-notation) 12 - [General syntax sugar](#general-syntax-sugar) 13 - [Automatic arrays creation](#automatic-arrays-creation) --- 200 unchanged lines hidden (view full) --- 214 end of comment 215*/ 216``` 217 218### Macros support 219 220UCL supports external macros both multiline and single line ones: 221```nginx |
220.macro "sometext"; 221.macro { | 222.macro_name "sometext"; 223.macro_name { |
222 Some long text 223 .... 224}; 225``` 226 227Moreover, each macro can accept an optional list of arguments in braces. These 228arguments themselves are the UCL object that is parsed and passed to a macro as 229options: 230 231```nginx | 224 Some long text 225 .... 226}; 227``` 228 229Moreover, each macro can accept an optional list of arguments in braces. These 230arguments themselves are the UCL object that is parsed and passed to a macro as 231options: 232 233```nginx |
232.macro(param=value) "something"; 233.macro(param={key=value}) "something"; 234.macro(.include "params.conf") "something"; 235.macro(#this is multiline macro | 234.macro_name(param=value) "something"; 235.macro_name(param={key=value}) "something"; 236.macro_name(.include "params.conf") "something"; 237.macro_name(#this is multiline macro |
236param = [value1, value2]) "something"; | 238param = [value1, value2]) "something"; |
237.macro(key="()") "something"; | 239.macro_name(key="()") "something"; |
238``` 239 240UCL also provide a convenient `include` macro to load content from another files 241to the current UCL object. This macro accepts either path to file: 242 243```nginx 244.include "/full/path.conf" 245.include "./relative/path.conf" --- 137 unchanged lines hidden --- | 240``` 241 242UCL also provide a convenient `include` macro to load content from another files 243to the current UCL object. This macro accepts either path to file: 244 245```nginx 246.include "/full/path.conf" 247.include "./relative/path.conf" --- 137 unchanged lines hidden --- |