"Grunt Task that uses jsdom to postprocess compiled HTML files with jQuery",
A simple [Grunt][grunt] multitask that uses [jsdom][jsdom] to compile HTML on server side and allows manipulation with [jQuery][jquery].
It is possible to use own functions to manipulate the HTML, but there are also four predefined functions: * toc - will create a table of content * bib - will create a table of all cites and link them up * tof - will create a table of all figures and link them up * tot - will create a table of all tables and link them up
Used in [paged-media-boilerplate].
The Bibliography can be used with a custom .json or a Bibtex file. All four functions behave very similar to Latex.
Run grunt jsdom to execute all the targets or grunt jsdom:targetname to execute a specific target. Every html file defined by the src parameter will be post processed and saved to dest folder.
$3
Here the available options with the corresponding defaults: `coffee toc: # see below tof: # see below tot: # see below bib: # see below
Will be passed to each jade template generation
jadeOptions: pretty: true
Will take an array of functions, which will be executed in order.
The names of the 4 predefined functions are also valid.
Options regarding the predefined functions can be accessed by options.{{nameOfFunction}}, so for the table of contents function options.toc will be responsible. #### Table of contents (toc)
This function will search for the given selector (#toc) and fill its element with a linked list of chapters, sections and subsections.
The selectors for these three can be individually defined, also the id for the found elements will be set to, e.g.,
section1.1.
##### Defaults for options:
`coffee
Selector for the table of contents, content will be deleted.
` #### Bibliography (bib) Searches for cite elements in the html file, modifies them according to a template and creates a linked table with all used cites.
Can be used with a
.json or a .bib file. If the provided file has no .json in its name, [bibtex-parser][bibtex-parser] will be used for reading it. A .json file should contain a dictionary, where the keys are used to fetch the entries.
Note: bibtex-parser will convert all keys to uppercase. So for lookup the provided keys will be also uppercased. Keep that in mind if using a
.json.
##### Example:
`html PhysRevB.89.035403 ` will be replaced by: `html