Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automation: Step 1, or Cake, anyone? #68

Merged
merged 45 commits into from
Mar 17, 2014

Conversation

knowtheory
Copy link
Collaborator

This is really more of an "inb4" pull request. Also an attempt to start some discussion as to what people want.

I've hacked up the dumbest, quickest, most straightforward scripts to do two things:

  1. Automatically generate a table of contents/index of the recipes in the repository
  2. Generate an index of recipes grouped by ingredient. (at the moment the ingredient parsing/normalization is still missing)

There are two todos for the table of contents (TOC hence). Alternative sorting for the TOC (rather than alphanumeric) so as to preserve the current order of the index. The other is some way of tagging or otherwise indicating facts about recipes (like whether they're vegetarian friendly) so that info can be communicated through the TOC.

I'm particularly interested in opinions on the last point. Any suggestions? :D

@dansinker
Copy link
Owner

Then I'm gonna leave this open and let the discussion progress. Should loop in the crew from #61 for the discussion.

My two cents on the vegetarian tagging question though is that that is important. Mainly because vegetarians keep going through and adding the (v).

What about--and I am positive there is a smarter solution for this--instead of overly structuring the recipes (something I've said pretty regularly I'm against), there is a structured field in them. Literally just a "tags" line that would allow you to designate various things, of which right now this system really would only care about vegetarian, but which could be used later for other automated process.

EXAMPLE:

tags: vegetarian, tex-mex, cabbage

@evz
Copy link
Contributor

evz commented Nov 6, 2013

👍 for tags line. Simple to parse leaves things as clean and simple as possible.

@knowtheory
Copy link
Collaborator Author

Alright, so the table of contents now has a lil template, and recipes tagged as vegetarian.

I've updated all the vegetarian recipes to include a "tags:" line with comma separated values. The TOC generator currently just notes whether recipes are tagged with vegetarian. I'm happy either way if we decide to add more ceremony/structure to the tag line or not.

So the TOC looks like this now: https://github.com/knowtheory/tacofancy/blob/taco_cake/table_of_contents.md

If we wanna keep going down the tagging route there are a couple next steps:

  1. figuring out a convenient way for people to indicate how tags should show up in the TOC (the "(v)" for vegetarian thing)
  2. listing an index of recipes by tag probably.
  3. Spell checker for tags
  4. ???
  5. Eat delicious tacos.

@knowtheory
Copy link
Collaborator Author

Yep, so it all happens through a coffeescript Cakefile. So if you have node.js installed, and coffeescript installed globally, all you have to do is type cake build:toc on the command line, and it'll generate the TOC for you to commit like any other file.

I'm trying to winnow the installation dependencies down though. I can get it down to just node.js (install node, then use npm install to get the dependencies), but then the invocation becomes

`npm bin`/cake build:toc

The steps past that will be either asking someone to run the script and commit it (either those adding the recipes, if they have node/coffeescript installed, or editors who can run the script after accepting a pull request), or by creating a little web service which generates the TOC & commits it when notified by Github (via a webhook) that there are new commits.

@knowtheory
Copy link
Collaborator Author

@raed667 and yep, so folks can add whatever tags they want to recipes, but the build scripts don't do anything with them (yet). Building a little mapping for how tags should show up in the TOC would be neat. We could even stick icons/emoticons into the TOC if we want.

We could just use a JSON config file structured like this:

{
  "vegetarian": {
    "icon": "http://github.com/sinker/tacofancy/images/vegetarian_icon.png", 
    "abbreviation": "v" 
  }
}

or if we wanted to be even simpler just:

{
  "vegetarian": "v"
}

@dansinker
Copy link
Owner

+1 to a webservice that triggers via webhook.

@meetar
Copy link
Contributor

meetar commented Nov 11, 2013

If you don't already have a webhook for the index build trigger I'm fairly sure we can base it on the tacobot script.

@knowtheory
Copy link
Collaborator Author

@meetar Yep, the webhook part i'm less concerned about than reliably pulling from & committing to the repo (which is what i've been tinkering with).

btw, i hit up the github dudes, and managed to grab @tacobot on github here. So commits can come from there. :)

@dansinker
Copy link
Owner

Ted, pinging you back about this auto-index generation because jesus h christ, "please update index.md" is 80% of the feedback I have to give PRs.

@knowtheory
Copy link
Collaborator Author

Okay, i've got the taco_cake branch cleaned up and ready to merge.

Once merged, i'll flip my tacobot over to committing to the main repository. At that point, any time a push is made to the repository the tacobot automatically generate/update a table_of_contents by scanning through all the files in the repo .

If the tacobot's updated ToC is different from the one in the repo, it'll commit it and push.

This'll double the # of commits/pushes to the repo likely (unless folks run the script themselves).

@dansinker
Copy link
Owner

OK, so this is 100% ready to merge then?

@knowtheory
Copy link
Collaborator Author

Yep. The additional changes are adding tags and a little reformatting.

On Sunday, March 16, 2014, sinker [email protected] wrote:

OK, so this is 100% ready to merge then?

Reply to this email directly or view it on GitHubhttps://github.com//pull/68#issuecomment-37772830
.

dansinker added a commit that referenced this pull request Mar 17, 2014
Automation: Step 1, or Cake, anyone?
@dansinker dansinker merged commit fcc2212 into dansinker:master Mar 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants