FAQ
| Q: | How do we define multiple code segments in the same page? |
| A: | You can have multiple language definitions in the same page.Just define each of the <pre> block with a unique id, Lets say you have two blocks of python code.
<pre id="python_code1"> print "First code block" #code 1 goes here </pre> <p> Some Text .... <pre id="python_code2"> print "Second code block" #code 2 goes here </pre> Some additional Text The code1 and code2 will tell pygments javascript to make two requests to pygments.com which will render the code blocks independently. You can also have multiple language types in the same page. The above code would render as follows print "First code block" #code 1 goes here
print "Second code block" #code 2 goes here |