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

Improve "introduction" page, add "Advanced Features" page #2634

Merged
merged 34 commits into from
Jun 6, 2017

Conversation

cewing
Copy link
Contributor

@cewing cewing commented Jun 3, 2016

This is a work in progress, please do not merge.

refs #2614

@cewing
Copy link
Contributor Author

cewing commented Jun 7, 2016

@stevepiercy can you help me figure out what I've done to break the build on this PR? And if you have time, some feedback on the direction I'm taking with these changes would be deeply appreciated.

@stevepiercy
Copy link
Member

@cewing I checked the build history https://ci.appveyor.com/project/mmerickel/pyramid/history but there is no record of the attempt to build when you made your last commit. I'd say it was just a temporary thing that might resolve itself with your next commit.

@digitalresistor
Copy link
Member

Looks like something went wrong with Appveyor, it seems to think this is an un-mergeable pull request.

@cewing
Copy link
Contributor Author

cewing commented Jun 7, 2016

I'll rebase on the changes from master and hopefully that will clear it up. As it is a WIP, I'm not too worried for the time being, but it'd be nice not to have too big a mess to clean up once the work is done :)

@stevepiercy
Copy link
Member

@cewing I forgot to mention, I like the direction you are headed. Active headings, simpler phrasing... all good stuff.

@tseaver
Copy link
Member

tseaver commented Oct 22, 2016

@cewing Wouldn't rebasing against master be cleaner than a merge which adds 168 commits? ;)

@mcdonc
Copy link
Member

mcdonc commented Oct 22, 2016

My bad. I told him to just merge.

@tseaver
Copy link
Member

tseaver commented Oct 22, 2016

OK. I sometimes find commit-by-commit review easier, and so try not to do big merges on "reviewable" branches.

@cewing
Copy link
Contributor Author

cewing commented Oct 22, 2016

Don't worry, @tseaver, I'll clean up before I ask anyone to review this.

@cewing
Copy link
Contributor Author

cewing commented May 22, 2017

@stevepiercy, @mmerickel

This PR is now ready for review. In short, here's what I've done:

  1. Changed section headers to make them more active
  2. Updated text to make it easier to digest for new developers
  3. Broke more esoteric features out into a new "Advanced Features" doc.

I'm happy to make whatever adjustments are requested.

@stevepiercy
Copy link
Member

@cewing we're gonna need a bigger 🍺 . I'll look this over tonight with review comments, if any. Thank you!

Copy link
Member

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am impressed. I can see you put a lot of careful thought and consideration into this, and it is much more approachable to a general audience. Thank you very much!

You Don't Need Singletons
-------------------------

Have you ever struggled with parametrizing Django's ``settings.py`` file for
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parameterizing

Have you ever struggled with parametrizing Django's ``settings.py`` file for
multiple installations of the same Django application? Have you ever needed to
monkey-patch a framework fixture to get it to behave properly for your
use-case? Have you ever tried to deploy your application using an asynchronous
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use case

server and failed?

All these problems are symptoms of "mutable global state", also known as
"import-time side effects" and arise from the use of "singleton" data structures.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I read this, I see someone making "air quotes". Seriously, though, these are undefined terms, and will fly over folks' heads unless they are defined somewhere. The terms should be linked to their definitions. Alternatively drop the air quotes and assume that the reader knows what these terms mean.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added some of these to the glossary and converted them to :term: references

if the request method is GET, another view if the request method is POST, and
so on.

:app:`Pyramid` uses a system of "view predicates" to allow this. Matching the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No air quotes. A link to view predicates either in the docs or glossary would be better.

query string, the Accept header, whether the request is an XHR request or not,
and lots of other things.

For our example above, you can do this instead::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use explicit .. code-block:: language on a new line after a single :, instead of implicit ::. This helps ensure that the code has valid language syntax and is highlighted with the proper Pygments lexer.

