Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Purge references to Popper from docs.

  • Loading branch information...
commit d01c8bd65f0235913fdc055853345a1f300e3476 1 parent da38eb7
@chrisrossi chrisrossi authored
Showing with 72 additions and 766 deletions.
  1. +2 −0  .gitignore
  2. +7 −2 CHANGES.txt
  3. +10 −45 README.rst
  4. +0 −2  docs/.gitignore
  5. +4 −4 docs/Makefile
  6. +13 −51 docs/about.rst
  7. +15 −106 docs/conf.py
  8. +0 −4 docs/example/CHANGES.txt
  9. +0 −2  docs/example/MANIFEST.in
  10. +0 −1  docs/example/README.txt
  11. +0 −50 docs/example/development.ini
  12. +0 −9 docs/example/example1/__init__.py
  13. +0 −1  docs/example/example1/templates/index.pt
  14. +0 −13 docs/example/example1/test_webtest.py
  15. +0 −14 docs/example/example1/views.py
  16. +0 −11 docs/example/example2/__init__.py
  17. +0 −12 docs/example/example2/templates/index.pt
  18. +0 −13 docs/example/example2/test_webtest.py
  19. +0 −14 docs/example/example2/views.py
  20. +0 −12 docs/example/example3/__init__.py
  21. +0 −12 docs/example/example3/panels.py
  22. +0 −12 docs/example/example3/templates/index.pt
  23. +0 −16 docs/example/example3/test_webtest.py
  24. +0 −14 docs/example/example3/views.py
  25. +0 −27 docs/example/setup.cfg
  26. +0 −40 docs/example/setup.py
  27. +0 −24 docs/faq.rst
  28. +0 −71 docs/howitworks.rst
  29. BIN  docs/images/example1.png
  30. BIN  docs/images/example2.png
  31. BIN  docs/images/example3.png
  32. +6 −22 docs/index.rst
  33. +0 −4 docs/usinglayoutspanels.rst
  34. +0 −146 docs/usingpopper.rst
  35. +4 −2 setup.cfg
  36. +11 −10 setup.py
