diff --git a/.gitignore b/.gitignore deleted file mode 100644 index ad80a68..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*.egg-info/ -.idea/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 889673e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -language: python -sudo: false -python: - - "2.7" - - "3.5" - - "3.6" -env: - - DJANGO=1.8.0 - - DJANGO=1.9.0 - - DJANGO=1.10.0 - - DJANGO=1.11.0 -install: - - pip install -q Django~=$DJANGO -script: - - DJANGO_SETTINGS_MODULE=tests.settings python setup.py test - -matrix: - exclude: - - python: "2.7" - env: DJANGO=2.0.0 diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown deleted file mode 100644 index 84f6fb1..0000000 --- a/CHANGELOG.markdown +++ /dev/null @@ -1,83 +0,0 @@ -v0.4.0 ------- - -Added Py3.{5,6} & Django 1.11. Removed Py2.6 & Django <1.8 (#9) -* Quick fix for the DJANGO_VERSION error when using Python >= 3.6 (version calculation caching removed because it is not a performance penalty, urls are lazy and are calculated only once per an app start). - -* Added Py3.{5,6} & Django 1.11. Removed Py2.6 & Django <1.8 - -The latest Django LTS is 1.11. Its ok to support up to the "LTS -1" (1.8) only. -The next Django LTS is 2.0, and will be Py3k only, so lets start testing with Py3k! - -* Mark as Py3k compat on setup.py - -v0.3.1 ------- - -Fix for https://github.com/phpdude/django-macros-url/issues/8. - -v0.3.0 ------- - -Added support for Django 1.10 version. - -v0.2.3 ------- - -Development Status changed to "Development Status :: 5 - Production/Stable". - -v0.2.2 ------- - -Reverting tests back. - -v0.2.1 ------- - -Added `django.setup()` for tests, because looks like now it is required. README.markdown fixes. - -v0.2.0 ------- - -Added auto-calling as_view on CBVs objects. Now you can omit as_view() in your views by default. -Have your code more clean then before ;-) - -v0.1.7 ------- - -setup.py fixes in requires. - -v0.1.6 ------- - -Tests updated to support Django1.8. Travis configuration updated too. Small cleanups. - -v0.1.5 ------- - -Add uuid version to uuid regex - -v0.1.4 ------- - -Readme fixes. - -v0.1.3 ------- - -macrosurl.__init__ django import fix to allow install macros-url when django is not installed yet. - -v0.1.2 ------- - -added pk macros - -v0.1.1 ------- - -Support for include('path.to.url') view added. Urls normalization by adding dollar at end fixed to support include. Tests added. - -v0.1.0 ------- - -Basic functionality done. \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 1bfca8d..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -include README.markdown \ No newline at end of file diff --git a/README.markdown b/README.markdown deleted file mode 100644 index d34a4e4..0000000 --- a/README.markdown +++ /dev/null @@ -1,130 +0,0 @@ -# [Django Macros URL](https://github.com/phpdude/django-macros-url/) v0.4.0 - Routing must be simple as possible - -Django Macros URL makes it easy to write (and read) URL patterns in your Django applications by using macros. - -You can combine your prefixes with macro names with an underscore, for example, you can use a macro `:slug` -and `:product_slug`. They both will be compiled to same regex pattern with their group names of course. -Multiple underscores accepted too. - -[![Build Status](https://travis-ci.org/phpdude/django-macros-url.svg?branch=master)](https://travis-ci.org/phpdude/django-macros-url) - -### Supported macros by default - -``` -slug - [\w-]+ -year - \d{4} -month - (0?([1-9])|10|11|12) -day - ((0|1|2)?([1-9])|[1-3]0|31) -id - \d+ -pk - \d+ -page - \d+ -uuid - [a-fA-F0-9]{8}-?[a-fA-F0-9]{4}-?[1345][a-fA-F0-9]{3}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{12} -``` - -If you want to offer more macros by default, you can fork and make a pull request. - -### Installation - -You can install the library with PyPI. - -``` -pip install django-macros-url -``` - -### Usage - -Django Macros URLs used the same way as Django standard URLs. You just import this and declare your -patterns with macros. - -Also, you can register new macro (or maybe you want to replace default macro with your like regex -pattern) with `macrosurl.register(macro, pattern)` method. - -An example of registration. - -```python -import macrosurl - -macrosurl.register('myhash', '[a-f0-9]{9}') - -urlpatterns = patterns( - 'yourapp.views', - macrosurl.url('^:myhash/$', 'myhash_main'), - macrosurl.url('^news/:news_myhash/$', 'myhash_news'), -) -``` - -Feel free to register custom macro anywhere (i do it in main urls.py file). Macros URLs uses lazy -initialization. Macros will be compiled only on the first request. - -### URL normalization - -Once Macros URL completed compile regex pattern, it makes normalization of it by rules: - -- Strip from left side all whitespace and ^ -- Strip from right side of pattern all whitespace and $ -- Add to left side ^ -- Add to right side $ - -This makes your URLs always very strong to adding any unexpected params into a path. - -### Auto-calling as_view() on CBV objects. - -Library check type of view and if a view is type object with defined 'as_view' function, call this. This allows -you omit ".as_view()" calls in your urls.py files. But you can call this manual with params if you need. - -This feature helps you to keep your urls.py files clean as possible. I hope you like this feature! - -### Examples - -Macros URL example urls.py file - -```python -from django.conf.urls import patterns -from macrosurl import url -from project.portal.views import IndexView - -urlpatterns = patterns( - 'yourapp.views', - url('^:category_slug/$', 'category'), - url(':category_slug/:product_slug/', 'category_product'), - url(':category_slug/:product_slug/:variant_id', 'category_product_variant'), - url('news/', 'news'), - url('news/:year/:month/:day', 'news_date'), - url('news/:slug', 'news_entry'), - url('^order/:id$', 'order'), - url('^$', IndexView), -) -``` - -Standard Django urls example - -```python -from django.conf.urls import patterns, url -from project.portal.views import IndexView - - -urlpatterns = patterns( - 'yourapp.views', - url('^(?P[\w-]+>)/$', 'category'), - url('^(?P[\w-]+>)/(?P[\w-]+>)/$', 'category_product'), - url('^(?P[\w-]+>)/(?P[\w-]+>)/(?P\d+>)$', 'category_product_variant'), - url('^news/$', 'news'), - url('^news/(?P\d{4}>)/(?P(0?([1-9])|10|11|12)>)/(?P((0|1|2)?([1-9])|[1-3]0|31)>)$', 'news_date'), - url('^news/(?P[\w-]+>)$', 'news_entry'), - url('^order/(?P\d+>)$', 'order'), - url('^$', IndexView.as_view()), -) -``` - -I think you understand the difference of ways :) - -#### Routing must be simple! ;-) - -I think raw URL regexp patterns needed in 1% case only. I prefer simple way to write (and read, this is -important) fancy clean URLs. - -### Contributor - -[Alexandr Shurigin](https://github.com/phpdude/) - -You are welcome to contribute by PR. \ No newline at end of file diff --git a/images/arrow-down.png b/images/arrow-down.png new file mode 100644 index 0000000..5c55c6a Binary files /dev/null and b/images/arrow-down.png differ diff --git a/images/body-bg.png b/images/body-bg.png new file mode 100644 index 0000000..d0618fe Binary files /dev/null and b/images/body-bg.png differ diff --git a/images/highlight-bg.jpg b/images/highlight-bg.jpg new file mode 100644 index 0000000..4c4a78e Binary files /dev/null and b/images/highlight-bg.jpg differ diff --git a/images/hr.png b/images/hr.png new file mode 100644 index 0000000..6c723a5 Binary files /dev/null and b/images/hr.png differ diff --git a/images/octocat-icon.png b/images/octocat-icon.png new file mode 100644 index 0000000..f0ba137 Binary files /dev/null and b/images/octocat-icon.png differ diff --git a/images/octocat-small.png b/images/octocat-small.png new file mode 100644 index 0000000..57c1e44 Binary files /dev/null and b/images/octocat-small.png differ diff --git a/images/tar-gz-icon.png b/images/tar-gz-icon.png new file mode 100644 index 0000000..d50f34f Binary files /dev/null and b/images/tar-gz-icon.png differ diff --git a/images/zip-icon.png b/images/zip-icon.png new file mode 100644 index 0000000..162c425 Binary files /dev/null and b/images/zip-icon.png differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..2a0fe9c --- /dev/null +++ b/index.html @@ -0,0 +1,173 @@ + + + + + + Django-macros-url by phpdude + + + + + + + +
+
+

Django-macros-url

+

Django Macros Url. Routing must be simple as possible

+ +

View the Project on GitHub phpdude/django-macros-url

+ + + +
+
+

+Django Macros URL v0.3.0 - Routing must be simple as possible

+ +

Django Macros URL makes it easy to write (and read) URL patterns in your Django applications by using macros.

+ +

You can combine your prefixes with macro names with an underscore, for example, you can use a macro :slug +and :product_slug. They both will be compiled to same regex pattern with their group names of course. +Multiple underscores accepted too.

+ +

Build Status

+ +

+Supported macros by default

+ +
slug - [\w-]+
+year - \d{4}
+month - (0?([1-9])|10|11|12)
+day - ((0|1|2)?([1-9])|[1-3]0|31)
+id - \d+
+pk - \d+
+page - \d+
+uuid - [a-fA-F0-9]{8}-?[a-fA-F0-9]{4}-?[1345][a-fA-F0-9]{3}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{12}
+
+ +

If you want to offer more macros by default, you can fork and make a pull request.

+ +

+Installation

+ +

You can install the library with PyPI.

+ +
pip install django-macros-url
+
+ +

+Usage

+ +

Django Macros URLs used the same way as Django standard URLs. You just import this and declare your +patterns with macros.

+ +

Also, you can register new macro (or maybe you want to replace default macro with your like regex +pattern) with macrosurl.register(macro, pattern) method.

+ +

An example of registration.

+ +
import macrosurl
+
+macrosurl.register('myhash', '[a-f0-9]{9}')
+
+urlpatterns = patterns(
+    'yourapp.views',
+    macrosurl.url('^:myhash/$', 'myhash_main'),
+    macrosurl.url('^news/:news_myhash/$', 'myhash_news'),
+)
+ +

Feel free to register custom macro anywhere (i do it in main urls.py file). Macros URLs uses lazy +initialization. Macros will be compiled only on the first request.

+ +

+URL normalization

+ +

Once Macros URL completed compile regex pattern, it makes normalization of it by rules:

+ +
    +
  • Strip from left side all whitespace and ^
  • +
  • Strip from right side of pattern all whitespace and $
  • +
  • Add to left side ^
  • +
  • Add to right side $
  • +
+ +

This makes your URLs always very strong to adding any unexpected params into a path.

+ +

+Auto-calling as_view() on CBV objects.

+ +

Library check type of view and if a view is type object with defined 'as_view' function, call this. This allows +you omit ".as_view()" calls in your urls.py files. But you can call this manual with params if you need.

+ +

This feature helps you to keep your urls.py files clean as possible. I hope you like this feature!

+ +

+Examples

+ +

Macros URL example urls.py file

+ +
from django.conf.urls import patterns
+from macrosurl import url
+from project.portal.views import IndexView
+
+urlpatterns = patterns(
+    'yourapp.views',
+    url('^:category_slug/$', 'category'),
+    url(':category_slug/:product_slug/', 'category_product'),
+    url(':category_slug/:product_slug/:variant_id', 'category_product_variant'),
+    url('news/', 'news'),
+    url('news/:year/:month/:day', 'news_date'),
+    url('news/:slug', 'news_entry'),
+    url('^order/:id$', 'order'),
+    url('^$', IndexView),
+)
+ +

Standard Django urls example

+ +
from django.conf.urls import patterns, url
+from project.portal.views import IndexView
+
+
+urlpatterns = patterns(
+    'yourapp.views',
+    url('^(?P<category_slug>[\w-]+>)/$', 'category'),
+    url('^(?P<category_slug>[\w-]+>)/(?P<product_slug>[\w-]+>)/$', 'category_product'),
+    url('^(?P<category_slug>[\w-]+>)/(?P<product_slug>[\w-]+>)/(?P<variant_id>\d+>)$', 'category_product_variant'),
+    url('^news/$', 'news'),
+    url('^news/(?P<year>\d{4}>)/(?P<month>(0?([1-9])|10|11|12)>)/(?P<day>((0|1|2)?([1-9])|[1-3]0|31)>)$', 'news_date'),
+    url('^news/(?P<slug>[\w-]+>)$', 'news_entry'),
+    url('^order/(?P<id>\d+>)$', 'order'),
+    url('^$', IndexView.as_view()),
+)
+ +

I think you understand the difference of ways :)

