Skip to content
Pascal Hartig edited this page Apr 11, 2013 · 3 revisions

wiring#domUpdate

Update a file containing HTML markup with new content, either appending, prepending or replacing content matching a particular selector

  • html - a string containing HTML markup
  • tagName - a valid CSS selector
  • content - the inline content to update your selector with
  • mode - a(ppend), p(repend), r(eplace), d(elete)

wiring#append

Insert specific content as the last child of each element matched by the tagName selector. Returns a string.

wiring#prepend

Insert specific content as the first child of each element matched by the tagName selector. Returns a string.

wiring#appendToFile

Insert specific content as the last child of each element matched by the tagName selector. Writes to file.

wiring#prependToFile

Insert specific content as the first child of each element matched by the tagName selector. Writes to file.

wiring#generateBlock

Generate a usemin-handler block.

  • blockType - js, css
  • optimizedPath - the final file to build
  • filesBlock - a string containing populated script/style tags ready to be injected into a usemin block.
  • searchPath - an alternate search path to look in for files

Returns the new block.

wiring#appendFiles

Append files, specifying the optimized path and generating the necessary usemin blocks to be used for the build process.

  • htmlOrOptions - string to append the files to or an object of this and the remaining options
  • fileType - js (appends to the end of 'body'), css (appends to the end of 'head')
  • optimizedPath - the final file to build
  • sourceFileList - the list of files to be appended. We check against the fileType to ensure the correct tags are wrapped around them and the right usemin blocks generated.
  • attrs - A Hash of html attributes to generate along the generated script / link tags
  • searchPath - an alternate path to look in for files

Returns updated content.

wiring#attributes

Computes a given Hash object of attributes into its HTML representation

  • attrs - Hash object of attributes to generate

Returns the generated string of attributes.

wiring#appendScripts

Scripts alias to appendFiles

wiring#removeScript

Simple script removal

wiring#appendScriptsDir

Append a directory of scripts

wiring#appendStylesDir

Append a directory of stylesheets

Clone this wiki locally