aroberge / crunchy

Automatically exported from code.google.com/p/crunchy
0 stars 0 forks source link

Common way to get files for preprocessors #137

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Currently when Crunchy retrieves a local or remote file, this works like that:
1.a The file is in html (no preprocessor needed): Crunchy open it (if it's
remote, this can includes mechanisms like the forward of Accept-Language
headers).
1.b The file need to be parsed by a preprocessor: Crunchy give the path/url
of the file to the preprocessor, and get the result as an open file in html.
2. The VLAM inside the html file is interpreted by Crunchy.

In 1.b, the preprocessor need to have its own way to get local or remote
files. Features like the forward of Accept-Language (or the support of a
newer protocol...) need to be rewrite.

I suggest a change in the architecture of preprocessors to let them act
like a kind of pipe: they get an open file and return another one. This
should work like:
1. Crunchy open the (remote/local/...) file
2. If the work of a preprocessor is needed, pass the open file to the
preprocessor. It return another open file, in html.
3. Crunchy interprets the html.

Another way should be to have a common module to open file. This module
should be available for all plugins. But this seems to be redundant with
existing handle_* plugins, and IMHO it's not really the best way.

Original issue reported on code.google.com by florian....@gmail.com on 28 Jun 2008 at 4:11

GoogleCodeExporter commented 9 years ago
This is a good idea, but it does not need to be implemented before the 1.0 
release.  

Original comment by andre.ro...@gmail.com on 3 Oct 2008 at 6:21