Table of Contents

ComboStrap UI - Pipeline

About

A pipeline is a serie of function that may transform a variable value

Syntax

${variable | function | function | ... }

where:

Functions

Capitalize

capitalize is a function that will make the first letter of each word an uppercase letter (ie capital letter)

Syntax:

capitalize()

Example:

${description | capitalize()}

Output:

A Pipeline Permits To Transform A Variable Value With A Succession Of Transformation Function.

Cut

cut is a function that will split the string in parts and returned the asked part concatenated. If the separator is not found, the original string is returned

Syntax:

cut("separator",selector)

where:

Example:

${description | cut(" ","10-")}

Output:

a succession of transformation function.

${description | cut(" ",2)}

Output:

pipeline

${title | cut("-",2)}

Output:

ComboStrap Pipeline

head is a function that will extract the first words that are in the maximal length specified.

Syntax:

head($length, $tail)

where:

For instance:

${description | head(20 , "...")}

Output:

A pipeline permits to...

Rconcat

rconcat is a function that will concatenate a string to the right. It's deprecated for the tail argument of the head function.

Syntax:

rconcat($string)

For instance:

${description | head(20) | rconcat("...")}

Output:

A pipeline permits to...

Replace

replace is a function that will search a string and replace it.

Syntax:

replace($search, $replace)

For instance:

${title | replace("Pipeline","Pipe-line")}

Output:

ComboStrap Pipe-line

Trim

trim is a function that strip whitespace from the beginning and end of a string

Syntax:

trim()

For instance:

${title | trim()}

Output:

ComboStrap Pipeline

Format

The format function permits to format a date.

Syntax:

format(pattern, locale)

where:

The normal names produce a normal date format for the country (region). The supported normal names are:

Name Date Time
short 12/13/52 3:30pm
medium Jan. 12, 1952
long January 12, 1952 3:30:32pm
full Tuesday, April 12, 1952 3:30:42pm PST

For instance:

${now | format()}

Sunday, December 22, 2024

${now | format('full short')}

Sunday, December 22, 2024 at 7:09 AM

${now | format('mmm dd yyyy')}

009 22 2024

For more example, see the dedicated date page