Skip to content

Commit 53f8544

Browse files
committed
Merge pull request #72 from toeb/becker
Templating
2 parents 9ca7de8 + 5de45bb commit 53f8544

37 files changed

+1136
-564
lines changed

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ Look through the files in the package. Most functions will be commented and the
1717
# Feature Overview
1818

1919
`cmakepp` has a lot of different functions. I tried to subdivide them into some meaningful sections.
20-
C:/Users/Tobi/Documents/projects/cmakepp
21-
cmake
22-
cmake
20+
2321

2422
* [Collections](cmake/collections/README.md)
2523
* [Date/Time](cmake/datetime/README.md)
@@ -38,7 +36,7 @@ cmake
3836
* [Parsing and handling semantic versions](cmake/semver/README.md)
3937
* [String Functions](cmake/string/README.md)
4038
* [Targets](cmake/targets/README.md)
41-
* [Templating ](cmake/template/README.md)
39+
* [Templating ](cmake/templating/README.md)
4240
* [Uniform Resource Identifiers (URIs)](cmake/uri/README.md)
4341
* [HTTP Client](cmake/web/README.md)
4442

@@ -67,9 +65,9 @@ I have developed some samples to show off `cmakepp`'s capabilities. Here you can
6765

6866

6967

70-
# Installation
68+
# Getting `cmakepp`
7169

