The following ReST:
|Acme(TM)|_ .. |Acme(TM)| unicode:: Acme U+2122 .. _Acme(TM): http://example.com
produces this HTML:
| from intercom import Intercom | |
| from intercom import User | |
| ... | |
| Intercom.api_key = 'xxx' | |
| Intercom.api_id = 'yyy' | |
| ... | |
| user = User.find_by_email('bob@example.com') | |
| user.custom_data['age'] = 42 user.save() | |
| ... | |
| user.created_at # datetime object |
| from django.db import connections | |
| from django.db import transaction | |
| def disable_transaction_methods(): | |
| from django.test.testcases import disable_transaction_methods | |
| for db in connections: | |
| transaction.enter_transaction_management(using=db) | |
| transaction.managed(True, using=db) |
| # See https://gist.github.com/3830479 for disable_ and restore_ functions | |
| from unittest import TestCase | |
| class Test(TestCase): | |
| @classmethod | |
| def class_setup(cls): | |
| disable_transaction_methods() | |
| # ... import test fixtures |
| import os | |
| import pymongo | |
| from urlparse import urlparse | |
| MONGO_URL = os.environ.get('MONGOHQ_URL') | |
| if MONGO_URL: | |
| # Get a connection | |
| conn = pymongo.Connection(MONGO_URL) | |
The following ReST:
|Acme(TM)|_ .. |Acme(TM)| unicode:: Acme U+2122 .. _Acme(TM): http://example.com
produces this HTML:
| "use strict" | |
| require("coffee-script") | |
| stitch = require("stitch") | |
| express = require("express") | |
| argv = process.argv.slice(2) | |
| pkg = stitch.createPackage( | |
| # Specify the paths you want Stitch to automatically bundle up | |
| paths: [ __dirname + "/app"], |
@prettyprint python
class PrettyPreExtension (markdown.Extension):
def extendMarkdown(self, md, md_globals):
md.registerExtension(self)
self.processor = PreTreeprocessor()
self.processor.md = md
self.processor.config = self.getConfigs()
| box: wercker/python | |
| build: | |
| steps: | |
| - script: | |
| name: "install lessc with sudo" | |
| code: |- | |
| curl https://npmjs.org/install.sh | sudo bash | |
| sudo npm install less -g | |
| - script: | |
| name: "install lessc locally" |
| import time | |
| from docraptor import DocRaptor | |
| docraptor = DocRaptor() | |
| print "Create PDF" | |
| # resp = docraptor.create({ | |
| # 'document_content': '<h1>python-docraptor</h1><p>Async Test</p>', | |
| # 'test': True, | |
| # 'async': True |
| deploy: | |
| steps: | |
| - heroku-deploy | |
| - script: | |
| name: install heroku-exit-status plugin | |
| code: heroku plugins:install https://github.com/glenngillen/heroku-exit-status.git | |
| - script: | |
| name: migrate with south | |
| code: heroku run "python manage.py migrate" -a $HEROKU_APP_NAME |