{"comment":{"created_at":"2011-10-18T15:52:20Z","body":"The code works almost exactly the same as it used to be. All changes are generic and don't change the existing behavior. So I have to disagree, this is not project specific\r\n\r\na84d9666 just adds two methods which allows implementers (like myself) to hook into the include tag without having to override core functionality and thus to forever maintain duplicated code. I thus tried to keep the functionality as generic as possible. From a functionality standpoint, nothing is changed here.\r\n\r\n94521ca8 moves the template reading code so that it has access to the new scope on the stack. It thus allows more complex filesystem implementations to inject some context into the scope. Remember, that a \"filesystem\" doesn't necessarily has to map to an actual filesystem with its trivial semantics. But as Liquid allows to be included in more complex applications as part of a larger rendering stack, having more possibilities to control context seems rather important. Especially as we always have at least two languages (Liquid typically rendering into Textile which in turn generates HTML using some context from Liquid)\r\n\r\nGranted, I want to save myself some maintenance work by providing me some hooks, but given the really low impact of the changes to the core and the greatly extended extensibility, I'd really appreciate a merge.","updated_at":"2011-10-18T15:52:20Z","url":"https://api.github.com/repos/Shopify/liquid/issues/comments/2443492","id":2443492,"user":{"avatar_url":"https://secure.gravatar.com/avatar/2ab37d9d26c2c1947bef767725a118b6?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"2ab37d9d26c2c1947bef767725a118b6","url":"https://api.github.com/users/meineerde","id":95506,"login":"meineerde"}},"action":"created","issue":{"number":78,"created_at":"2011-10-17T19:51:22Z","pull_request":{"diff_url":"https://github.com/Shopify/liquid/pull/78.diff","patch_url":"https://github.com/Shopify/liquid/pull/78.patch","html_url":"https://github.com/Shopify/liquid/pull/78"},"body":"This pull request make the bundled include tag more modular to allow other implementations with complex more template concepts to hook into it.\r\n\r\nMy specific use-case here is the introduction of Liquid into ChiliProject (a Redmine fork). We want to use the liquid include to include wiki pages. The templates here are ActiveRecord models. As an additional challenge, the templates are also required to be parsed with Textile. Our basic rendering pipeline goes like \r\n\r\n    Text ~> Liquid parser ~> Textile parser ~> HTML\r\n\r\nDuring the inclusion phase, we need to make sure that the context is updated with the correct, well, context. E.g. we need to render each page with the correct project drop in the context, as we allow cross-project includes and need to properly resolve the targets of sub-includes.\r\n\r\nSee the full example at https://github.com/meineerde/chiliproject/blob/issues/unstable/604-liquid/lib/chili_project/liquid/tags/include.rb","comments":2,"title":"More extensible include","updated_at":"2011-10-18T15:52:20Z","url":"https://api.github.com/repos/Shopify/liquid/issues/78","id":1932648,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/2ab37d9d26c2c1947bef767725a118b6?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"2ab37d9d26c2c1947bef767725a118b6","url":"https://api.github.com/users/meineerde","id":95506,"login":"meineerde"},"html_url":"https://github.com/Shopify/liquid/issues/78","labels":[],"state":"open"},"legacy":{"issue_id":1932648,"comment_id":2443492}}