mirror of
https://github.com/almet/notmyidea.git
synced 2025-04-28 19:42:37 +02:00
blogpost ok
This commit is contained in:
parent
377827749c
commit
22d1e77c75
2 changed files with 241 additions and 7 deletions
|
@ -1,9 +1,9 @@
|
|||
Introducing Cornice
|
||||
###################
|
||||
|
||||
:date: 06/12/2011
|
||||
:date: 07/12/2011
|
||||
|
||||
Wow, already my third working day at mozilla. Since Monday, I've been working with
|
||||
Wow, already my third working day at Mozilla. Since Monday, I've been working with
|
||||
Tarek Ziadé, on a pyramid REST-ish toolkit named `Cornice <https://github.com/mozilla-services/Cornice>`_.
|
||||
|
||||
Its goal is to take care for you of what you're usually missing so you can
|
||||
|
@ -44,7 +44,7 @@ As you might have seen, `request.errors.add` takes three parameters: **location*
|
|||
|
||||
**location** is where the error is located in the request. It can either be "body",
|
||||
"query", "headers" or "path". **name** is the name of the variable causing
|
||||
problem, if any, and **description** contains a more detailled message.
|
||||
problem, if any, and **description** contains a more detailed message.
|
||||
|
||||
Let's run this simple service and send some queries to it::
|
||||
|
||||
|
@ -137,10 +137,39 @@ accepted `Content-Type` values::
|
|||
Building your documentation automatically
|
||||
=========================================
|
||||
|
||||
XXX
|
||||
writing documentation for web services can be painful, especially when your
|
||||
services evolve. Cornice provides a sphinx directive to automatically document
|
||||
your API in your docs.
|
||||
|
||||
Yay, how can I get it?
|
||||
.. code-block:: rst
|
||||
|
||||
.. services::
|
||||
:package: coolapp
|
||||
:service: quote
|
||||
|
||||
Here is an example of what a generated page looks like: http://packages.python.org/cornice/exampledoc.html
|
||||
|
||||
|
||||
Yay! How can I get it?
|
||||
======================
|
||||
|
||||
What's next
|
||||
===========
|
||||
We just cut a 0.4 release, so it's available at http://pypi.python.org/pypi/Cornice
|
||||
You can install it easily using `pip`, for instance::
|
||||
|
||||
$ pip install cornice
|
||||
|
||||
You can also have a look at the documentation at
|
||||
http://packages.python.org/cornice/
|
||||
|
||||
What's next?
|
||||
============
|
||||
|
||||
We try to make our best to find how Cornice can help you build better
|
||||
web services. Cool features we want for the future include:
|
||||
|
||||
* Automatically publish a static definition of the services, so it can be
|
||||
used by clients to discover services in a nice way.
|
||||
|
||||
Of course, we are open to all your ideas and patches! If you feel haskish and
|
||||
want to see the sources, `go grab them on github <https://github.com/mozilla-services/cornice>`_
|
||||
, commit and send us a pull request!
|
||||
|
|
205
theme/static/css/pygment.css
Normal file
205
theme/static/css/pygment.css
Normal file
|
@ -0,0 +1,205 @@
|
|||
.hll {
|
||||
background-color:#FFFFCC;
|
||||
}
|
||||
.c {
|
||||
color:#408090;
|
||||
font-style:italic;
|
||||
}
|
||||
.err {
|
||||
border:1px solid #FF0000;
|
||||
}
|
||||
.k {
|
||||
color:#007020;
|
||||
font-weight:bold;
|
||||
}
|
||||
.o {
|
||||
color:#666666;
|
||||
}
|
||||
.cm {
|
||||
color:#408090;
|
||||
font-style:italic;
|
||||
}
|
||||
.cp {
|
||||
color:#007020;
|
||||
}
|
||||
.c1 {
|
||||
color:#408090;
|
||||
font-style:italic;
|
||||
}
|
||||
.cs {
|
||||
background-color:#FFF0F0;
|
||||
color:#408090;
|
||||
}
|
||||
.gd {
|
||||
color:#A00000;
|
||||
}
|
||||
.ge {
|
||||
font-style:italic;
|
||||
}
|
||||
.gr {
|
||||
color:#FF0000;
|
||||
}
|
||||
.gh {
|
||||
color:#000080;
|
||||
font-weight:bold;
|
||||
}
|
||||
.gi {
|
||||
color:#00A000;
|
||||
}
|
||||
.go {
|
||||
color:#303030;
|
||||
}
|
||||
.gp {
|
||||
color:#C65D09;
|
||||
font-weight:bold;
|
||||
}
|
||||
.gs {
|
||||
font-weight:bold;
|
||||
}
|
||||
.gu {
|
||||
color:#800080;
|
||||
font-weight:bold;
|
||||
}
|
||||
.gt {
|
||||
color:#0040D0;
|
||||
}
|
||||
.kc {
|
||||
color:#007020;
|
||||
font-weight:bold;
|
||||
}
|
||||
.kd {
|
||||
color:#007020;
|
||||
font-weight:bold;
|
||||
}
|
||||
.kn {
|
||||
color:#007020;
|
||||
font-weight:bold;
|
||||
}
|
||||
.kp {
|
||||
color:#007020;
|
||||
}
|
||||
.kr {
|
||||
color:#007020;
|
||||
font-weight:bold;
|
||||
}
|
||||
.kt {
|
||||
color:#902000;
|
||||
}
|
||||
.m {
|
||||
color:#208050;
|
||||
}
|
||||
.s {
|
||||
color:#4070A0;
|
||||
}
|
||||
.na {
|
||||
color:#4070A0;
|
||||
}
|
||||
.nb {
|
||||
color:#007020;
|
||||
}
|
||||
.nc {
|
||||
color:#0E84B5;
|
||||
font-weight:bold;
|
||||
}
|
||||
.no {
|
||||
color:#60ADD5;
|
||||
}
|
||||
.nd {
|
||||
color:#555555;
|
||||
font-weight:bold;
|
||||
}
|
||||
.ni {
|
||||
color:#D55537;
|
||||
font-weight:bold;
|
||||
}
|
||||
.ne {
|
||||
color:#007020;
|
||||
}
|
||||
.nf {
|
||||
color:#06287E;
|
||||
}
|
||||
.nl {
|
||||
color:#002070;
|
||||
font-weight:bold;
|
||||
}
|
||||
.nn {
|
||||
color:#0E84B5;
|
||||
font-weight:bold;
|
||||
}
|
||||
.nt {
|
||||
color:#062873;
|
||||
font-weight:bold;
|
||||
}
|
||||
.nv {
|
||||
color:#BB60D5;
|
||||
}
|
||||
.ow {
|
||||
color:#007020;
|
||||
font-weight:bold;
|
||||
}
|
||||
.w {
|
||||
color:#BBBBBB;
|
||||
}
|
||||
.mf {
|
||||
color:#208050;
|
||||
}
|
||||
.mh {
|
||||
color:#208050;
|
||||
}
|
||||
.mi {
|
||||
color:#208050;
|
||||
}
|
||||
.mo {
|
||||
color:#208050;
|
||||
}
|
||||
.sb {
|
||||
color:#4070A0;
|
||||
}
|
||||
.sc {
|
||||
color:#4070A0;
|
||||
}
|
||||
.sd {
|
||||
color:#4070A0;
|
||||
font-style:italic;
|
||||
}
|
||||
.s2 {
|
||||
color:#4070A0;
|
||||
}
|
||||
.se {
|
||||
color:#4070A0;
|
||||
font-weight:bold;
|
||||
}
|
||||
.sh {
|
||||
color:#4070A0;
|
||||
}
|
||||
.si {
|
||||
color:#70A0D0;
|
||||
font-style:italic;
|
||||
}
|
||||
.sx {
|
||||
color:#C65D09;
|
||||
}
|
||||
.sr {
|
||||
color:#235388;
|
||||
}
|
||||
.s1 {
|
||||
color:#4070A0;
|
||||
}
|
||||
.ss {
|
||||
color:#517918;
|
||||
}
|
||||
.bp {
|
||||
color:#007020;
|
||||
}
|
||||
.vc {
|
||||
color:#BB60D5;
|
||||
}
|
||||
.vg {
|
||||
color:#BB60D5;
|
||||
}
|
||||
.vi {
|
||||
color:#BB60D5;
|
||||
}
|
||||
.il {
|
||||
color:#208050;
|
||||
}
|
Loading…
Reference in a new issue