Permalink
Browse files

Add python syntax highlighting to the README.

  • Loading branch information...
1 parent 6f969b8 commit bc952d9235a2e7ccadf7f50ab4e9f1207fc506cf @garnertb garnertb committed Oct 11, 2015
Showing with 34 additions and 32 deletions.
  1. +34 −32 README.md
View
@@ -26,39 +26,41 @@ Using the plug-in JSONLD serializer/parser with RDFLib
The plugin parser and serializer are automatically registered if installed by
setuptools.
-
- >>> from rdflib import Graph, plugin
- >>> from rdflib.serializer import Serializer
-
- >>> testrdf = '''
- ... @prefix dc: <http://purl.org/dc/terms/> .
- ... <http://example.org/about>
- ... dc:title "Someone's Homepage"@en .
- ... '''
-
- >>> g = Graph().parse(data=testrdf, format='n3')
-
- >>> print(g.serialize(format='json-ld', indent=4))
- {
- "@id": "http://example.org/about",
- "http://purl.org/dc/terms/title": [
- {
- "@language": "en",
- "@value": "Someone's Homepage"
- }
- ]
- }
-
- >>> context = {"@vocab": "http://purl.org/dc/terms/", "@language": "en"}
- >>> print(g.serialize(format='json-ld', context=context, indent=4))
- {
- "@context": {
+
+```python
+>>> from rdflib import Graph, plugin
+>>> from rdflib.serializer import Serializer
+
+>>> testrdf = '''
+... @prefix dc: <http://purl.org/dc/terms/> .
+... <http://example.org/about>
+... dc:title "Someone's Homepage"@en .
+... '''
+
+>>> g = Graph().parse(data=testrdf, format='n3')
+
+>>> print(g.serialize(format='json-ld', indent=4))
+{
+ "@id": "http://example.org/about",
+ "http://purl.org/dc/terms/title": [
+ {
"@language": "en",
- "@vocab": "http://purl.org/dc/terms/"
- },
- "@id": "http://example.org/about",
- "title": "Someone's Homepage"
- }
+ "@value": "Someone's Homepage"
+ }
+ ]
+}
+
+>>> context = {"@vocab": "http://purl.org/dc/terms/", "@language": "en"}
+>>> print(g.serialize(format='json-ld', context=context, indent=4))
+{
+ "@context": {
+ "@language": "en",
+ "@vocab": "http://purl.org/dc/terms/"
+ },
+ "@id": "http://example.org/about",
+ "title": "Someone's Homepage"
+}
+```
Building the Sphinx documentation

0 comments on commit bc952d9

Please sign in to comment.