Mistakes happen. Problems crop up. No-one writes bug-free code. Pyramid
provides a way to handle the exceptions your code encounters. An
:term:`exception view` is a special kind of view which is automatically called
when an particular exception type "bubbles up" without being handled by your
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when a particular

also s/"bubbles up"/arises

For example, you might register an exception view for the :exc:`Exception`
exception type, which will catch *all* exceptions, and present a pretty "well,
this is embarrassing" page. Or you might choose to register an exception view
for only certain application-specific exceptions. You can make a one for when a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can make one

@@ -0,0 +1,399 @@
Advanced :app:`Pyramid` Design Features
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like the filename to be spelled out, "advanced-features". See below, too.

trolls" or other people who seem to get their rocks off by berating fellow
users in our various official support channels. We try to keep it well-lit and
new-user-friendly.
advfeatures
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"advanced-features"

nor discouraging the decision.
Similar to :term:`Zope`, :app:`Pyramid` applications may easily be extended. If
you work within the constraints of the framework, you can produce applications
that can be reused, modified or extended without needing to modify the original
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reused, modified, or extended (Oxford comma)

@cewing
Copy link
Contributor Author

cewing commented May 24, 2017

Thanks for the careful reading, @stevepiercy. Working on fixes now.

@cewing
Copy link
Contributor Author

cewing commented May 24, 2017

@stevepiercy, I've completed fixes to the advanced features file per your code review. I've also renamed the file as you requested, which seems to have marked all the diffs as out-of-date. You might take a final look at that file before giving it the go-ahead.

I'll finish the intro text CR fixes tomorrow or soon.

and 95% decision/condition coverage. (as measured by `instrumental <http://instrumental.readthedocs.io/en/latest/intro.html>`_)
It is automatically tested using `Travis <https://travis-ci.org/Pylons/pyramid>`_
and `Jenkins <http://jenkins.pylonsproject.org/job/pyramid/>`_
on supported versions of Python after each commit to its GitHub repository.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although Plone docs use semantic line breaks, that went over like a lead balloon with Pylons Project core developers: #2633

One line per sentence was kinda sorta OK.

One line per paragraph in .rst only is preferred.

Otherwise the changes look good.


if __name__ == '__main__':
config = Configurator()
config.add_response_adapter(string_response_adapter, basestring)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

str, the docs are focused on python 3 over python 2.


if __name__ == '__main__':
config = Configurator()
config.add_response_adapter(string_response_adapter, basestring)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

str, the docs are focused on python 3 over python 2.

@cewing
Copy link
Contributor Author

cewing commented Jun 3, 2017

Okay. @mmerickel, @stevepiercy, this should be ready to go, unless you have more requested changes. I think I've addressed everything from your reviews. Thanks for the thoughtful and close reading!

c

@cewing cewing changed the title WIP: improve "introduction" page. Improve "introduction" page, add "Advanced Features" page Jun 4, 2017
Copy link
Member

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These change requests should be quick. A few changes got overlooked from my original review, so I've collected them all in a single review here.

As an FYI for future PRs regarding line lengths and breaks, I updated this on my style-guide branch. I won't hold back this PR for line breaks/lengths here because your work is herculean and I am experimenting with running all docs through a post-processor anyway, pre-release of 1.9-branch.

But if you're a developer who likes the aesthetics of simplicity, Pyramid
provides an way to support this sort of thing, the *response adapter*:
But if you're a developer who likes the aesthetics of simplicity,
:app:`Pyramid` provides an way to support this sort of thing, the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

provides a way

----------------------------------------

Speaking of the :app:`Pyramid` structured "include" mechanism (see
:meth:`~pyramid.config.Configurator.include`), it allows you to compose complex
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's condense these lines:

structured :meth:`~pyramid.config.Configurator.include` mechanism, it allows you to compose complex