View
2  .gitignore
@@ -8,3 +8,5 @@ lib
.coverage
*.sw?
dist
+_build
+venv
View
9 CHANGES.txt
@@ -1,5 +1,10 @@
-pyramid_bottlecap changelog
-===========================
+pyramid_layout changelog
+========================
+
+Unreleased
+----------
+
+- Changed name from pyramid_bottlecap to pyramid_layout.
0.3 (2012-04-19)
----------------
View
55 README.rst
@@ -1,47 +1,12 @@
-=========
-Bottlecap
-=========
-
-When building a new Pyramid application, you might want an attractive
-starting point for your UI. Later, as you need a custom UX, you might
-want a system for organizing your global UX and shared templating into
-layouts and panels.
-
-Bottlecap serves that purpose.
-
-- Inject Bottlecap into your application
-
-- Point your ZPTs at Bottlecap's Popper layout
-
-- Configure, override and extend using Pyramid machinery
-
-- Later, make and register your own layouts and panels
-
-Quick Start
-===========
-
-You can see Bottlecap added to a sample Pyramid app that ships in
-Bottlecap:
-
-#. Make a virtualenv as usual.
-
-#. ``git clone git@github.com:pauleveritt/pyramid_bottlecap.git``
-
-#. ``cd pyramid_bottlecap``
-
-#. ``/virtualenv/bin/python setup.py develop``
-
-#. ``cd sample``
-
-#. ``/virtualenv/bin/python setup.py develop``
-
-#. ``/virtualenv/bin/pserve development.ini --reload``
-
-#. Open ``http://localhost:6543`` in a browser.
-
-Bottlecap will now be running on port 6543. To run the WebTest tests
-on the templates in the sample app::
-
- $ ``/virtualenv/bin/nosetests``
+==============
+Pyramid Layout
+==============
+
+Pyramid Layout is an add-on for the Pyramid Web Framework which allows
+developers to utilize the concept of a UI layout to your Pyramid application.
+Different layouts may be registered for use in different contexts of your
+application. The concept of panels is also introduced to facilitate rendering
+of subsections of a page in a consistent way across different views in a
+reusable way.
More information is available in the ``docs`` directory.
View
2  docs/.gitignore
@@ -1,2 +0,0 @@
-_themes
-_build
View
8 docs/Makefile
@@ -77,17 +77,17 @@ qthelp:
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
- @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Bottlecap.qhcp"
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/PyramidLayout.qhcp"
@echo "To view the help file:"
- @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Bottlecap.qhc"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PyramidLayout.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
- @echo "# mkdir -p $$HOME/.local/share/devhelp/Bottlecap"
- @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Bottlecap"
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/PyramidLayout"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/PyramidLayout"
@echo "# devhelp"
epub:
View
64 docs/about.rst
@@ -1,15 +1,14 @@
-=================================
-About Layouts, Panels, and Popper
-=================================
+=====================
+About Layouts, Panels
+=====================
If you are writing your own UX for your Pyramid project,
-Bottlecap provides a way to write your layout templates and logic,
+Pyramid Layout provides a way to write your layout templates and logic,
register them, and use them in your view templates. As you refactor,
you can make re-usable pieces called panels for your layout and view
templates.
-This section introduces the concepts of "layout" and "panel". Also,
-the bundled UX known as "Popper" is explained.
+This section introduces the concepts of "layout" and "panel".
About Layouts
=============
@@ -23,14 +22,14 @@ logic in it and needs data. Usually each view had to pass in
that data. Later, Pyramid's renderer globals provided an elegant
facility for always having certain data available in all renderings.
-In Bottlecap, these ideas are brought together and given a name:
+In Pyramid Layout, these ideas are brought together and given a name:
Layout. A layout is a combination of templating and logic which wraps
-up a view. With Bottlecap, "layout" becomes a first-class citizen with
+up a view. With Pyramid Layout, "layout" becomes a first-class citizen with
helper config machinery and defined plug points.
-In more complex projects, different parts of the same site need
-different layouts. Bottlecap provides a way for naming your layouts and
-selecting them in a view.
+In more complex projects, different parts of the same site need different
+layouts. Pyramid Layout provides a way for managing the use of different
+layouts in different places in your application.
About Panels
============
@@ -45,49 +44,12 @@ templating with a marginal amount of overidability. Like main templates,
though, they also have logic and data that need to be schlepped into the
template.
-Bottlecap addresses these re-usable snippets with "panels". A panel is
+Pyramid Layout addresses these re-usable snippets with "panels". A panel is
a box on the screen driven by templating and logic. You make panels,
register them, and you can then use them in your view templates or
layout templates.
Moreover, making and using them is a very Pythonic,
Pyramid-ic process. For example, you call your panel as a normal Python
-callable and can pass it arguments.
-
-About Popper
-============
-
-"Screw all that, I just want that slick UX that Bottlecap ships with."
-
-Bottlecap was developed for the KARL project, building on lessons it
-learned with a very large, customized-per-customer UX system. Once we
-had the layout and panel machinery, we then made a UX. We decided to
-ship that UX, with plug points, as a layout that all the worldwide
-intertubes could use.
-
-That layout is called Popper and it has some nice features as a
-starting point for your Pyramid app:
-
-- It's very, very attractive with a lot of attention to detail.
-
-- We have tested it heavily across browsers, with WebTest tests and more
-
-- We maintain it and fix bugs as part of the KARL project
-
-- The logical structure and thus plug points are documented
-
-- Lots of detail was paid to things like caching assets with far-future
- expires and versioned URLs, using Juicer to eliminate extra HTTP
- requests, etc.
-
-- Slickest of all, it was built from the start with "responsive design"
- in mind, which means it adapts supernaturally for large desktops,
- small desktops, landscape tablet, portrait table, landscape phone,
- and portrait phone
-
-.. note::
-
- The name "Popper" comes from
- `Karl Popper <http://en.wikipedia.org/wiki/Karl_Popper>`_,
- the economic philosopher, founder of the idea and study of open
- societies, and economics teacher to George Soros.
+callable and can pass it arguments. Registration of panels, like layouts,
+is very similar to registration of views in Pyramid.
View
121 docs/conf.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
#
-# Bottlecap documentation build configuration file, created by
-# sphinx-quickstart on Wed Jan 4 16:41:52 2012.
+# Pyramid Layout documentation build configuration file, created by
+# sphinx-quickstart on Thu Aug 9 11:58:01 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
@@ -25,12 +25,7 @@
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.viewcode']
-
-# Looks for pyramid's objects
-intersphinx_mapping = {
- 'pyramid':
- ('http://docs.pylonsproject.org/projects/pyramid/dev/', None)}
+extensions = ['sphinx.ext.autodoc']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
@@ -45,17 +40,17 @@
master_doc = 'index'
# General information about the project.
-project = u'Bottlecap'
-copyright = u'2012, Paul Everitt'
+project = u'Pyramid Layout'
+copyright = u'2012, Chris Rossi, Paul Everitt'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
-version = '0.1'
+version = '0.4'
# The full version, including alpha/beta/rc tags.
-release = '0.1'
+release = '0.4'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -96,46 +91,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
-#html_theme = 'default'
-
-# Add and use Pylons theme
-if 'sphinx-build' in ' '.join(sys.argv): # protect against dumb importers
- from subprocess import call, Popen, PIPE
-
- p = Popen('which git', shell=True, stdout=PIPE)
- git = p.stdout.read().strip()
- cwd = os.getcwd()
- _themes = os.path.join(cwd, '_themes')
-
- if not os.path.isdir(_themes):
- call([git, 'clone', 'git://github.com/Pylons/pylons_sphinx_theme.git',
- '_themes'])
- else:
- os.chdir(_themes)
- call([git, 'checkout', 'master'])
- call([git, 'pull'])
- os.chdir(cwd)
-
- sys.path.append(os.path.abspath('_themes'))
-
- parent = os.path.dirname(os.path.dirname(__file__))
- sys.path.append(os.path.abspath(parent))
- wd = os.getcwd()
- os.chdir(parent)
- os.system('%s setup.py test -q' % sys.executable)
- os.chdir(wd)
-
- for item in os.listdir(parent):
- if item.endswith('.egg'):
- sys.path.append(os.path.join(parent, item))
-
-html_theme_path = ['_themes']
-html_theme = 'pyramid'
-html_theme_options = dict(
- github_url='https://github.com/Pylons/pyramid',
-# in_progress='true'
- )
-
+html_theme = 'default'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
@@ -208,7 +164,7 @@
#html_file_suffix = None
# Output file base name for HTML help builder.
-htmlhelp_basename = 'Bottlecapdoc'
+htmlhelp_basename = 'PyramidLayoutdoc'
# -- Options for LaTeX output --------------------------------------------------
@@ -227,8 +183,8 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
- ('index', 'Bottlecap.tex', u'Bottlecap Documentation',
- u'Paul Everitt', 'manual'),
+ ('index', 'PyramidLayout.tex', u'Pyramid Layout Documentation',
+ u'Chris Rossi, Paul Everitt', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
@@ -257,8 +213,8 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
- ('index', 'bottlecap', u'Bottlecap Documentation',
- [u'Paul Everitt'], 1)
+ ('index', 'pyramidlayout', u'Pyramid Layout Documentation',
+ [u'Chris Rossi, Paul Everitt'], 1)
]
# If true, show URL addresses after external links.
@@ -271,8 +227,8 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
- ('index', 'Bottlecap', u'Bottlecap Documentation',
- u'Paul Everitt', 'Bottlecap', 'One line description of project.',
+ ('index', 'PyramidLayout', u'Pyramid Layout Documentation',
+ u'Chris Rossi, Paul Everitt', 'PyramidLayout', 'One line description of project.',
'Miscellaneous'),
]
@@ -284,50 +240,3 @@
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
-
-
-# -- Options for Epub output ---------------------------------------------------
-
-# Bibliographic Dublin Core info.
-epub_title = u'Bottlecap'
-epub_author = u'Paul Everitt'
-epub_publisher = u'Paul Everitt'
-epub_copyright = u'2012, Paul Everitt'
-
-# The language of the text. It defaults to the language option
-# or en if the language is not set.
-#epub_language = ''
-
-# The scheme of the identifier. Typical schemes are ISBN or URL.
-#epub_scheme = ''
-
-# The unique identifier of the text. This can be a ISBN number
-# or the project homepage.
-#epub_identifier = ''
-
-# A unique identification for the text.
-#epub_uid = ''
-
-# A tuple containing the cover image and cover page html template filenames.
-#epub_cover = ()
-
-# HTML files that should be inserted before the pages created by sphinx.
-# The format is a list of tuples containing the path and title.
-#epub_pre_files = []
-
-# HTML files shat should be inserted after the pages created by sphinx.
-# The format is a list of tuples containing the path and title.
-#epub_post_files = []
-
-# A list of files that should not be packed into the epub file.
-#epub_exclude_files = []
-
-# The depth of the table of contents in toc.ncx.
-#epub_tocdepth = 3
-
-# Allow duplicate toc entries.
-#epub_tocdup = True
-
-
-# Example configuration for intersphinx: refer to the Python standard library.
-intersphinx_mapping = {'http://docs.python.org/': None}
View
4 docs/example/CHANGES.txt
@@ -1,4 +0,0 @@
-0.0
----
-
-- Initial version
View
2  docs/example/MANIFEST.in
@@ -1,2 +0,0 @@
-include *.txt *.ini *.cfg *.rst
-recursive-include example *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml
View
1  docs/example/README.txt
@@ -1 +0,0 @@
-example README
View
50 docs/example/development.ini
@@ -1,50 +0,0 @@
-[app:main]
-use = egg:example
-
-pyramid.reload_templates = true
-pyramid.debug_authorization = false
-pyramid.debug_notfound = false
-pyramid.debug_routematch = false
-pyramid.debug_templates = true
-pyramid.default_locale_name = en
-pyramid.includes = pyramid_debugtoolbar
-
-bottlecap.site_title = Doc Sample
-bottlecap.site_title_link = /
-bottlecap.devmode = true
-
-[server:main]
-use = egg:pyramid#wsgiref
-host = 0.0.0.0
-port = 6543
-
-# Begin logging configuration
-
-[loggers]
-keys = root, example
-
-[handlers]
-keys = console
-
-[formatters]
-keys = generic
-
-[logger_root]
-level = INFO
-handlers = console
-
-[logger_example]
-level = DEBUG
-handlers =
-qualname = example
-
-[handler_console]
-class = StreamHandler
-args = (sys.stderr,)
-level = NOTSET
-formatter = generic
-
-[formatter_generic]
-format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
-
-# End logging configuration
View
9 docs/example/example1/__init__.py
@@ -1,9 +0,0 @@
-""" This is a simple Pyramid app, no Bottlecap """
-
-from pyramid.config import Configurator
-
-def main(global_config, **settings):
- config = Configurator(settings=settings)
- config.scan('example.views')
- return config.make_wsgi_app()
-
View
1  docs/example/example1/templates/index.pt
@@ -1 +0,0 @@
-<div>Hello World</div>
View
13 docs/example/example1/test_webtest.py
@@ -1,13 +0,0 @@
-from unittest import TestCase
-from webtest import TestApp
-
-class BottlecapFunctionalTests(TestCase):
- def setUp(self):
- from example import main
- app = main({})
- self.testapp = TestApp(app)
-
- def test_it(self):
- res = self.testapp.get('/', status=200)
- self.assertTrue('Hello World' in res.body)
-
View
14 docs/example/example1/views.py
@@ -1,14 +0,0 @@
-from pyramid.view import view_config
-
-class ExampleViews(object):
-
- def __init__(self, context, request):
- self.context = context
- self.request = request
-
- @view_config(renderer="templates/index.pt")
- def index_view(self):
- """ Default View """
-
- return dict(project="Example Project 1")
-
View
11 docs/example/example2/__init__.py
@@ -1,11 +0,0 @@
-""" Add the Popper layout from Bottlecap, nothing more
-"""
-
-from pyramid.config import Configurator
-
-def main(global_config, **settings):
- config = Configurator(settings=settings)
- config.include('bottlecap')
- config.scan('example.views')
- return config.make_wsgi_app()
-
View
12 docs/example/example2/templates/index.pt
@@ -1,12 +0,0 @@
-<metal:block use-macro="main_template">
- <metal:content fill-slot="content">
-
- <header>
- <h1>Hello World, In Popper</h1>
- </header>
- <div class="contentText">
- Just some styling.
- </div>
-
- </metal:content>
-</metal:block>
View
13 docs/example/example2/test_webtest.py
@@ -1,13 +0,0 @@
-from unittest import TestCase
-from webtest import TestApp
-
-class BottlecapFunctionalTests(TestCase):
- def setUp(self):
- from example import main
- app = main({})
- self.testapp = TestApp(app)
-
- def test_it(self):
- res = self.testapp.get('/', status=200)
- self.assertTrue('Hello World, In Popper' in res.body)
-
View
14 docs/example/example2/views.py
@@ -1,14 +0,0 @@
-from pyramid.view import view_config
-
-class ExampleViews(object):
-
- def __init__(self, context, request):
- self.context = context
- self.request = request
-
- @view_config(renderer="templates/index.pt")
- def index_view(self):
- """ Default View """
-
- return dict(project="Example 2")
-
View
12 docs/example/example3/__init__.py
@@ -1,12 +0,0 @@
-""" Override the data for the global-nav panel
-"""
-
-from pyramid.config import Configurator
-
-def main(global_config, **settings):
- config = Configurator(settings=settings)
- config.include('bottlecap')
- config.scan('example.views')
- config.scan('example.panels')
- return config.make_wsgi_app()
-
View
12 docs/example/example3/panels.py
@@ -1,12 +0,0 @@
-from bottlecap.panel import panel_config
-
-template_dir = 'bottlecap:layouts/popper/templates'
-
-@panel_config(name='popper.global_nav',
- renderer=template_dir + '/global_nav.pt')
-def global_nav(context, request):
- nav_menu = [
- dict(title="Projects", url='/', selected="selected"),
- dict(title="Customers", url='/communities', selected=None),
- ]
- return {'nav_menu': nav_menu}
View
12 docs/example/example3/templates/index.pt
@@ -1,12 +0,0 @@
-<metal:block use-macro="main_template">
- <metal:content fill-slot="content">
-
- <header>
- <h1>Hello World, In Popper</h1>
- </header>
- <div class="contentText">
- Just some styling.
- </div>
-
- </metal:content>
-</metal:block>
View
16 docs/example/example3/test_webtest.py
@@ -1,16 +0,0 @@
-from unittest import TestCase
-from webtest import TestApp
-
-class BottlecapFunctionalTests(TestCase):
- def setUp(self):
- from example import main
- app = main({})
- self.testapp = TestApp(app)
-
- def test_it(self):
- res = self.testapp.get('/', status=200)
- self.assertTrue('Hello World, In Popper' in res.body)
- self.assertTrue('Item 1' not in res.body)
- self.assertTrue('Projects' in res.body)
- self.assertTrue('Customers' in res.body)
-
View
14 docs/example/example3/views.py
@@ -1,14 +0,0 @@
-from pyramid.view import view_config
-
-class ExampleViews(object):
-
- def __init__(self, context, request):
- self.context = context
- self.request = request
-
- @view_config(renderer="templates/index.pt")
- def index_view(self):
- """ Default View """
-
- return dict(project="Example 3")
-
View
27 docs/example/setup.cfg
@@ -1,27 +0,0 @@
-[nosetests]
-match = ^test
-nocapture = 1
-cover-package = example
-with-coverage = 1
-cover-erase = 1
-
-[compile_catalog]
-directory = example/locale
-domain = example
-statistics = true
-
-[extract_messages]
-add_comments = TRANSLATORS:
-output_file = example/locale/mrtoonz.pot
-width = 80
-
-[init_catalog]
-domain = example
-input_file = example/locale/example.pot
-output_dir = example/locale
-
-[update_catalog]
-domain = example
-input_file = example/locale/example.pot
-output_dir = example/locale
-previous = true
View
40 docs/example/setup.py
@@ -1,40 +0,0 @@
-import os
-
-from setuptools import setup, find_packages
-
-here = os.path.abspath(os.path.dirname(__file__))
-README = open(os.path.join(here, 'README.txt')).read()
-CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
-
-requires = [
- 'pyramid>=1.3a1',
- 'pyramid_debugtoolbar',
- 'pyramid_exclog',
- ]
-
-setup(name='example',
- version='0.0',
- description='example',
- long_description=README + '\n\n' + CHANGES,
- classifiers=[
- "Programming Language :: Python",
- "Framework :: Pylons",
- "Topic :: Internet :: WWW/HTTP",
- "Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
- ],
- author='',
- author_email='',
- url='',
- keywords='web pyramid pylons',
- packages=find_packages(),
- include_package_data=True,
- zip_safe=False,
- install_requires=requires,
- tests_require=requires,
- test_suite="example",
- entry_points = """\
- [paste.app_factory]
- main = example:main
- """,
- )
-
View
24 docs/faq.rst
@@ -1,24 +0,0 @@
-===
-FAQ
-===
-
-- can use non-chameleon
-
-- asset overloading
-
-- not using macros on the main template, look at the first line!
-
-- not using macros on your view template first line
-
-- panel result wrapped in structure
-
-- panel failure doesn't kill the entire page
-
-- overriding static assets
-
-- overriding panels
-
-Popper
-======
-
-- quick panels and menus
View
71 docs/howitworks.rst
@@ -1,71 +0,0 @@
-============
-How It Works
-============
-
-This section breaks down the approach used by Bottlecap.
-
-Summary
-=======
-
-What does Bottlecap do?
-
-- Make custom Bottlecap directives available via Configurator
-
-- Inject layouts (and a layout manager) into Pyramid
- `renderer globals <http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/hooks.html#using-the-before-render-event>`_
-
-- You then tell your view templates to use a layout, such as Popper
-
-- You override static assets such as templates, images, and CSS using
- normal Pyramid overrides
-
-- You make a custom Layout, providing a layout template and a class as
- the "Template API"
-
-- Register panels using ``@panel_config`` and call them from your
- template expressions
-
-In Depth
-========
-
-In your project you do a ``config.include('bottlecap')`` which makes a
-number of things happen:
-
-- Config directives are registered which let you add a layout or panel
-
-- A ``@panel_config`` decorator is made available for
- creating/overriding panels
-
-- The layouts, panels, and static resources in the Popper layout are
- made available
-
-On each request, Bottlecap does some new work:
-
-- A "layout manager" is created, which does the work of choosing which
- layout to use
-
-- ``request.layout_manager`` gets created, which lets your application
- influence the decisions
-
-- ``request.layout`` gets created, which points to the instance of the
- layout. This instance has all the helper methods and properties
- needed to drive the layout. If you wrote the layout,
- then you wrote this class. XXX This is not true. There is no
- ``request.layout``. The layout can be accessed via i
- ``request.layout_manager.layout``.
-
-On each rendering, Bottlecap does some more work:
-
-- The chosen layout's instance is made available in the template
-
-- As is the template itself
-
-- A callable, ``panel``, is made available, which gives access to panels you
- might want to use in your template
-
-So in summary:
-
-- Bottlecap manages things called layouts and panels,
- apart from your views
-
-- Bottlecap then makes these available in your view and template
View
BIN  docs/images/example1.png
Deleted file not rendered
View
BIN  docs/images/example2.png
Deleted file not rendered
View
BIN  docs/images/example3.png
Deleted file not rendered
View
28 docs/index.rst
@@ -1,28 +1,16 @@
-.. Bottlecap documentation master file, created by
- sphinx-quickstart on Wed Jan 4 16:41:52 2012.
- You can adapt this file completely to your liking, but it should at least
- contain the root `toctree` directive.
+=====================================================
+Pyramid Layout: Composable, Attractive UX for Pyramid
+=====================================================
-================================================
-Bottlecap: Composable, Attractive UX for Pyramid
-================================================
-
-Making an attractive, efficient user-experience (UX) is hard. Bottlecap
+Making an attractive, efficient user-experience (UX) is hard. Pyramid Layout
provides a layout-based approach to building your global look-and-feel
then re-using it across your site. You can then manage your global UX
"layout" as a unit, just like models, views, static resources, and
other parts of Pyramid.
-Even better, Bottlecap ships an attractive, pluggable, well-maintained
-example layout called Popper which you can plug into your Pyramid app
-as a starting point.
-
Benefits
========
-- If you suck at prettiness, use Popper as your starting point until
- you need your own UX
-
- Work on your global look-and-feel (aka theme, aka skin,
aka main template, aka o-wrap) as a distinct artifact.
@@ -31,9 +19,9 @@ Benefits
.. note::
- Bottlecap is aimed at ZPT-based applications. You can write panels
+ Pyramid Layout is aimed at ZPT-based applications. You can write panels
in any templating system, as they simply have to return strings. It
- is possible that you can do all of Bottlecap in another
+ is possible that you can do all of Pyramid Layout in another
Pyramid-supported templating system, but that is untested.
Contents
@@ -43,10 +31,6 @@ Contents
:maxdepth: 2
about
- howitworks
- usingpopper
- usinglayoutspanels
- faq
Indices and tables
==================
View
4 docs/usinglayoutspanels.rst
@@ -1,4 +0,0 @@
-========================
-Using Layouts and Panels
-========================
-
View
146 docs/usingpopper.rst
@@ -1,146 +0,0 @@
-============
-Using Popper
-============
-
-Adding an existing layout such as Popper to your Pyramid application is
-a straightforward process. In this section we show the basics,
-including how to fill in the blanks and customize/override.
-
-.. note::
-
- The package for the ``example`` application below,
- and each variation of example1-X,
- is in the ``pyramid_bottlecap/docs/`` source tree. You can install
- the example package an use a symlink from one of the examples to
- ``example`` to run one of them.
-
-Starting Point
-==============
-
-Imagine we have a starting point, a package with an ``__init__.py``:
-
-.. literalinclude:: example/example1/__init__.py
-
-We have a ``views.py``:
-
-.. literalinclude:: example/example1/views.py
-
-...and a template at ``templates/index.pt``:
-
-.. literalinclude:: example/example1/templates/index.pt
- :language: html
-
-This is a very simple Pyramid app with no layout:
-
-.. image:: images/example1.png
-
-As a starting point:
-
-- A simple wsgi app, published with a config.scan pointed at views
-
-- One view, with one ZPT template
-
-.. note::
-
- The example sources ship with WebTest tests, but we aren't showing
- them in this walkthrough for the sake of brevity.
-
-Example 2: Plugging in Popper
-=============================
-
-Let's now do the same thing, but have our view templates rendered using
-the Popper layout. Our ``__init__.py`` adds a config include:
-
-.. literalinclude:: example/example2/__init__.py
- :linenos:
- :emphasize-lines: 8
-
-Only a small change in the project title in ``views.py``:
-
-.. literalinclude:: example/example2/views.py
- :linenos:
- :emphasize-lines: 11
-
-Our view template heads over into ZPT macro-land for
-``templates/index.pt``:
-
-.. literalinclude:: example/example2/templates/index.pt
- :linenos:
- :language: html
- :emphasize-lines: 1
-
-We ask for a layout with a macro of ``main_template``. This is just a
-convention, similar to ``self`` in Python. It refers to the
-currently-chosen layout, using Bottlecap's system of registering and
-choosing layouts.
-
-We can now see the Popper layout spring into action:
-
-.. image:: images/example2.png
-
-
-Example 3:
-=============================
-
-That's a sexy-looking layout. But it doesn't have my information in it.
-I don't want a global nav menu with "Item 1", "Item 2" in it. I want
-"Projects" and "Customers".
-
-Layouts have "panels" which can be overriden using Pyramid-like
-machinery, so let's do so. First, let's tell ``__init__.py`` to scan a
-(newly-created) panels module:
-
-.. literalinclude:: example/example3/__init__.py
- :linenos:
- :emphasize-lines: 10
-
-Again, only a small change in the project title in ``views.py``:
-
-.. literalinclude:: example/example3/views.py
- :linenos:
- :emphasize-lines: 11
-
-No change in the ZPT for our view template. But we do have a new file
-``panels.py`` where we override the built-in ``popper.global_nav`` panel:
-
-.. literalinclude:: example/example3/panels.py
- :linenos:
-
-This ``panels.py`` introduces the heart of Bottlecap:
-
-- Bottlecap defines a new decorator (and configuration directive)
- called ``panel_config`` which lets you create a new panel. Or in this
- case, override a built-in panel.
-
-- We point this directive a ``popper.global_nav``,
- which is the name of panel at the top.
-
-- Panels have templates and data/logic that go with them. We don't want
- to change the template, so we point at the built-in one. But we do
- want to change the calculation of the menu items.
-
-- Values returned by the panel function can be used in template for
- that panel.
-
-- This panel is called by the ``popper_layout.pt`` template,
- which does so with the following ZPT expression::
-
- ${panel('popper.global_logo')}
-
-- Panel function signatures can also ask for arguments, which can
- be passed in when the expression calls the panel::
-
- ${panel('popper.global_logo', height=90)}
- def global_nav(context, request, height):
-
- This is a handy way to pass information from the calling scope (your
- view) to the callee scope (the panel function.)
-
-The global nav menu at the top now has our stuff in it:
-
-.. image:: images/example3.png
-
-Later
-=====
-
-Static asset overriding, template overriding,
View
6 setup.cfg
@@ -3,11 +3,13 @@ zip_ok = false
[nosetests]
match=^test
-where=bottlecap
+where=pyramid_layout
nocapture=1
-cover-package=bottlecap
+cover-package=pyramid_layout
with-coverage = 1
cover-erase=1
[aliases]
test = nosetests
+dev = develop easy_install pyramid_layout[tests]
+docs = develop easy_install pyramid_layout[docs]
View
21 setup.py
@@ -32,22 +32,22 @@
]
tests_require = install_requires + ['coverage', 'nose', 'mock',
'webtest']
+docs_require = install_requires + ['sphinx']
+
if version < '2.7':
tests_require.append('unittest2')
-setup(name='pyramid_bottlecap',
+setup(name='pyramid_layout',
version=VERSION,
- description=('Nice UX you can plug in as a starting point for '
- 'your Pyramid application.'),
+ description='Pyramid add-on for facilitating UI layout',
long_description=README + '\n\n' + CHANGES,
classifiers=[
"Intended Audience :: Developers",
"Programming Language :: Python",
- "Framework :: Pylons",
- "Topic :: Internet :: WWW/HTTP :: WSGI",
+ "Framework :: Pyramid",
"License :: Repoze Public License",
],
- keywords='wsgi pylons bottlecap web pyramid',
+ keywords='wsgi pylons web pyramid',
author="Paul Everitt, Chris Rossi",
author_email="pylons-devel@googlegroups.com",
url="http://docs.pylonsproject.org",
@@ -57,8 +57,9 @@
zip_safe=False,
install_requires=install_requires,
tests_require=tests_require,
- test_suite="bottlecap",
- entry_points=""
- ,
- )
+ extras_require={
+ 'tests': tests_require,
+ 'docs': docs_require},
+ test_suite="pyramid_layout",
+ entry_points="")
Please sign in to comment.
Something went wrong with that request. Please try again.