-
Notifications
You must be signed in to change notification settings - Fork 33
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
Replace Hello World with usage examples on home page (src/templates/i… #47
Replace Hello World with usage examples on home page (src/templates/i… #47
Conversation
…ndex.html). - This PR replaces branch usage-pattern-examples, which may be deleted. - Needs code examples for Renderers and Asset Specifications. - See issue #31. - ping @blaflamme for review and design expertise.
Quickly...
|
Which ones? How many is enough?
What would you do differently? @ergo might offer further thoughts, since these revisions came from a discussion with him. The reasoning for stacking decorators there is two-fold: to show that decorators can be stacked and how they can be used for renderers.
Done.
When doing this, then the code soft-wraps, like this: @view_config(route_name='home', request_method=('POS
T'),
renderer='string') So then I tried widening the left column, and that made it worse, making the right column harder to read. I also went back and forth between a PEP8-ish code layout and the visual appeal of what you suggest. Neither looked "right" to me. It depends on whether I looked at it from the perspective of a developer or an aesthete. Another consideration. In this latest commit/push, I've tried to make it look less bad, but it's a really hard design issue to solve. Screenshot attached. |
@stevepiercy I know it's a pain... I usually do my block like this, even if it's not PEP8 compliant @view_config(
route_name='home',
renderer='myapp:templates/my_template.jinja2'
)
def home(request):
return {"greet": 'Welcome!', "name": 'Akhenaten'} Ok I understand the point for stacking For other features we could show events and subscribers? |
- simplify renderers to use single decorator - create space for Events and Subscribers
@blaflamme done! Anything else? OK to merge? |
@blaflamme is this OK to merge and deploy? I've added all the examples. |
@stevepiercy let me build that and have a quick look |
@stevepiercy I did some adjustments like returning a Response in examples before specifying the renderer and highlighting corresponding words in the text |
I like these changes! Let's merge this! I have one quibble: the monospace font in the syntax highlighter, Inconsolata, displays |
@stevepiercy you're tight I had the same thought about that. Lets find another font that fits the bill. |
Opened new issue #78. |
Closes #31 |
…ndex.html).