But if you're a developer who likes the aesthetics of simplicity,
:app:`Pyramid` provides an way to support this sort of thing, the
:term:`response adapter`\ :
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"provides a way"

demonstrations of common scenarios you might face. Contributions in the form of
improvements to our documentation are always appreciated. And we always welcome
improvements to our `official tutorials
<http://docs.pylonsproject.org/projects/pyramid/en/latest/#tutorials>`_ as well
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I goofed. This should be:

:ref:`official tutorials <html_tutorials>`


The :app:`Pyramid` documentation is comprehensive. We strive to keep our
narrative documentation both complete and friendly to newcomers. We also
maintain a :ref:`cookbook <cookbook:pyramid-cookbook>` of recipes,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maintain the :ref:`Pyramid Community Cookbook <cookbook:pyramid-cookbook>` of recipes,

improvements to our `official tutorials
<http://docs.pylonsproject.org/projects/pyramid/en/latest/#tutorials>`_ as well
as new contributions to our `community maintained tutorials
<http://docs.pylonsproject.org/projects/pyramid-tutorials/en/latest/index.html#pyramid-tutorials>`_.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I goofed again, this time forgetting about Intersphinx links.

:ref:`community maintained tutorials <tutorials:pyramid-tutorials>`

The :app:`Pyramid` documentation is comprehensive. We strive to keep our
narrative documentation both complete and friendly to newcomers. We also
maintain a :ref:`cookbook <cookbook:pyramid-cookbook>` of recipes,
demonstrations of common scenarios you might face. Contributions in the form of
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"demonstrating common"

at the top of the screen based on an enumeration of views they registered.

This is possible using Pyramid's :term:`introspector`.
Mistakes happen. Problems crop up. No-one writes bug-free code. :app:`Pyramid`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"No one" is not hyphenated.

Mistakes happen. Problems crop up. No-one writes bug-free code. :app:`Pyramid`
provides a way to handle the exceptions your code encounters. An
:term:`exception view` is a special kind of view which is automatically called
when an particular exception type "bubbles up" without being handled by your
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"exception type arises without"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, and "a particular" :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch. Misteaks happen. 😛

For example, you might register an exception view for the :exc:`Exception`
exception type, which will catch *all* exceptions, and present a pretty "well,
this is embarrassing" page. Or you might choose to register an exception view
for only certain application-specific exceptions. You can make a one for when a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"You can make one"

@cewing
Copy link
Contributor Author

cewing commented Jun 5, 2017

Okay, @stevepiercy, fixed those last few, found a couple more of my own, and reflowed both docs to use the one-line-per-paragraph style.

Copy link
Member

@stevepiercy stevepiercy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one tiny wafer-thin change, and I'm good. Ping @mmerickel to check whether his request for review has been satisfied.

Documented
~~~~~~~~~~

The :app:`Pyramid` documentation is comprehensive. We strive to keep our narrative documentation both complete and friendly to newcomers. We also maintain the :ref:`Pyramid Community Cookbook <cookbook:pyramid-cookbook>` of ecipes demonstrating common scenarios you might face. Contributions in the form of improvements to our documentation are always appreciated. And we always welcome improvements to our `official tutorials <html_tutorials>`_ as well as new contributions to our `community maintained tutorials <tutorials:pyramid-tutorials>`_.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"of ecipes" is missing an "r".

@cewing
Copy link
Contributor Author

cewing commented Jun 6, 2017

heh. Reflow error. Fixed now. Have at it, @mmerickel! And thanks again for being a great editor, @stevepiercy

@mmerickel
Copy link
Member

Fantastic work @cewing !

@stevepiercy stevepiercy merged commit c4f00ba into Pylons:master Jun 6, 2017
@stevepiercy
Copy link
Member

Thank you!

@tseaver
Copy link
Member

tseaver commented Jun 6, 2017

FWIW, this PR would have been a really good candidate for a squash merge.

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

Successfully merging this pull request may close these issues.

7 participants