ysim / cook Goto Github PK
View Code? Open in Web Editor NEWcommand-line recipe management
License: MIT License
command-line recipe management
License: MIT License
h1
-> h6
This will probably require a special section for ingredients that is parsed separately.
single field, single value, e.g. tags:vegetarian
single field, 1+ OR values
single field, 1+ OR/AND values (same operator)
Purpose:
Notes:
Links:
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"}
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.
logrus
is now in maintenance mode. Check out zap.
Idle thoughts:
e.g.
cook list -key=ingredients values
- broccoli
- chicken
- cilantro
- parsley
Acceptance criteria:
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.
See:
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.
Ideas:
depends_on
/dependencies
field in the metadata would reference another recipe's basename (without extension)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:
Source
should be moved up into one of the meta fields.
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
Proposed file location: $HOME/.cook.conf
$ 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
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.
Currently the log level is hardcoded. Change this so that it can be set dynamically upon invocation.
Let the user define which colours/styling should be used in the output.
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
Missing the subcommands:
new
list
validate
version
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)
Several issues:
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).
Makes the instructions easier to read.
Constraints:
i.e. if you have minced pork
listed in some recipes and ground pork
listed in others, you should get some kind of message about it.
Gopkg.{toml,lock}
filesFor example, after editing and saving a file, it might automatically generate a git commit in the recipe repo. Thoughts?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.