Skip to content

Commit

Permalink
Some additional handlebars functions documented.
Browse files Browse the repository at this point in the history
  • Loading branch information
RoelantVos committed Sep 3, 2023
1 parent fdb61fd commit 47d0f0a
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 9 deletions.
5 changes: 5 additions & 0 deletions DataWarehouseAutomation/DataWarehouseAutomation/DataObject.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
namespace DataWarehouseAutomation;

/// <summary>
/// The definition of a data set, file, or table.
/// The Data Object can be the 'source' or 'target' in a Data Object Mapping.
/// A Data Object which acts as target in one mapping, can be a source in another mapping, building up the data logistics lineage.
/// </summary>
public class DataObject : IMetadata, IDataObject
{
/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion docs/handlebars/extension_now.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ Get the date and time at the moment of execution.
The time is {{now}}.
```

This gives you the date/time at present.
This returns the date/time at present.
6 changes: 5 additions & 1 deletion docs/handlebars/extension_randomdate.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ This was originally added to generate test data, and is used for referential-int
Here is a random date: {{randomdate 2020}}.
```

This may result in *2022-08-03T00:00:00.000000*.
This may return:

```dotnetcli
2022-08-03T00:00:00.000000
```
6 changes: 5 additions & 1 deletion docs/handlebars/extension_randomnumber.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ This was originally added to generate test data, and is used for referential-int
And here is a random string: {{randomnumber 5}}.
```

This may result in *1346*.
This may return:

```dotnetcli
1346
```
6 changes: 5 additions & 1 deletion docs/handlebars/extension_randomstring.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ Generate a random string no longer than the provided characters as integer input
And here is a random string: {{randomstring 10}}.
```

This may result in *Cg8uKuBFS5*.
This returns:

```dotnetcli
Cg8uKuBFS5
```
27 changes: 27 additions & 0 deletions docs/handlebars/extension_replicate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# {{replicate}}

Returns the input string value a number of times, as specified by the input integer.

This is often used to generate test data.

## Usage

```json
{{#replicate 10}}
```

## Example

```json
{{#replicate 3}}
This value is replicated 3 times!
{{/replicate}}
```

This returns:

```dotnetcli
This value is replicated 3 times!
This value is replicated 3 times!
This value is replicated 3 times!
```
21 changes: 21 additions & 0 deletions docs/handlebars/extension_space.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# {{space}}

Space will space out (!?) the name of the input value to 30 characters using tabs for alignment, indentation.

## Usage

```json
{{space "<value>"}}
```

## Example

```json
This is {{space "Hello World"}} ...spaced out.
```

This results in:

```dotnetcli
This is Hello World ...spaced out.
```
21 changes: 21 additions & 0 deletions docs/handlebars/extension_stringdiff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# {{stringdiff}}

Block helper to evaluate if the input does *not* match a specified string. Also optionally supports an {{else}} block.

## Usage

```json
{{#stringdiff string1 string2}} do something {{else}} do something else {{/stringdiff}}
```

## Example

```json
A and B {{#stringdiff "A" "B"}}are not the same. {{else}}are the same. {{/stringdiff}}
```

This results in:

```dotnetcli
A and B are not the same.
```
18 changes: 13 additions & 5 deletions docs/handlebars/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@ items:
- name: Overview
href: index.md
- name: Now
href: extension_now.md
href: extension_now.md
- name: Random date
href: extension_randomstring.md
href: extension_randomstring.md
- name: Random string
href: extension_randomdate.md
href: extension_randomdate.md
- name: Random number
href: extension_randomnumber.md
- name: String wrap
href: extension_stringwrap.md
href: extension_stringwrap.md
- name: String compare
href: extension_stringcompare.md
href: extension_stringcompare.md
- name: String diff
href: extension_stringdiff.md
- name: Replicate
href: extension_replicate.md
- name: Space
href: extension_space.md

0 comments on commit 47d0f0a

Please sign in to comment.