72-
You have multiple options to install `cmakepp` the only prerequisite for all options is that cmake is installed with version `>=2.8.7` - I recommend `>=2.8.23`. You will be notified if a function only works with a more current version of cmake.
70+
You have multiple options to install `cmakepp` the only prerequisite for all options is that [`CMake`](http://www.cmake.org) is installed with a version `>=2.8.12`. `cmakepp` will also work with version less than `2.8.12` however some functions might fail.
7371

7472

7573
* [Install by Console](#install_console) - Recommended

README.md.in

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
Look through the files in the package. Most functions will be commented and the other's usage can be inferred. All functions are avaiable as soon as you include the `cmakepp.cmake` file. To find functionality browse the `README.md` files throughout this project.
1414

1515

16-
<%=template_run("cmake/README.md.in")%>
16+
<%=template_run_file("cmake/README.md.in")%>
1717

1818

19-
<%=template_run("samples/README.md.in")%>
19+
<%=template_run_file("samples/README.md.in")%>
2020

21-
# Installation
21+
# Getting `cmakepp`
2222

23-
You have multiple options to install `cmakepp` the only prerequisite for all options is that cmake is installed with version `>=2.8.7` - I recommend `>=2.8.23`. You will be notified if a function only works with a more current version of cmake.
23+
You have multiple options to install `cmakepp` the only prerequisite for all options is that [`CMake`](http://www.cmake.org) is installed with a version `>=2.8.12`. `cmakepp` will also work with version less than `2.8.12` however some functions might fail.
2424

2525

2626
* [Install by Console](#install_console) - Recommended
@@ -136,8 +136,8 @@ I am a bit a hypocrit. I am trying to adhere to these rules though:
136136
To describe cmake functions I use formalisms which I found most useful they should be intuitively understandable but here I want to describe them in detail.
137137

138138

139-
* `@` denotes character data
140-
* `<string> ::= "\""@"\""` denotes a string literal
139+
* `@@` denotes character data
140+
* `<string> ::= "\""@@"\""` denotes a string literal
141141
* `<regex> ::= /<string>/` denotes a regular expression (as cmake defines it)
142142
* `<identifier> ::= /[a-zA-Z0-9_-]+/` denotes a identifier which can be used for definitions
143143
* `<datatype> ::= "<" "any"|"bool"|"number"|""|"void"|""|<structured data> <?"...">">"` denotes a datatype the elipses denotes that multiple values in array form are described else the datatype can be `any`, `bool`, `number`, `<structured data>` etc..
@@ -153,7 +153,7 @@ To describe cmake functions I use formalisms which I found most useful they shou
153153
* `<named function parameter>`
154154
* `<function parameter> ::= <definition>|<named function parameter>`
155155
* `<function definition> `
156-
* ... @todo
156+
* ... @@todo
157157

158158

159159
## <a name="return"></a>Returning values
@@ -214,8 +214,8 @@ This is possible by overwriting CMakes default return() function with a macro. I
214214
<%=cmakepp_cli(http_get http://httpbin.org/get?key=value --silent --json --json)%>
215215

216216
## parse an uri using the cmakepp alias
217-
> cmakepp uri http+https://toeb:[email protected]/path/to/file.ext?key=value&key2.subkey=value2 --select "scheme: @scheme key2.subkey: @params.key2.subkey"
218-
<%=cmakepp_cli(uri http+https://toeb:[email protected]/path/to/file.ext?key=value&key2.subkey=value2 --silent --select "scheme: @scheme key2.subkey: @params.key2.subkey")%>
217+
> cmakepp uri http+https://toeb:pass@@www.example.com/path/to/file.ext?key=value&key2.subkey=value2 --select "scheme: @@scheme key2.subkey: @@params.key2.subkey"
218+
<%=cmakepp_cli(uri http+https://toeb:pass@@www.example.com/path/to/file.ext?key=value&key2.subkey=value2 --silent --select "scheme: @@scheme key2.subkey: @@params.key2.subkey")%>
219219
```
220220

221221
## <a name="icmake"></a>Interactive CMake Shell
@@ -232,12 +232,12 @@ icmake> cd /usr/tobi
232232
"/usr/tobi"
233233
icmake> pwd
234234
"/usr/tobi"
235-
icmake> @echo off
235+
icmake> @@echo off
236236
echo is now off
237237
icmake> pwd
238238
icmake> message("${ANS}")
239239
/usr/tobi
240-
icmake> @echo on
240+
icmake> @@echo on
241241
echo is now on
242242
icmake> function(myfunc name)\ # <-- backslash allows multiline input
243243
message("hello ${name}") \

cmake/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
# Feature Overview
33

44
`cmakepp` has a lot of different functions. I tried to subdivide them into some meaningful sections.
5-
C:/Users/Tobi/Documents/projects/cmakepp/cmake
6-
C:/Users/Tobi/Documents/projects/cmakepp/cmake
7-
C:/Users/Tobi/Documents/projects/cmakepp/cmake
5+
86

97
* [Collections](collections/README.md)
108
* [Date/Time](datetime/README.md)
@@ -23,7 +21,7 @@ C:/Users/Tobi/Documents/projects/cmakepp/cmake
2321
* [Parsing and handling semantic versions](semver/README.md)
2422
* [String Functions](string/README.md)
2523
* [Targets](targets/README.md)
26-
* [Templating ](template/README.md)
24+
* [Templating ](templating/README.md)
2725
* [Uniform Resource Identifiers (URIs)](uri/README.md)
2826
* [HTTP Client](web/README.md)
2927

cmake/cmakepp/cmakepp_compile_docs.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function(cmakepp_compile_docs)
99
get_filename_component(template_dir "${template_path}" PATH)
1010
set(output_file "${template_dir}/README.md")
1111
message("generating ${output_file}")
12-
template_run("${template_path}")
12+
template_run_file("${template_path}")
1313
ans(generated_content)
1414
fwrite("${output_file}" "${generated_content}")
1515
endforeach()

cmake/log/log.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
## ```
2828
## log("this is a simple error" --error) => <%
2929
## log("this is a simple error" --error)
30-
## template_write_data("${__ans}")
30+
## template_out_json("${__ans}")
3131
## %>
3232
## ```
3333
function(log)

cmake/object/README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,13 @@ As is possible in JavaScript an Python I let you override default object operati
3030
* `__get_keys__ : (<this>):<member ...>` override the operation which returns the list of available keys. It is expected that all keys returned will are valid properties (they exist).
3131
* `__has__ : (<this> <member>):<bool>` overrides the has operation. MUST return true iff the object has a property called `<member>`
3232
* `__member_call__ : (<this> <member> <args:<any...>>):<return value:<any>>` this operation is invoked when `obj_member_call(...)` is called (and thus also when `call, rcall, etc` is called) overriding this function allows you to dispatch a call operation to the object member identified by `<member>` with the specified `args` it should return the result of the specified operation. The `this` variable is always set to the object instance current instance.
33-
* `__cast__` @todo
34-
* helper functions
33+
* `__cast__` helper functions
3534
* `obj_declare_getter()`
3635
* `obj_declare_setter()`
3736
* `obj_declare_call()`
3837
* `obj_declare_member_call()`
3938
* `obj_declare_get_keys()`
40-
* `obj_declare_has_key()` @todo
41-
* `obj_declare_cast()` @todo
42-
39+
* `obj_declare_has_key()` * `obj_declare_cast()`
4340

4441
```
4542
new([Constructor]) returns a ref to a object

cmake/package/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ A package source which uses the bitbucket api to parse remote source packages.
233233

234234
Uses the source code management sytem `git` to access a package. A git repository is interpreted as a package with refs (tags/branches/hashes) being interpreted as different version.
235235

236-
* `query uri format` - takes any uri which git can use (`https`, `ssh`, `git`, `user@host:repo.git`) internally `git ls-remote` is used to check if the uri points to a valid repository. You can specify a ref, branch or tag by appending a query to the uri e.g. `?tag=v0.0.1`
236+
* `query uri format` - takes any uri which git can use (`https`, `ssh`, `git`, `user internally `git ls-remote` is used to check if the uri points to a valid repository. You can specify a ref, branch or tag by appending a query to the uri e.g. `?tag=v0.0.1`
237237
* `package uri format` - same as `query uri format` but with the additional scheme `gitscm` added
238238
* Functions
239239
- `git_package_source()`

cmake/string/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ So I have created somewhat alot of functions which does things that you might ne
244244

245245
evaluates the string <str> in the current scope
246246
this is done by macro variable expansion
247-
evaluates both ${} and @@ style variables
247+
evaluates both ${} and @ style variables
248248

249249

250250

cmake/template/README.md

Lines changed: 0 additions & 135 deletions
This file was deleted.

cmake/template/README.md.in

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)