Options
All
  • Public
  • Public/Protected
  • All
Menu

Text Before After With Unicode

Text Before After With Unicode

BUILD_INCLUDE

// BUILD_INCLUDE("./scratch/replace01.txt")[text?before=# \u{1F913}\n# \u{1F44C}\n&padleft=#\u2014\u{1F600}\u2014,breakstring?width=50&flags=word]

Text padding and break lines using BUILD_INCLUDE

Includes replace01.txt and places text before and after output.

Options

[text?before=# \u{1F913}\n# \u{1F44C}\n&padleft=#\u2014\u{1F600}\u2014,breakstring?width=50&flags=word]

Text

The option text allow for input file content to be manipulated in several ways before being outputed.

Text Before

text?before=some value where as some value can be any string. Some string values require escaping to include as literals.
See: Escaping Parameters

Text Padleft

text?padleft=num where as num is any whole number number, pads the left side of each line with a number of spaces equal to the value of num. --or--
text?padleft=text where as text is a string value, pads the left side of each line with the value of text. Spaces at the end of text are valid. \t (tab) is also acceptable such as text?padleft=\t\t, would add two tabs as left padding.
If padleft is a string value then be aware some strings require escaping.
See: Escaping Parameters

Text After

text?after=some value where as some value can be any string. Some string values require escaping to include as literals.
See: Escaping Parameters

Breakstring

The various options of breakstring allow for the breaking of lines in different ways.
If the width option of breakstring is not set then width defaults to 80.

Breakstring Width

Width=# where as # is a number, determines that each line will be broken as close to # characers as possible depending other breakstring options.

Breakstring Flags Word

flags=word determines that lines are not to be broken on a word.

Option

text?before=# \u{1F913}\n# \u{1F44C}\n&padleft=#\u2014\u{1F600}\u2014

before=# \u{1F913}\n# \u{1F44C}\n
Inserts at the start of the output:

# πŸ€“
# πŸ‘Œ

Note: \n is used to insert a new line:
Note: unicode characters can be used in text parameters.

padleft=#\u2014\u{1F600}\u2014
Inserts before each line:

#β€”πŸ˜€β€”

Config

GruntFile.js

module.exports = function (grunt) {
  grunt.initConfig({
    build_include: {
      default: {
        match: 'buildIncludeSlash',
        src: './lib/test.txt',
        dest: './scratch/test.txt'
      }
    }
  });
  grunt.loadNpmTasks('grunt-build-include');
  grunt.registerTask('default', ['build_include:default']);
};

Output

# πŸ€“
# πŸ‘Œ
#β€”πŸ˜€β€”The quick, brown fox jumps over a lazy dog. DJs flock
#β€”πŸ˜€β€”by when MTV ax quiz prog. Junk MTV quiz graced by
#β€”πŸ˜€β€”fox whelps.Bawds jog, flick quartz, vex nymphs. Waltz,
#β€”πŸ˜€β€”bad nymph, for quick jigs vex! Fox nymphs grab quick-jived
#β€”πŸ˜€β€”waltz. Brick quiz whangs jumpy veldt fox.Bright vixens
#β€”πŸ˜€β€”jump; dozy fowl quack. Quick wafting zephyrs vex bold
#β€”πŸ˜€β€”Jim. Quick zephyrs blow, vexing daft Jim. Sex-charged
#β€”πŸ˜€β€”fop blew my junk TV quiz.How quickly daft jumping
#β€”πŸ˜€β€”zebras vex. Two driven jocks help fax my big quiz.
#β€”πŸ˜€β€”Quick, Baz, get my woven flax jodhpurs! "Now fax quiz
#β€”πŸ˜€β€”Jack!" my brave ghost pled. Five quacking zephyrs
#β€”πŸ˜€β€”jolt my wax bed. Flummoxed by job, kvetching W. zaps
#β€”πŸ˜€β€”Iraq. Cozy sphinx waves quart jug of bad milk.A very
#β€”πŸ˜€β€”bad quack might jinx zippy fowls. Few quips galvanized
#β€”πŸ˜€β€”the mock jury box. Quick brown dogs jump over the
#β€”πŸ˜€β€”lazy fox. The jay, pig, fox, zebra, and my wolves
#β€”πŸ˜€β€”quack!Blowzy red vixens fight for a quick jump. Joaquin
#β€”πŸ˜€β€”Phoenix was gazed by MTV for luck. A wizard’s job
#β€”πŸ˜€β€”is to vex chumps quickly in fog. Watch "Jeopardy!
#β€”πŸ˜€β€”", Alex Trebek's fun TV quiz game. Woven silk pyjamas
#β€”πŸ˜€β€”exchanged for blue quartz.

Generated using TypeDoc