Skip to content
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

Merged
merged 8 commits into from
Apr 20, 2016
Merged

Replace Hello World with usage examples on home page (src/templates/i… #47

merged 8 commits into from
Apr 20, 2016

Conversation

stevepiercy
Copy link
Member

…ndex.html).

…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.
@stevepiercy
Copy link
Member Author

Screenshot attached. Note that I scrolled down slightly to hide the red banner at the top of the page and to emphasize the examples.

google chrome002

@stevepiercy
Copy link
Member Author

Revised screenshot.

google chrome005

@blaflamme
Copy link
Member

Quickly...

  • We can have more features added than 4
  • I don't think we need to show we can stack decorators there?
  • Last example should return a dict not a string
  • try to have @view_config one liner, or put the args at the beginning of next line with 4 spaces, looks better
    ...

@stevepiercy
Copy link
Member Author

  • We can have more features added than 4

Which ones? How many is enough?

  • I don't think we need to show we can stack decorators there?

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.

  • Last example should return a dict not a string

Done.

  • try to have @view_config one liner, or put the args at the beginning of next line with 4 spaces, looks better ...

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.

google chrome006

@blaflamme
Copy link
Member

@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 @view_config but I'm not sure it's relevant as a marketing point of view at that stage. The more concise and similar to others we are, then people can figure out if they like what they see.

For other features we could show events and subscribers?

- simplify renderers to use single decorator
- create space for Events and Subscribers
@stevepiercy
Copy link
Member Author

@blaflamme done! Anything else? OK to merge?

google chrome007

@stevepiercy
Copy link
Member Author

@blaflamme is this OK to merge and deploy? I've added all the examples.

@blaflamme
Copy link
Member

@stevepiercy let me build that and have a quick look

@blaflamme
Copy link
Member

@stevepiercy I did some adjustments like returning a Response in examples before specifying the renderer and highlighting corresponding words in the text

screen shot 2016-04-19 at 9 48 43 am

@stevepiercy
Copy link
Member Author

I like these changes! Let's merge this!

I have one quibble: the monospace font in the syntax highlighter, Inconsolata, displays ' as and " as , which I find irritating. Google Fonts has a bunch of other monospace fonts that don't have that behavior, are legible, and have distinctive character pairs (O and 0, l and I), including Source Code Pro, Roboto Mono, Ubuntu Mono, and Cuisine. If you agree, let's create a new issue with my comment, and I'll leave the font decision to you.

@blaflamme
Copy link
Member

@stevepiercy you're tight I had the same thought about that. Lets find another font that fits the bill.

@blaflamme blaflamme merged commit 80b4a6e into Pylons:master Apr 20, 2016
@stevepiercy
Copy link
Member Author

Opened new issue #78.

@stevepiercy stevepiercy deleted the page-index-hello-to-usage branch April 22, 2016 07:54
@stevepiercy
Copy link
Member Author

Closes #31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants