mojombo/jekyll — pull request #1479 by maul-esel (2013-08-30 20:37:44+00:00)
Title: Differing formats for includes

Related #1303, #186.

This is a WIP towards supporting the inclusion of files of different formats, i.e. **include markdown into HTML or textile** and similar.

Until recently, the docs suggested this would work, which has been fixed in the mentioned issue. I also had expected this to work out of the box when I first started with jekyll, and was quite disappointed it didn't. I think, especially considering the *"just works :tm:"* thought behind jekyll, this is a feature worthy for the jekyll core.

```markdown

# My header
{% include my_content.textile %}
```

***
However, it seems there might have been some reason why this was not included, as it is not as simple as it sounds. After rejecting the thought of *converting the include to HTML and then inserting the HTML* (because it would suffer from a second conversion with the file it has been inserted in :skull:), this is an approach using *placeholders that are replaced by the actual content after the surrounding file has been converted*. Still difficult enough, so I'm gonna need some help with this - as always :smile:

Also interesting and possibly worthy of some discussion are the further possibilities that come with the current approach: For example, when reading in the YAML of the include files, why not work with it? Variables local to the included file, layouts to be applied before insertion, nested includes, ... :stuck_out_tongue_winking_eye: : And, as always, the backwards-compatibility stuff to consider. :grin: