Skip to content

Instantly share code, notes, and snippets.

@vrillusions
Created July 23, 2014 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vrillusions/0417f01e0b9c98b49bf6 to your computer and use it in GitHub Desktop.
Save vrillusions/0417f01e0b9c98b49bf6 to your computer and use it in GitHub Desktop.
List of all types/functions provided by puppetlabs/stdlib

PUPPETLABS/STDLIB FUNCTION QUICK REFERENCE

List current as of v4.3.2

To generate list

This beast of a one liner will (1)pull down the html, (2)parse out all the h2 tags, (3)and extract the titles from it. Then (4)filter out lines that start with digit to exclude the changelog and (5)the stdlib mentions at top of file. After all that it (6)builds the final line and (7)saves to file.

curl -s https://forge.puppetlabs.com/puppetlabs/stdlib \
    | grep "</span></a>.*</h2>" \
    | sed -e 's,^.*</span></a>\(.*\)</h2>,\1,' \
    | grep -v -e '^[0-9]\+' \
    | grep -v -e '^stdlib' \
    | sed -e 's,^\(.*\)$,* [\1](https://forge.puppetlabs.com/puppetlabs/stdlib#\1),' \
    > puppetlabs-stdlib-quickref.mkd

Improvements could be made like adding a summary and valid parameters and return values but I just wanted a concise list as I always forget.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment