{"action":"opened","issue":{"number":1,"created_at":"2011-10-21T00:36:04Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"While composer is fed static index files, it's clear that the indexer will accept some kind of programmatic input, perhaps in the form of a ``settings.py`` file.\r\n\r\nWhat should an indexer look like? Things an indexer should be able to do:\r\n\r\n- Traverse a directory recursively, select a subset of files based on some criteria.\r\n- Inspect the files and pull out metadata out of them (such as the title of a blog post).\r\n- Utilize arbitrary metadata around a file, such as a git repo it's stored in (fetch the author and time created/updated timestamps from the git log).\r\n- Combine the above in arbitrary ways.\r\n\r\nThe primary goal of the indexer is to generate routes. A route looks like this:\r\n\r\n```javascript\r\n{\r\n    \"context\": {\r\n        \"title\": \"Goodbye!\"\r\n    },\r\n    \"file\": \"posts/1.md\",\r\n    \"filters\": [\r\n        \"markdown\",\r\n        \"post\"\r\n    ],\r\n    \"url\": \"post/1\"\r\n}\r\n```\r\n\r\nOne possible solution is to create a kind of Python DSL (similar to [Pipe](http://dev-tricks.net/pipe-infix-syntax-for-python)):\r\n\r\n```python\r\nroutes = Walk('templates/') | Select(suffix='.mako') \\\r\n                            | Filter('mako') \\\r\n                            | Url(lambda r: r['file'][:-5].replace('/', '_'))\r\n```\r\n\r\nEach of these will pass a routes dictionary to the next and mutate it as it goes along the chain.\r\n\r\nThough probably a more explicit solution is better...","comments":0,"title":"Indexer brainstorming","updated_at":"2011-10-21T00:36:04Z","url":"https://api.github.com/repos/shazow/composer/issues/1","id":2011221,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/c355dd26a5f80e1605d2ff1ecb6e719e?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"c355dd26a5f80e1605d2ff1ecb6e719e","url":"https://api.github.com/users/shazow","id":6292,"login":"shazow"},"html_url":"https://github.com/shazow/composer/issues/1","labels":[],"state":"open"},"legacy":{"number":1,"action":"opened","issue":2011221}}