microsoft / devcookbook Goto Github PK
View Code? Open in Web Editor NEWAn open source cookbook for everyone!
Home Page: https://microsoft.github.io/DevCookbook/
License: MIT License
An open source cookbook for everyone!
Home Page: https://microsoft.github.io/DevCookbook/
License: MIT License
First seen with pull request #5. The directions are have subheadings which cannot be parsed by the compiler.
## Directions
1. Place oven rack in the lower-middle position and preheat oven to 400°. Line a baking sheet with foil.
### Start the Squash
2. Brush or otherwise coat the squash with 2 Tbsp olive oil. Place the squash cut side down onto the prepared baking sheet and bake until easily pierced with a knife or skewer, 40-45 minutes. Proceed with the remaining steps as the squash roasts.
### Make the Breadcrumbs
(This step is optional-skip if using panko or other premade crumbs)
3. Melt 2 Tbsp butter in a large 12" skillet over medium heat.
4. Add the cubed bread and toss to coat in the melted butter. Continue to toast the bread until golden brown and crunchy, about 10 minutes. Sprinkle generously with salt and pepper and set aside on paper towel to drain.
When the compiler is run, the following exception is raised:
Traceback (most recent call last):
File "/home/t_eck/code/forks/DevCookbook/compile.py", line 44, in <module>
[render_recipe_page(recipe, env) for recipe in recipes],
File "/home/t_eck/code/forks/DevCookbook/compile.py", line 44, in <listcomp>
[render_recipe_page(recipe, env) for recipe in recipes],
File "/home/t_eck/code/forks/DevCookbook/recipe_compiler/render.py", line 16, in render_recipe_page
return env.get_template("recipe.html").render(recipe=recipe)
File "/home/t_eck/code/forks/DevCookbook/.venv/lib/python3.9/site-packages/jinja2/environment.py", line 1090, in render
self.environment.handle_exception()
File "/home/t_eck/code/forks/DevCookbook/.venv/lib/python3.9/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/home/t_eck/code/forks/DevCookbook/.venv/lib/python3.9/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "/home/t_eck/code/forks/DevCookbook/recipe_compiler/templates/recipe.html", line 1, in top-level template code
{% extends "index.html" %} {% block content %}
File "/home/t_eck/code/forks/DevCookbook/recipe_compiler/templates/index.html", line 15, in top-level template code
{% block content %} {% endblock content %}
File "/home/t_eck/code/forks/DevCookbook/recipe_compiler/templates/recipe.html", line 20, in block "content"
{% for ingredient in recipe.ingredients %}
TypeError: 'NoneType' object is not iterable
The parser should be changed to accept subheadings and display them correctly.
There is no documentation on how to fork and set up the repository to contribute to the compiler itself.
Add this documentation in a CONTRIBUTING.md
file and link to it from the README.md
.
There are important files that Microsoft projects should all have that are not present in this repository. A pull request has been opened to add the missing file(s). When the pr is merged this issue will be closed automatically.
Microsoft teams can learn more about this effort and share feedback within the open source guidance available internally.
When a user writes a list of ingredients or directions with a sublist, the sublist is not parsed in and is omitted in the output.
This issue was first seen in @jimbobbennett's pull request #3.
In this PR, @jimbobbennett submitted a recipe which included the instruction:
1. Whilst the condensed milk is boiling, make the pie base:
1. Grease a pie dish with butter
1. Put the digestive biscuits in a plastic bag and smash and roll with a rolling pin till you have fine crumbs
1. Melt a small amount of butter in a pan and mix in the biscuit crumbs. You need enough butter for the crumbs to stick together, but not too much, so keep adding small bits of butter as needed until the crumbs start to bind.
1. Spread the crumbs into the pie dish and press them firmly to the bottom and sides to make a pie base
1. Put in the fridge till the butter cools and sets
The compiler did not render the indented instructions:
The get_list_within_section
function does not recursively collect items. It only checks the first set of children within a list and returns the strings. Source
Instead of returning a list of strings, the parser should return a list of nodes which may be leafs or have children. No new class should be needed, the existing Node
class in the marko
package will do the job just fine.
The Recipe
class will need to be changed such that the ingredients
and instructions
attributes are lists of Node
instead of str
.
The render_recipe_page
will need to be changed to render HTML from the markdown nodes before being passed to the Jinja template.
Currently, when you compile using the compile.py
script, you must pass in a --target
flag. However, this is confusing as target
commonly refers to an output directory. In this case, it refers to the relative path set for links within the site so that a user can debug the site locally and still have it work correctly when published to GitHub pages.
While the behavior of what the switch does shouldn't change, the flag to switch it should. Instead of -t
/--target
, a user should pass no flag to compile for local and a --prod
flag to compile for GitHub pages.
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.