Skip to content

Commit 2fc6cfa

Browse files
sdraschrisvfritz
authored andcommitted
Add in cookbook template (#1268)
* Add in cookbook template * update cookbook template based on review comments
1 parent ad3092e commit 2fc6cfa

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: Cookbook Contributions
3+
type: cookbook
4+
order: 1000
5+
---
6+
7+
## What we're looking for
8+
9+
The Cookbook gives developers examples to work off of that both cover common or interesting use cases, and also progressively explain more complex detail. Our goal is to move beyond a simple introductory example, and demonstrate concepts that are more widely applicable, as well as some caveats to the approach.
10+
11+
If you're interested in contributing, please initiate collaboration by filing an issue under the tag **cookbook idea** with your concept so that we can help guide you to a successful pull request. After your idea has been approved, please follow the template below as much as possible. Some sections are required, and some are optional. Following the numerical order is strongly suggested, but not required.
12+
13+
## Simple Example
14+
15+
_required_
16+
17+
1. Articulate the problem in a sentence or two.
18+
2. Explain the simplest possible solution in a sentence or two.
19+
3. Show a small code sample.
20+
4. Explain what this accomplishes in a sentence.
21+
22+
## Details about the Value
23+
24+
_required_
25+
26+
1. Address common questions that one might have while looking at the example. (Blockquotes are great for this)
27+
2. Show examples of common missteps and how they can be avoided.
28+
3. Show very simple code samples of good and bad patterns.
29+
4. Discuss why this may be a compelling pattern. Links for reference are not required but encouraged.
30+
31+
## Real-World Example
32+
33+
_required_
34+
35+
Demonstrate the code that would power a common or interesting use case, either by:
36+
1. Walking through a few terse examples of setup, or
37+
2. Embedding a codepen/jsfiddle example
38+
39+
If you choose to do the latter, you should still talk through what it is and does.
40+
41+
## Additional Context
42+
43+
_optional_
44+
45+
It's extremely helpful to write a bit about this pattern, where else it would apply, why it works well, and run through a bit of code as you do so or give people further reading materials here.
46+
47+
## When To Avoid This Pattern
48+
49+
_optional_
50+
51+
This section is not required, but heavily recommended. It won't make sense to write it for something very simple such as toggling classes based on state change, but for more advanced patterns like mixins it's vital. The answer to most questions about development is ["It depends!"](https://codepen.io/rachsmith/pen/YweZbG), this section embraces that. Here, we'll take an honest look at when the pattern is useful and when it should be avoided, or when something else makes more sense.
52+
53+
## Alternative Patterns
54+
55+
_optional, except when the section above is provided_
56+
57+
This section is required when you've provided the section above about avoidance. It's important to explore other methods so that people told that something is an antipattern in certain situations are not left wondering. In doing so, consider that the web is a big tent and that many people have different codebase structures and are solving different goals. Is the app large or small? Are they integrating Vue into an existing project, or are they building from scratch? Are their users only trying to achieve one goal or many? Is there a lot of asyncronous data? All of these concerns will impact alternative implementations. A good cookbook recipe gives developers this context.
58+
59+
## Thank you
60+
61+
It takes time to contribute to documentation, and if you spend the time to submit a PR this section of our docs, you do so with our gratitude.

0 commit comments

Comments
 (0)