Listings folder

Hi,

here's my code for implementing the new config variable LISTINGS_FOLDERS from Issue #1499.

It currently contains an ugly hack in plugins/compile/rest/listing.py to fix a bug and implement support for sites using the listing directive without specifying the file's path. I'm currently not sure how to implement that better.

Best,
Felix
Removing the check will introduce problems as for example the ReST listing directive is assuming that .html is added automatically; maybe other code depends on that as well.

The improper_input_file_mapping maps files relative to the listings source directories to lists of generated output files. In case you have something like codeA/test.py and codeB/test.py, improper_input_file_mapping['test.py'] contains a list of two elements (the files in output/ generated from the input files).

The proper_input_file_mapping maps 'codeA/test.py' to the generated file in output/. Since it includes the directory where it was taken from, there's no need to have a list of candidates because there is precisely one (if the key's around).

Both dicts are used by listing_paths to stick to the behavior you specified in 1.-4. in #1499 (posts 8 and 9 in that discussion).