+ +

+Routing must be simple! ;-)

+ +

I think raw URL regexp patterns needed in 1% case only. I prefer simple way to write (and read, this is +important) fancy clean URLs.

+ +

+Contributor

+ +

Alexandr Shurigin

+ +

You are welcome to contribute by PR.

+
+
+

This project is maintained by phpdude

+

Hosted on GitHub Pages — Theme by orderedlist

+
+
+ + + + diff --git a/javascripts/main.js b/javascripts/main.js new file mode 100644 index 0000000..d8135d3 --- /dev/null +++ b/javascripts/main.js @@ -0,0 +1 @@ +console.log('This would be the main JS file.'); diff --git a/javascripts/scale.fix.js b/javascripts/scale.fix.js new file mode 100644 index 0000000..87a40ca --- /dev/null +++ b/javascripts/scale.fix.js @@ -0,0 +1,17 @@ +var metas = document.getElementsByTagName('meta'); +var i; +if (navigator.userAgent.match(/iPhone/i)) { + for (i=0; i%s)' % (macro, pattern) - - -def normalize_pattern(url, end_dollar=True): - pattern = '^%s$' - if not end_dollar: - pattern = '^%s' - - return pattern % url.lstrip("^ \n").rstrip("$ \n") - - -class MacroUrlPattern(object): - def __init__(self, pattern, end_dollar=True): - self.pattern = pattern - self.end_dollar = end_dollar - - def compile(self): - pattern = self.pattern - macros = re.findall('(:([a-z_\d]+))', pattern) - for match, macro in macros: - if macro in _macros_library: - pattern = pattern.replace(match, regex_group(macro, _macros_library[macro])) - else: - for _macro in _macros_library: - if macro.endswith("_%s" % _macro): - pattern = pattern.replace(match, regex_group(macro, _macros_library[_macro])) - continue - - return normalize_pattern(pattern, self.end_dollar) - - @property - def compiled(self): - if not hasattr(self, '_compiled'): - setattr(self, '_compiled', self.compile()) - - return getattr(self, '_compiled') - - def __str__(self): - return self.compiled - - def __unicode__(self): - return self.__str__() - - -def url(regex, view, kwargs=None, name=None, prefix=''): - from django.conf.urls import url as baseurl - from django import get_version - - # Handle include()'s in views. - end_dollar = True - if isinstance(view, tuple) and len(view) == 3: - end_dollar = False - - # Auto-calling as_view on CBVs objects. Now you can omit as_view() in your views by default. - if isinstance(view, type): - if hasattr(view, 'as_view') and hasattr(view.as_view, '__call__'): - view = view.as_view() - - if prefix: - warnings.warn( - 'Support for prefix in macrosurl.url() is deprecated and ' - 'will be removed in version 0.4 (support for prefix was removed in Django 1.10). ' - 'Please update your source code.' - 'In old Django versions prefix was used like "if prefix:view = prefix + \'.\' + view".' - ) - - view = prefix + '.' + view - - if get_version() >= StrictVersion('1.10') and not callable(view) and not isinstance(view, (list, tuple)): - warnings.warn( - 'View "%s" must be a callable in case of Django 1.10. ' - 'Macrosurl will try to load the view automatically (this behavior will be removed in version 0.4), but ' - 'please update your source code.' % view - ) - - from django.utils.module_loading import import_string - - view = import_string(view) - - return baseurl(MacroUrlPattern(regex, end_dollar=end_dollar), view, kwargs=kwargs, name=name) diff --git a/params.json b/params.json new file mode 100644 index 0000000..9f35b80 --- /dev/null +++ b/params.json @@ -0,0 +1,7 @@ +{ + "name": "Django-macros-url", + "tagline": "Django Macros Url. Routing must be simple as possible", + "body": "# [Django Macros URL](https://github.com/phpdude/django-macros-url/) v0.3.0 - Routing must be simple as possible\r\n\r\nDjango Macros URL makes it easy to write (and read) URL patterns in your Django applications by using macros.\r\n\r\nYou can combine your prefixes with macro names with an underscore, for example, you can use a macro `:slug` \r\nand `:product_slug`. They both will be compiled to same regex pattern with their group names of course. \r\nMultiple underscores accepted too.\r\n\r\n[![Build Status](https://travis-ci.org/phpdude/django-macros-url.svg?branch=master)](https://travis-ci.org/phpdude/django-macros-url)\r\n\r\n### Supported macros by default\r\n\r\n```\r\nslug - [\\w-]+\r\nyear - \\d{4}\r\nmonth - (0?([1-9])|10|11|12)\r\nday - ((0|1|2)?([1-9])|[1-3]0|31)\r\nid - \\d+\r\npk - \\d+\r\npage - \\d+\r\nuuid - [a-fA-F0-9]{8}-?[a-fA-F0-9]{4}-?[1345][a-fA-F0-9]{3}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{12}\r\n```\r\n\r\nIf you want to offer more macros by default, you can fork and make a pull request.\r\n\r\n### Installation\r\n\r\nYou can install the library with PyPI.\r\n\r\n```\r\npip install django-macros-url\r\n```\r\n\r\n### Usage\r\n\r\nDjango Macros URLs used the same way as Django standard URLs. You just import this and declare your \r\npatterns with macros.\r\n\r\nAlso, you can register new macro (or maybe you want to replace default macro with your like regex\r\npattern) with `macrosurl.register(macro, pattern)` method.\r\n\r\nAn example of registration.\r\n\r\n```python\r\nimport macrosurl\r\n\r\nmacrosurl.register('myhash', '[a-f0-9]{9}')\r\n\r\nurlpatterns = patterns(\r\n 'yourapp.views',\r\n macrosurl.url('^:myhash/$', 'myhash_main'),\r\n macrosurl.url('^news/:news_myhash/$', 'myhash_news'),\r\n)\r\n```\r\n\r\nFeel free to register custom macro anywhere (i do it in main urls.py file). Macros URLs uses lazy \r\ninitialization. Macros will be compiled only on the first request.\r\n\r\n### URL normalization\r\n\r\nOnce Macros URL completed compile regex pattern, it makes normalization of it by rules:\r\n\r\n- Strip from left side all whitespace and ^\r\n- Strip from right side of pattern all whitespace and $\r\n- Add to left side ^\r\n- Add to right side $\r\n\r\nThis makes your URLs always very strong to adding any unexpected params into a path.\r\n\r\n### Auto-calling as_view() on CBV objects.\r\n\r\nLibrary check type of view and if a view is type object with defined 'as_view' function, call this. This allows \r\nyou omit \".as_view()\" calls in your urls.py files. But you can call this manual with params if you need.\r\n\r\nThis feature helps you to keep your urls.py files clean as possible. I hope you like this feature!\r\n\r\n### Examples\r\n\r\nMacros URL example urls.py file\r\n\r\n```python\r\nfrom django.conf.urls import patterns\r\nfrom macrosurl import url\r\nfrom project.portal.views import IndexView\r\n\r\nurlpatterns = patterns(\r\n 'yourapp.views',\r\n url('^:category_slug/$', 'category'),\r\n url(':category_slug/:product_slug/', 'category_product'),\r\n url(':category_slug/:product_slug/:variant_id', 'category_product_variant'),\r\n url('news/', 'news'),\r\n url('news/:year/:month/:day', 'news_date'),\r\n url('news/:slug', 'news_entry'),\r\n url('^order/:id$', 'order'),\r\n url('^$', IndexView),\r\n)\r\n```\r\n\r\nStandard Django urls example\r\n\r\n```python\r\nfrom django.conf.urls import patterns, url\r\nfrom project.portal.views import IndexView\r\n\r\n\r\nurlpatterns = patterns(\r\n 'yourapp.views',\r\n url('^(?P[\\w-]+>)/$', 'category'),\r\n url('^(?P[\\w-]+>)/(?P[\\w-]+>)/$', 'category_product'),\r\n url('^(?P[\\w-]+>)/(?P[\\w-]+>)/(?P\\d+>)$', 'category_product_variant'),\r\n url('^news/$', 'news'),\r\n url('^news/(?P\\d{4}>)/(?P(0?([1-9])|10|11|12)>)/(?P((0|1|2)?([1-9])|[1-3]0|31)>)$', 'news_date'),\r\n url('^news/(?P[\\w-]+>)$', 'news_entry'),\r\n url('^order/(?P\\d+>)$', 'order'),\r\n url('^$', IndexView.as_view()),\r\n)\r\n```\r\n\r\nI think you understand the difference of ways :)\r\n\r\n#### Routing must be simple! ;-)\r\n\r\nI think raw URL regexp patterns needed in 1% case only. I prefer simple way to write (and read, this is \r\nimportant) fancy clean URLs.\r\n\r\n### Contributor\r\n\r\n[Alexandr Shurigin](https://github.com/phpdude/)\r\n\r\nYou are welcome to contribute by PR.", + "google": "", + "note": "Don't delete this file! It's used internally to help with page regeneration." +} \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100755 index 2da2c79..0000000 --- a/setup.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env python -import os - -from setuptools import setup, find_packages - - -def read(filename): - return open(os.path.join(os.path.dirname(__file__), filename)).read() - - -setup( - name='django-macros-url', - version=__import__('macrosurl').get_version(), - author='Alexandr Shurigin', - author_email='alexandr.shurigin@gmail.com', - description='Macros Url library for django', - license='MIT', - keywords='django macros url pattern regex', - url='https://github.com/phpdude/django-macros-url', - packages=find_packages(exclude=['tests']), - include_package_data=True, - test_suite='tests', - long_description=read("README.markdown"), - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Console', - 'Environment :: Plugins', - 'Framework :: Django', - 'Intended Audience :: Developers', - 'Intended Audience :: System Administrators', - 'Intended Audience :: Information Technology', - 'License :: OSI Approved :: MIT License', - 'Natural Language :: English', - 'Operating System :: OS Independent', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 3', - 'Topic :: Internet :: WWW/HTTP', - 'Topic :: Internet :: WWW/HTTP :: WSGI', - 'Topic :: Software Development :: Libraries', - 'Topic :: Software Development :: Libraries :: Python Modules', - 'Topic :: Software Development :: Pre-processors' - ], - install_requires=['django'] -) diff --git a/stylesheets/github-light.css b/stylesheets/github-light.css new file mode 100644 index 0000000..0c6b24d --- /dev/null +++ b/stylesheets/github-light.css @@ -0,0 +1,124 @@ +/* +The MIT License (MIT) + +Copyright (c) 2016 GitHub, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +*/ + +.pl-c /* comment */ { + color: #969896; +} + +.pl-c1 /* constant, variable.other.constant, support, meta.property-name, support.constant, support.variable, meta.module-reference, markup.raw, meta.diff.header */, +.pl-s .pl-v /* string variable */ { + color: #0086b3; +} + +.pl-e /* entity */, +.pl-en /* entity.name */ { + color: #795da3; +} + +.pl-smi /* variable.parameter.function, storage.modifier.package, storage.modifier.import, storage.type.java, variable.other */, +.pl-s .pl-s1 /* string source */ { + color: #333; +} + +.pl-ent /* entity.name.tag */ { + color: #63a35c; +} + +.pl-k /* keyword, storage, storage.type */ { + color: #a71d5d; +} + +.pl-s /* string */, +.pl-pds /* punctuation.definition.string, string.regexp.character-class */, +.pl-s .pl-pse .pl-s1 /* string punctuation.section.embedded source */, +.pl-sr /* string.regexp */, +.pl-sr .pl-cce /* string.regexp constant.character.escape */, +.pl-sr .pl-sre /* string.regexp source.ruby.embedded */, +.pl-sr .pl-sra /* string.regexp string.regexp.arbitrary-repitition */ { + color: #183691; +} + +.pl-v /* variable */ { + color: #ed6a43; +} + +.pl-id /* invalid.deprecated */ { + color: #b52a1d; +} + +.pl-ii /* invalid.illegal */ { + color: #f8f8f8; + background-color: #b52a1d; +} + +.pl-sr .pl-cce /* string.regexp constant.character.escape */ { + font-weight: bold; + color: #63a35c; +} + +.pl-ml /* markup.list */ { + color: #693a17; +} + +.pl-mh /* markup.heading */, +.pl-mh .pl-en /* markup.heading entity.name */, +.pl-ms /* meta.separator */ { + font-weight: bold; + color: #1d3e81; +} + +.pl-mq /* markup.quote */ { + color: #008080; +} + +.pl-mi /* markup.italic */ { + font-style: italic; + color: #333; +} + +.pl-mb /* markup.bold */ { + font-weight: bold; + color: #333; +} + +.pl-md /* markup.deleted, meta.diff.header.from-file */ { + color: #bd2c00; + background-color: #ffecec; +} + +.pl-mi1 /* markup.inserted, meta.diff.header.to-file */ { + color: #55a532; + background-color: #eaffea; +} + +.pl-mdr /* meta.diff.range */ { + font-weight: bold; + color: #795da3; +} + +.pl-mo /* meta.output */ { + color: #1d3e81; +} + diff --git a/stylesheets/print.css b/stylesheets/print.css new file mode 100644 index 0000000..541695b --- /dev/null +++ b/stylesheets/print.css @@ -0,0 +1,226 @@ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +body { + font-size: 13px; + line-height: 1.5; + font-family: 'Helvetica Neue', Helvetica, Arial, serif; + color: #000; +} + +a { + color: #d5000d; + font-weight: bold; +} + +header { + padding-top: 35px; + padding-bottom: 10px; +} + +header h1 { + font-weight: bold; + letter-spacing: -1px; + font-size: 48px; + color: #303030; + line-height: 1.2; +} + +header h2 { + letter-spacing: -1px; + font-size: 24px; + color: #aaa; + font-weight: normal; + line-height: 1.3; +} +#downloads { + display: none; +} +#main_content { + padding-top: 20px; +} + +code, pre { + font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal; + color: #222; + margin-bottom: 30px; + font-size: 12px; +} + +code { + padding: 0 3px; +} + +pre { + border: solid 1px #ddd; + padding: 20px; + overflow: auto; +} +pre code { + padding: 0; +} + +ul, ol, dl { + margin-bottom: 20px; +} + + +/* COMMON STYLES */ + +table { + width: 100%; + border: 1px solid #ebebeb; +} + +th { + font-weight: 500; +} + +td { + border: 1px solid #ebebeb; + text-align: center; + font-weight: 300; +} + +form { + background: #f2f2f2; + padding: 20px; + +} + + +/* GENERAL ELEMENT TYPE STYLES */ + +h1 { + font-size: 2.8em; +} + +h2 { + font-size: 22px; + font-weight: bold; + color: #303030; + margin-bottom: 8px; +} + +h3 { + color: #d5000d; + font-size: 18px; + font-weight: bold; + margin-bottom: 8px; +} + +h4 { + font-size: 16px; + color: #303030; + font-weight: bold; +} + +h5 { + font-size: 1em; + color: #303030; +} + +h6 { + font-size: .8em; + color: #303030; +} + +p { + font-weight: 300; + margin-bottom: 20px; +} + +a { + text-decoration: none; +} + +p a { + font-weight: 400; +} + +blockquote { + font-size: 1.6em; + border-left: 10px solid #e9e9e9; + margin-bottom: 20px; + padding: 0 0 0 30px; +} + +ul li { + list-style: disc inside; + padding-left: 20px; +} + +ol li { + list-style: decimal inside; + padding-left: 3px; +} + +dl dd { + font-style: italic; + font-weight: 100; +} + +footer { + margin-top: 40px; + padding-top: 20px; + padding-bottom: 30px; + font-size: 13px; + color: #aaa; +} + +footer a { + color: #666; +} + +/* MISC */ +.clearfix:after { + clear: both; + content: '.'; + display: block; + visibility: hidden; + height: 0; +} + +.clearfix {display: inline-block;} +* html .clearfix {height: 1%;} +.clearfix {display: block;} \ No newline at end of file diff --git a/stylesheets/pygment_trac.css b/stylesheets/pygment_trac.css new file mode 100644 index 0000000..c6a6452 --- /dev/null +++ b/stylesheets/pygment_trac.css @@ -0,0 +1,69 @@ +.highlight { background: #ffffff; } +.highlight .c { color: #999988; font-style: italic } /* Comment */ +.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ +.highlight .k { font-weight: bold } /* Keyword */ +.highlight .o { font-weight: bold } /* Operator */ +.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */ +.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */ +.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ +.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .gr { color: #aa0000 } /* Generic.Error */ +.highlight .gh { color: #999999 } /* Generic.Heading */ +.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ +.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */ +.highlight .go { color: #888888 } /* Generic.Output */ +.highlight .gp { color: #555555 } /* Generic.Prompt */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold; } /* Generic.Subheading */ +.highlight .gt { color: #aa0000 } /* Generic.Traceback */ +.highlight .kc { font-weight: bold } /* Keyword.Constant */ +.highlight .kd { font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { font-weight: bold } /* Keyword.Pseudo */ +.highlight .kr { font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */ +.highlight .m { color: #009999 } /* Literal.Number */ +.highlight .s { color: #d14 } /* Literal.String */ +.highlight .na { color: #008080 } /* Name.Attribute */ +.highlight .nb { color: #0086B3 } /* Name.Builtin */ +.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */ +.highlight .no { color: #008080 } /* Name.Constant */ +.highlight .ni { color: #800080 } /* Name.Entity */ +.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */ +.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */ +.highlight .nn { color: #555555 } /* Name.Namespace */ +.highlight .nt { color: #000080 } /* Name.Tag */ +.highlight .nv { color: #008080 } /* Name.Variable */ +.highlight .ow { font-weight: bold } /* Operator.Word */ +.highlight .w { color: #bbbbbb } /* Text.Whitespace */ +.highlight .mf { color: #009999 } /* Literal.Number.Float */ +.highlight .mh { color: #009999 } /* Literal.Number.Hex */ +.highlight .mi { color: #009999 } /* Literal.Number.Integer */ +.highlight .mo { color: #009999 } /* Literal.Number.Oct */ +.highlight .sb { color: #d14 } /* Literal.String.Backtick */ +.highlight .sc { color: #d14 } /* Literal.String.Char */ +.highlight .sd { color: #d14 } /* Literal.String.Doc */ +.highlight .s2 { color: #d14 } /* Literal.String.Double */ +.highlight .se { color: #d14 } /* Literal.String.Escape */ +.highlight .sh { color: #d14 } /* Literal.String.Heredoc */ +.highlight .si { color: #d14 } /* Literal.String.Interpol */ +.highlight .sx { color: #d14 } /* Literal.String.Other */ +.highlight .sr { color: #009926 } /* Literal.String.Regex */ +.highlight .s1 { color: #d14 } /* Literal.String.Single */ +.highlight .ss { color: #990073 } /* Literal.String.Symbol */ +.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */ +.highlight .vc { color: #008080 } /* Name.Variable.Class */ +.highlight .vg { color: #008080 } /* Name.Variable.Global */ +.highlight .vi { color: #008080 } /* Name.Variable.Instance */ +.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */ + +.type-csharp .highlight .k { color: #0000FF } +.type-csharp .highlight .kt { color: #0000FF } +.type-csharp .highlight .nf { color: #000000; font-weight: normal } +.type-csharp .highlight .nc { color: #2B91AF } +.type-csharp .highlight .nn { color: #000000 } +.type-csharp .highlight .s { color: #A31515 } +.type-csharp .highlight .sc { color: #A31515 } diff --git a/stylesheets/styles.css b/stylesheets/styles.css new file mode 100644 index 0000000..2e1768e --- /dev/null +++ b/stylesheets/styles.css @@ -0,0 +1,324 @@ +@font-face { + font-family: 'Noto Sans'; + font-weight: 400; + font-style: normal; + src: url('../fonts/Noto-Sans-regular/Noto-Sans-regular.eot'); + src: url('../fonts/Noto-Sans-regular/Noto-Sans-regular.eot?#iefix') format('embedded-opentype'), + local('Noto Sans'), + local('Noto-Sans-regular'), + url('../fonts/Noto-Sans-regular/Noto-Sans-regular.woff2') format('woff2'), + url('../fonts/Noto-Sans-regular/Noto-Sans-regular.woff') format('woff'), + url('../fonts/Noto-Sans-regular/Noto-Sans-regular.ttf') format('truetype'), + url('../fonts/Noto-Sans-regular/Noto-Sans-regular.svg#NotoSans') format('svg'); +} + +@font-face { + font-family: 'Noto Sans'; + font-weight: 700; + font-style: normal; + src: url('../fonts/Noto-Sans-700/Noto-Sans-700.eot'); + src: url('../fonts/Noto-Sans-700/Noto-Sans-700.eot?#iefix') format('embedded-opentype'), + local('Noto Sans Bold'), + local('Noto-Sans-700'), + url('../fonts/Noto-Sans-700/Noto-Sans-700.woff2') format('woff2'), + url('../fonts/Noto-Sans-700/Noto-Sans-700.woff') format('woff'), + url('../fonts/Noto-Sans-700/Noto-Sans-700.ttf') format('truetype'), + url('../fonts/Noto-Sans-700/Noto-Sans-700.svg#NotoSans') format('svg'); +} + +@font-face { + font-family: 'Noto Sans'; + font-weight: 400; + font-style: italic; + src: url('../fonts/Noto-Sans-italic/Noto-Sans-italic.eot'); + src: url('../fonts/Noto-Sans-italic/Noto-Sans-italic.eot?#iefix') format('embedded-opentype'), + local('Noto Sans Italic'), + local('Noto-Sans-italic'), + url('../fonts/Noto-Sans-italic/Noto-Sans-italic.woff2') format('woff2'), + url('../fonts/Noto-Sans-italic/Noto-Sans-italic.woff') format('woff'), + url('../fonts/Noto-Sans-italic/Noto-Sans-italic.ttf') format('truetype'), + url('../fonts/Noto-Sans-italic/Noto-Sans-italic.svg#NotoSans') format('svg'); +} + +@font-face { + font-family: 'Noto Sans'; + font-weight: 700; + font-style: italic; + src: url('../fonts/Noto-Sans-700italic/Noto-Sans-700italic.eot'); + src: url('../fonts/Noto-Sans-700italic/Noto-Sans-700italic.eot?#iefix') format('embedded-opentype'), + local('Noto Sans Bold Italic'), + local('Noto-Sans-700italic'), + url('../fonts/Noto-Sans-700italic/Noto-Sans-700italic.woff2') format('woff2'), + url('../fonts/Noto-Sans-700italic/Noto-Sans-700italic.woff') format('woff'), + url('../fonts/Noto-Sans-700italic/Noto-Sans-700italic.ttf') format('truetype'), + url('../fonts/Noto-Sans-700italic/Noto-Sans-700italic.svg#NotoSans') format('svg'); +} + +body { + background-color: #fff; + padding:50px; + font: 14px/1.5 "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; + color:#727272; + font-weight:400; +} + +h1, h2, h3, h4, h5, h6 { + color:#222; + margin:0 0 20px; +} + +p, ul, ol, table, pre, dl { + margin:0 0 20px; +} + +h1, h2, h3 { + line-height:1.1; +} + +h1 { + font-size:28px; +} + +h2 { + color:#393939; +} + +h3, h4, h5, h6 { + color:#494949; +} + +a { + color:#39c; + text-decoration:none; +} + +a:hover { + color:#069; +} + +a small { + font-size:11px; + color:#777; + margin-top:-0.3em; + display:block; +} + +a:hover small { + color:#777; +} + +.wrapper { + width:860px; + margin:0 auto; +} + +blockquote { + border-left:1px solid #e5e5e5; + margin:0; + padding:0 0 0 20px; + font-style:italic; +} + +code, pre { + font-family:Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal, Consolas, Liberation Mono, DejaVu Sans Mono, Courier New, monospace; + color:#333; + font-size:12px; +} + +pre { + padding:8px 15px; + background: #f8f8f8; + border-radius:5px; + border:1px solid #e5e5e5; + overflow-x: auto; +} + +table { + width:100%; + border-collapse:collapse; +} + +th, td { + text-align:left; + padding:5px 10px; + border-bottom:1px solid #e5e5e5; +} + +dt { + color:#444; + font-weight:700; +} + +th { + color:#444; +} + +img { + max-width:100%; +} + +header { + width:270px; + float:left; + position:fixed; + -webkit-font-smoothing:subpixel-antialiased; +} + +header ul { + list-style:none; + height:40px; + padding:0; + background: #f4f4f4; + border-radius:5px; + border:1px solid #e0e0e0; + width:270px; +} + +header li { + width:89px; + float:left; + border-right:1px solid #e0e0e0; + height:40px; +} + +header li:first-child a { + border-radius:5px 0 0 5px; +} + +header li:last-child a { + border-radius:0 5px 5px 0; +} + +header ul a { + line-height:1; + font-size:11px; + color:#999; + display:block; + text-align:center; + padding-top:6px; + height:34px; +} + +header ul a:hover { + color:#999; +} + +header ul a:active { + background-color:#f0f0f0; +} + +strong { + color:#222; + font-weight:700; +} + +header ul li + li + li { + border-right:none; + width:89px; +} + +header ul a strong { + font-size:14px; + display:block; + color:#222; +} + +section { + width:500px; + float:right; + padding-bottom:50px; +} + +small { + font-size:11px; +} + +hr { + border:0; + background:#e5e5e5; + height:1px; + margin:0 0 20px; +} + +footer { + width:270px; + float:left; + position:fixed; + bottom:50px; + -webkit-font-smoothing:subpixel-antialiased; +} + +@media print, screen and (max-width: 960px) { + + div.wrapper { + width:auto; + margin:0; + } + + header, section, footer { + float:none; + position:static; + width:auto; + } + + header { + padding-right:320px; + } + + section { + border:1px solid #e5e5e5; + border-width:1px 0; + padding:20px 0; + margin:0 0 20px; + } + + header a small { + display:inline; + } + + header ul { + position:absolute; + right:50px; + top:52px; + } +} + +@media print, screen and (max-width: 720px) { + body { + word-wrap:break-word; + } + + header { + padding:0; + } + + header ul, header p.view { + position:static; + } + + pre, code { + word-wrap:normal; + } +} + +@media print, screen and (max-width: 480px) { + body { + padding:15px; + } + + header ul { + width:99%; + } + + header li, header ul li + li + li { + width:33%; + } +} + +@media print { + body { + padding:0.4in; + font-size:12pt; + color:#444; + } +} diff --git a/stylesheets/stylesheet.css b/stylesheets/stylesheet.css new file mode 100644 index 0000000..020ad6d --- /dev/null +++ b/stylesheets/stylesheet.css @@ -0,0 +1,371 @@ +/* http://meyerweb.com/eric/tools/css/reset/ + v2.0 | 20110126 + License: none (public domain) +*/ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} + +/* LAYOUT STYLES */ +body { + font-size: 1em; + line-height: 1.5; + background: #e7e7e7 url(../images/body-bg.png) 0 0 repeat; + font-family: 'Helvetica Neue', Helvetica, Arial, serif; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); + color: #6d6d6d; +} + +a { + color: #d5000d; +} +a:hover { + color: #c5000c; +} + +header { + padding-top: 35px; + padding-bottom: 25px; +} + +header h1 { + font-family: 'Chivo', 'Helvetica Neue', Helvetica, Arial, serif; font-weight: 900; + letter-spacing: -1px; + font-size: 48px; + color: #303030; + line-height: 1.2; +} + +header h2 { + letter-spacing: -1px; + font-size: 24px; + color: #aaa; + font-weight: normal; + line-height: 1.3; +} + +#container { + background: transparent url(../images/highlight-bg.jpg) 50% 0 no-repeat; + min-height: 595px; +} + +.inner { + width: 620px; + margin: 0 auto; +} + +#container .inner img { + max-width: 100%; +} + +#downloads { + margin-bottom: 40px; +} + +a.button { + -moz-border-radius: 30px; + -webkit-border-radius: 30px; + border-radius: 30px; + border-top: solid 1px #cbcbcb; + border-left: solid 1px #b7b7b7; + border-right: solid 1px #b7b7b7; + border-bottom: solid 1px #b3b3b3; + color: #303030; + line-height: 25px; + font-weight: bold; + font-size: 15px; + padding: 12px 8px 12px 8px; + display: block; + float: left; + width: 179px; + margin-right: 14px; + background: #fdfdfd; /* Old browsers */ + background: -moz-linear-gradient(top, #fdfdfd 0%, #f2f2f2 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fdfdfd), color-stop(100%,#f2f2f2)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #fdfdfd 0%,#f2f2f2 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #fdfdfd 0%,#f2f2f2 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, #fdfdfd 0%,#f2f2f2 100%); /* IE10+ */ + background: linear-gradient(top, #fdfdfd 0%,#f2f2f2 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fdfdfd', endColorstr='#f2f2f2',GradientType=0 ); /* IE6-9 */ + -webkit-box-shadow: 10px 10px 5px #888; + -moz-box-shadow: 10px 10px 5px #888; + box-shadow: 0px 1px 5px #e8e8e8; +} +a.button:hover { + border-top: solid 1px #b7b7b7; + border-left: solid 1px #b3b3b3; + border-right: solid 1px #b3b3b3; + border-bottom: solid 1px #b3b3b3; + background: #fafafa; /* Old browsers */ + background: -moz-linear-gradient(top, #fdfdfd 0%, #f6f6f6 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fdfdfd), color-stop(100%,#f6f6f6)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #fdfdfd 0%,#f6f6f6 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #fdfdfd 0%,#f6f6f6 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, #fdfdfd 0%,#f6f6f6 100%); /* IE10+ */ + background: linear-gradient(top, #fdfdfd 0%,#f6f6f6, 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fdfdfd', endColorstr='#f6f6f6',GradientType=0 ); /* IE6-9 */ +} + +a.button span { + padding-left: 50px; + display: block; + height: 23px; +} + +#download-zip span { + background: transparent url(../images/zip-icon.png) 12px 50% no-repeat; +} +#download-tar-gz span { + background: transparent url(../images/tar-gz-icon.png) 12px 50% no-repeat; +} +#view-on-github span { + background: transparent url(../images/octocat-icon.png) 12px 50% no-repeat; +} +#view-on-github { + margin-right: 0; +} + +code, pre { + font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal; + color: #222; + margin-bottom: 30px; + font-size: 14px; +} + +code { + background-color: #f2f2f2; + border: solid 1px #ddd; + padding: 0 3px; +} + +pre { + padding: 20px; + background: #303030; + color: #f2f2f2; + text-shadow: none; + overflow: auto; +} +pre code { + color: #f2f2f2; + background-color: #303030; + border: none; + padding: 0; +} + +ul, ol, dl { + margin-bottom: 20px; +} + + +/* COMMON STYLES */ + +hr { + height: 1px; + line-height: 1px; + margin-top: 1em; + padding-bottom: 1em; + border: none; + background: transparent url('../images/hr.png') 50% 0 no-repeat; +} + +strong { + font-weight: bold; +} + +em { + font-style: italic; +} + +table { + width: 100%; + border: 1px solid #ebebeb; +} + +th { + font-weight: 500; +} + +td { + border: 1px solid #ebebeb; + text-align: center; + font-weight: 300; +} + +form { + background: #f2f2f2; + padding: 20px; + +} + + +/* GENERAL ELEMENT TYPE STYLES */ + +h1 { + font-size: 32px; +} + +h2 { + font-size: 22px; + font-weight: bold; + color: #303030; + margin-bottom: 8px; +} + +h3 { + color: #d5000d; + font-size: 18px; + font-weight: bold; + margin-bottom: 8px; +} + +h4 { + font-size: 16px; + color: #303030; + font-weight: bold; +} + +h5 { + font-size: 1em; + color: #303030; +} + +h6 { + font-size: .8em; + color: #303030; +} + +p { + font-weight: 300; + margin-bottom: 20px; +} + +a { + text-decoration: none; +} + +p a { + font-weight: 400; +} + +blockquote { + font-size: 1.6em; + border-left: 10px solid #e9e9e9; + margin-bottom: 20px; + padding: 0 0 0 30px; +} + +ul li { + list-style: disc inside; + padding-left: 20px; +} + +ol li { + list-style: decimal inside; + padding-left: 3px; +} + +dl dt { + color: #303030; +} + +footer { + background: transparent url('../images/hr.png') 0 0 no-repeat; + margin-top: 40px; + padding-top: 20px; + padding-bottom: 30px; + font-size: 13px; + color: #aaa; +} + +footer a { + color: #666; +} +footer a:hover { + color: #444; +} + +/* MISC */ +.clearfix:after { + clear: both; + content: '.'; + display: block; + visibility: hidden; + height: 0; +} + +.clearfix {display: inline-block;} +* html .clearfix {height: 1%;} +.clearfix {display: block;} + +/* #Media Queries +================================================== */ + +/* Smaller than standard 960 (devices and browsers) */ +@media only screen and (max-width: 959px) {} + +/* Tablet Portrait size to standard 960 (devices and browsers) */ +@media only screen and (min-width: 768px) and (max-width: 959px) {} + +/* All Mobile Sizes (devices and browser) */ +@media only screen and (max-width: 767px) { + header { + padding-top: 10px; + padding-bottom: 10px; + } + #downloads { + margin-bottom: 25px; + } + #download-zip, #download-tar-gz { + display: none; + } + .inner { + width: 94%; + margin: 0 auto; + } +} + +/* Mobile Landscape Size to Tablet Portrait (devices and browsers) */ +@media only screen and (min-width: 480px) and (max-width: 767px) {} + +/* Mobile Portrait Size to Mobile Landscape Size (devices and browsers) */ +@media only screen and (max-width: 479px) {} diff --git a/tests/__init__.py b/tests/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tests/settings.py b/tests/settings.py deleted file mode 100644 index 75b9dbb..0000000 --- a/tests/settings.py +++ /dev/null @@ -1,3 +0,0 @@ -DEBUG = True -SECRET_KEY = '123' -USE_I18N=False \ No newline at end of file diff --git a/tests/urls.py b/tests/urls.py deleted file mode 100644 index 8af933b..0000000 --- a/tests/urls.py +++ /dev/null @@ -1,181 +0,0 @@ -import os -import warnings - -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.settings") - -import sys -import uuid - -from django.conf.urls import include - -from macrosurl import MacroUrlPattern, url - -if sys.version_info >= (2, 7): - import unittest -else: - from django.utils import unittest - - -class TestRegexCompilation(unittest.TestCase): - def setUp(self): - warnings.filterwarnings("ignore") - - def test_nomacro(self): - self.assertEqual(MacroUrlPattern('^$').compiled, '^$') - self.assertEqual(MacroUrlPattern('^news/all/$').compiled, '^news/all/$') - self.assertEqual(MacroUrlPattern('^news/all/$').compiled, '^news/all/$') - self.assertEqual(MacroUrlPattern('^news/all/$').compiled, '^news/all/$') - self.assertEqual(MacroUrlPattern('^news/:news/$').compiled, '^news/:news/$') - - def test_normalize_url(self): - self.assertEqual(MacroUrlPattern('').compiled, '^$') - self.assertEqual(MacroUrlPattern('news/all/').compiled, '^news/all/$') - self.assertEqual(MacroUrlPattern('^news/all/$').compiled, '^news/all/$') - self.assertEqual(MacroUrlPattern('^news/all/').compiled, '^news/all/$') - - def test_strip_whitespace(self): - self.assertEqual(MacroUrlPattern('').compiled, '^$') - self.assertEqual(MacroUrlPattern(' news/all/').compiled, '^news/all/$') - self.assertEqual(MacroUrlPattern('^news/all/$ ').compiled, '^news/all/$') - self.assertEqual(MacroUrlPattern(' ^news/all/ ').compiled, '^news/all/$') - self.assertEqual(MacroUrlPattern(' ^news/all/ \n').compiled, '^news/all/$') - - def test_id(self): - self.assertEqual(MacroUrlPattern('page/:id').compiled, '^page/(?P\d+)$') - self.assertEqual(MacroUrlPattern('product/:product_id').compiled, '^product/(?P\d+)$') - self.assertEqual(MacroUrlPattern('product/:id/:product_id').compiled, - '^product/(?P\d+)/(?P\d+)$') - self.assertEqual(MacroUrlPattern('product/:id/:product_id/:news_id').compiled, - '^product/(?P\d+)/(?P\d+)/(?P\d+)$') - - def test_pk(self): - self.assertEqual(MacroUrlPattern('page/:pk').compiled, '^page/(?P\d+)$') - self.assertEqual(MacroUrlPattern('product/:product_pk').compiled, '^product/(?P\d+)$') - self.assertEqual(MacroUrlPattern('product/:pk/:product_pk').compiled, - '^product/(?P\d+)/(?P\d+)$') - self.assertEqual(MacroUrlPattern('product/:pk/:product_pk/:news_pk').compiled, - '^product/(?P\d+)/(?P\d+)/(?P\d+)$') - - def test_page(self): - self.assertEqual(MacroUrlPattern('page/:page').compiled, '^page/(?P\d+)$') - self.assertEqual(MacroUrlPattern('product/:product_page').compiled, '^product/(?P\d+)$') - self.assertEqual(MacroUrlPattern('product/:page/:product_page').compiled, - '^product/(?P\d+)/(?P\d+)$') - self.assertEqual(MacroUrlPattern('product/:page/:product_page/:news_page').compiled, - '^product/(?P\d+)/(?P\d+)/(?P\d+)$') - - def test_slug(self): - self.assertEqual(MacroUrlPattern('page/:slug').compiled, '^page/(?P[\w-]+)$') - self.assertEqual(MacroUrlPattern('page/:category_slug/:slug').compiled, - '^page/(?P[\w-]+)/(?P[\w-]+)$') - - def test_year(self): - self.assertEqual(MacroUrlPattern('news/:year').compiled, '^news/(?P\d{4})$') - - def test_year_month(self): - self.assertEqual(MacroUrlPattern('news/:year/:month').compiled, - '^news/(?P\d{4})/(?P(0?([1-9])|10|11|12))$') - - def test_year_month_day(self): - self.assertEqual(MacroUrlPattern('news/:year/:month/:day/').compiled, - '^news/(?P\d{4})/(?P(0?([1-9])|10|11|12))/(?P((0|1|2)?([1-9])|[1-3]0|31))/$') - - def test_date(self): - self.assertEqual(MacroUrlPattern('news/:date/').compiled, - '^news/(?P\d{4}-(0?([1-9])|10|11|12)-((0|1|2)?([1-9])|[1-3]0|31))/$') - - def test_uid(self): - self.assertEqual(MacroUrlPattern('invoice/:uuid').compiled, - '^invoice/(?P[a-fA-F0-9]{8}-?[a-fA-F0-9]{4}-?[1345][a-fA-F0-9]{3}-?[a-fA-F0-9]{4}-?[' - 'a-fA-F0-9]{12})$') - - def test_strongurl(self): - self.assertEqual(MacroUrlPattern('orders/:date/:uuid/products/:slug/:variant_id').compiled, - '^orders/(?P\\d{4}-(0?([1-9])|10|11|12)-((0|1|2)?([1-9])|[1-3]0|31))/(?P[' - 'a-fA-F0-9]{8}-?[a-fA-F0-9]{4}-?[1345][a-fA-F0-9]{3}-?[a-fA-F0-9]{4}-?[a-fA-F0-9]{' - '12})/products/(?P[\\w-]+)/(?P\\d+)$') - - # noinspection PyProtectedMember - def test_includes_end(self): - self.assertEqual(str(url('users/:slug', include('tests'))._regex), '^users/(?P[\\w-]+)') - self.assertEqual(str(url('users/:slug', include('tests', namespace='1'))._regex), '^users/(?P[\\w-]+)') - self.assertEqual(str(url('users/:slug', 'tests.views.view')._regex), '^users/(?P[\\w-]+)$') - - -class TestRegexUrlResolving(unittest.TestCase): - def setUp(self): - self.view = 'tests.views.view' - - warnings.filterwarnings("ignore") - - def test_id(self): - self.assertIsNone(url('product/:id', self.view).resolve('product/test')) - self.assertIsNotNone(url('product/:id', self.view).resolve('product/10')) - self.assertEqual(url('product/:id', self.view).resolve('product/10').kwargs['id'], '10') - self.assertEqual(url('product/:product_id', self.view).resolve('product/10').kwargs['product_id'], - '10') - - def test_slug(self): - self.assertIsNone(url('product/:slug', self.view).resolve('product/test/ouch')) - self.assertIsNotNone(url('product/:slug', self.view).resolve('product/test')) - self.assertIsNotNone(url('product/:slug/:other_slug', self.view).resolve('product/test/other')) - - def test_year(self): - self.assertIsNone(url('news/:year', self.view).resolve('news/last')) - for y in range(1970, 2025): - self.assertIsNotNone(url('news/:year', self.view).resolve('news/%s' % y)) - self.assertIsNone(url('news/:year/last', self.view).resolve('news/2014/other')) - self.assertIsNotNone(url('news/:year/last', self.view).resolve('news/2014/last')) - - def test_year_month(self): - self.assertIsNone(url('news/:year/:month', self.view).resolve('news/2014/last')) - self.assertIsNone(url('news/:year/:month', self.view).resolve('news/2014/2012')) - for y in range(1970, 2025): - for m in range(1, 12): - self.assertIsNotNone(url('news/:year/:month', self.view).resolve('news/%s/%s' % (y, m))) - - self.assertIsNotNone(url('news/:year/:month/last', self.view).resolve('news/2014/12/last')) - - def test_year_month_day(self): - self.assertIsNone(url('news/:year/:month/:day', self.view).resolve('news/2014/12/last')) - self.assertIsNone(url('news/:year/:month/:day', self.view).resolve('news/2014/2012/31')) - for y in range(2000, 2020): - for m in range(1, 12): - for d in range(1, 31): - self.assertIsNotNone(url('news/:year/:month/:day', self.view).resolve('news/%s/%s/%s' % (y, m, d))) - - def test_date(self): - self.assertIsNone(url('news/:date', self.view).resolve('news/2014/12/12')) - for y in range(2000, 2020): - for m in range(1, 12): - for d in range(1, 31): - self.assertIsNotNone(url('news/:date', self.view).resolve('news/%s-%s-%s' % (y, m, d))) - - def test_uuid(self): - self.assertIsNone(url("invoice/:uuid", self.view).resolve('invoice/123123-123123-1231231-1231312-3-1312312-')) - for i in range(1, 1000): - self.assertIsNotNone(url("invoice/:uuid", self.view).resolve('invoice/%s' % uuid.uuid4())) - - def test_no_match_for_invalid_uuid(self): - """ - UUID with invalid version. The allowed versions are 1, 2, 4 and 5 - xxxxxxxx-xxxx-Vxxx-xxx-xxxxxxxxxxxx - - https://github.com/phpdude/django-macros-url/pull/2 - """ - self.assertIsNone(url("invoice/:uuid", self.view).resolve('invoice/3e41b04d-0978-9027-86c2-aa90c63ecb54')) - - def test_cdv_as_view_calling(self): - from .views import CBVView - - self.assertIsInstance(url("", CBVView).resolve('').func, type(lambda: 1)) - - def test_cdv_as_view_pass_manual(self): - from .views import CBVView - - self.assertIsInstance(url("", CBVView.as_view()).resolve('').func, type(lambda: 1)) - - def test_cdv_as_view_pass_manual_params(self): - from .views import CBVView - - self.assertIsInstance(url("", CBVView.as_view(x='test.html')).resolve('').func, type(lambda: 1)) diff --git a/tests/views.py b/tests/views.py deleted file mode 100644 index 0b2fb1e..0000000 --- a/tests/views.py +++ /dev/null @@ -1,9 +0,0 @@ -from django.views.generic import View - - -def view(request): - pass - - -class CBVView(View): - x = None