Giter VIP home page Giter VIP logo

cook's People

Contributors

ysim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cook's Issues

`scale` subcommand

This will probably require a special section for ingredients that is parsed separately.

Basic search

  • single field, single value, e.g. tags:vegetarian

  • single field, 1+ OR values

  • single field, 1+ OR/AND values (same operator)

Searchable booleans in front matter

e.g.

  • tested: no
  • can_freeze: yes
  • batch_optimized: yes

Should accept the values:

  • yes, true, 1
  • no, false, 0

Acceptance criteria:

  • Able to search on boolean fields

  • Presence of boolean fields in front matter will not result in this warning being logged:

    {"file":"/path/to/recipefile.md","level":"warning","msg":"Unknown type detected in front matter","time":"2020-07-24T15:37:57-04:00"}
    

Evaluate symlinks in search

Search doesn't work when the recipes directory is symlinked to $HOME/.recipes.

README should not say that symlinking the directory is ok until this is fixed.

Create `random` subcommand

Can reuse existing search subcommand code.

This should return a random recipe that matches the search terms.

If no search terms are given, it should randomly select any recipe.

Improved error handling while parsing front matter

Currently any kind of error in a recipe's front matter results in an abstruse error that doesn't tell us anything about what the error is, how to fix it, or even which recipe file it's found in. This should be fixed as it impedes usability.

`dependencies` field in metadata

Ideas:

  • depends_on/dependencies field in the metadata would reference another recipe's basename (without extension)
  • Displaying a recipe with dependencies could also automatically print all dependent recipes

List all values for a given key

e.g.

cook -key=tags list
    This will list all of the values under the key 'tags'.

cook -key=name list

cook -key=ingredients list

cook -key=absent_key list
    This will give back a nice error message saying that that key doesn't exist.

Acceptance criteria:

  • Should be listed in alphabetical order
  • Only unique values (i.e. no duplicates)

Problem compiling from source (due to blackfriday versioning?)

Hi,
sorry if I did a stupid mistake compilling cook. I am quite new to go.
I am trying to compile cook from source, because I am on OpenBSD (amd64) and there are not precompiled binarys.
When following the instructions get an error compiling with the notice to go mod init. This results in a different error with notice go mod vendor. And finally I get an error undefined: blackfriday.Run which (after some digging) seems to be a result of using blackfriday v1.x with syntax from v2.

Here is my whole process:

user@hostname in ~/go/src
→ $ git clone https://github.com/ysim/cook.git 
Cloning into 'cook'...
remote: Enumerating objects: 751, done.
remote: Total 751 (delta 0), reused 0 (delta 0), pack-reused 751
Receiving objects: 100% (751/751), 106.07 KiB | 88.00 KiB/s, done.
Resolving deltas: 100% (440/440), done.
user@hostname in ~/go/src
→ $ cd cook/
user@hostname in ~/go/src/cook
! $ dep ensure                                 
user@hostname in ~/go/src/cook
→ $ make build GOOS=openbsd GOARCH=amd64       
go build -ldflags "-X main.version=v0.3.0" -o cook 
go: cannot find main module, but found Gopkg.lock in ~/go/src/cook
	to create a module there, run:
	go mod init
*** Error 1 in ~/go/src/cook (Makefile:8 'build')
user@hostname in ~/go/src/cook
! $ go mod init
go: creating new go.mod: module cook
go: converting Gopkg.lock: stat github.com/russross/[email protected]: github.com/russross/[email protected]: invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v2
go: copying requirements from Gopkg.lock
go: to add module requirements and sums:
	go mod tidy
user@hostname in ~/go/src/cook
→ $ make build GOOS=openbsd GOARCH=amd64 
go build -ldflags "-X main.version=v0.3.0" -o cook 
go: inconsistent vendoring in ~/go/src/cook:
	github.com/davecgh/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	github.com/konsorten/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	github.com/pmezard/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	github.com/shurcooL/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	github.com/sirupsen/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	github.com/stretchr/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	golang.org/x/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	golang.org/x/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
	gopkg.in/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt

	To ignore the vendor directory, use -mod=readonly or -mod=mod.
	To sync the vendor directory, run:
		go mod vendor
*** Error 1 in ~/go/src/cook (Makefile:8 'build')
user@hostname in ~/go/src/cook
! $ go mod vendor                              
go: finding module for package github.com/russross/blackfriday
go: found github.com/russross/blackfriday in github.com/russross/blackfriday v1.6.0
user@hostname in ~/go/src/cook
→ $ make build GOOS=openbsd GOARCH=amd64 
go build -ldflags "-X main.version=v0.3.0" -o cook 
# cook
./parser.go:106:15: undefined: blackfriday.Run
*** Error 2 in ~/go/src/cook (Makefile:8 'build')

Thanks

Fix tests

$ go test
Not a valid binary (must be one of `cook` or `concoct`).
exit status 1
FAIL    github.com/ysim/cook    0.123s

binary is something like this when running go test:

/var/folders/51/gf85f_z10cn6v097n7qq89y40000gn/T/go-build774840880/b001/cook.test

bash completion installation is borked

The completion file should go directly in $HOME/.bash_completion.d, NOT in $HOME/.bash_completion.d/cook.bash-completion.

Remember to update README to reflect this.

Add flag to set log level

Currently the log level is hardcoded. Change this so that it can be set dynamically upon invocation.

Scaffolding for creating a new recipe

First, check if an existing recipe exists at that name

If not, create a new file with the following (default) template (should be able to change this with environment variables):

---
name: 
tags: []
ingredients: []
---

Subcommand ideas:

  • new
  • create

List all available search keys

List all possible search keys, including their type, e.g.

cook list keys
- name (string)
- ingredients (list)
- tags (list)
- can_freeze (bool)
- makeahead (bool)
- batch_optimized (bool)

Bugs in parsing/display

Several issues:

  • Mixing ordered and unordered lists doesn't work properly without ordered lists becoming incorrectly ordered (back to 1)
  • Newlines not correctly rendered
  • Nested lists don't work

Advanced search

Broken out from #1.

  • 1+ OR/AND fields and 1+ OR/AND values (all the same operator across fields and values)
    valid: 'tags:comfort food+asian' and ingredients:chicken, tags:soup,stew or ingredients:carrots
    invalid: tags:dessert+warm or ingredients:chocolate, cuisine:chinese,japanese and ingredients:chicken, cuisine:chinese,japanese and ingredients:chicken or method:frying

  • same as above, with negative operators (e.g. -ingredients:asparagus)

  • 1+ OR/AND fields (different operators), 1+ OR/AND values (different operators) - for this, you have to think about precedence and the possibility of brackets

By "same operator", I mean that all the operators should be OR or all the operators should be AND (no mixing of the two).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.