This is a read-only mirror of pymolwiki.org
Difference between revisions of "PyMOLWiki:Community Portal"
Line 103: | Line 103: | ||
=== New! GeShi: Syntax Highlighting for Python & More === | === New! GeShi: Syntax Highlighting for Python & More === | ||
+ | '''Update''': I have added the option for numbered syntax highlighting and non-numbered. | ||
+ | <pre> | ||
+ | <source lang="python">Non line-numbered code here</source> | ||
+ | </pre> | ||
+ | |||
+ | <pre> | ||
+ | <npython>line-numbered code here</npython> | ||
+ | </pre> | ||
+ | |||
+ | |||
We now have a syntax highlighter installed. It now supports something like 28 programming languages! When you paste your code simply wrap it in | We now have a syntax highlighter installed. It now supports something like 28 programming languages! When you paste your code simply wrap it in | ||
<language_name> ... code here ... </language_name>. | <language_name> ... code here ... </language_name>. | ||
Line 164: | Line 174: | ||
cmd.load_cgo(obj,'axes') | cmd.load_cgo(obj,'axes') | ||
</source> | </source> | ||
+ | |||
+ | Now with line numbers! | ||
+ | |||
+ | <npython> | ||
+ | # axes.py | ||
+ | from pymol.cgo import * | ||
+ | from pymol import cmd | ||
+ | from pymol.vfont import plain | ||
+ | |||
+ | # create the axes object, draw axes with cylinders coloured red, green, | ||
+ | #blue for X, Y and Z | ||
+ | |||
+ | obj = [ | ||
+ | CYLINDER, 0., 0., 0., 50., 0., 0., 0.2, 1.0, 1.0, 1.0, 1.0, 0.0, 0., | ||
+ | CYLINDER, 0., 0., 0., 0., 50., 0., 0.2, 1.0, 1.0, 1.0, 0., 1.0, 0., | ||
+ | CYLINDER, 0., 0., 0., 0., 0., 50., 0.2, 1.0, 1.0, 1.0, 0., 0.0, 1.0, | ||
+ | ] | ||
+ | |||
+ | # add labels to axes object (requires pymol version 0.8 or greater, I | ||
+ | # believe | ||
+ | |||
+ | cyl_text(obj,plain,[-5.,-5.,-1],'Origin',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]]) | ||
+ | cyl_text(obj,plain,[50.,0.,0.],'X',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]]) | ||
+ | cyl_text(obj,plain,[0.,50.,0.],'Y',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]]) | ||
+ | cyl_text(obj,plain,[0.,0.,50.],'Z',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]]) | ||
+ | |||
+ | # then we load it into PyMOL | ||
+ | cmd.load_cgo(obj,'axes') | ||
+ | </npython> | ||
+ | |||
See [http://qbnz.com/highlighter/index.php The Geshi Home Page] | See [http://qbnz.com/highlighter/index.php The Geshi Home Page] | ||
[[User:Tree|Tree]] | [[User:Tree|Tree]] |
Revision as of 17:55, 28 February 2005
CP
Look here for ways to get involved in the PyMolWiki!
Helping
- A wiki edit/user policy is needed.
- Graphic design and CSS layout: We need logos, BG images and CSS layout
- Importing the email list content: We have (lots) of email to sift through, extract data from and import into the Wiki
- If you feel you have the time to help import data into the PyMol wiki, please email Tree.
Categories/Content
You may now add content to the wiki. This is a semi-structured wiki in that the categories are pseudo-hierarchically linked. If you feel we're missing a category, please find where it would most logically fit, add it to the main page via the Top Level Schema Policy.
Section Layout
Please see Discussion for more thoughts on the site organizaiton.
Layout Schema
- News
- Technical Issues
- Launching PyMOL
- Using PyMol
- Mouse Controls
- Objects and Selections
- Display Settings
- Stereo 3D Display -- wrong place
- Hardware Options -- wrong place?
- Linux XFree86 Configuration -- wrong place
- Scenes
- Mouse Settings
- Wizards
- Ray-tracing
- Settings Reference
- Movies and Animations
- Structure Alignment
- Structure Alignment Editor
- Command Language
- Advanced Issues
- Scripting
- Plugins
- High-Level Applications
- Third Party Software
- Python Integration
- Unintended Uses (OpenGL Object Renderer)
- Uncategorized For new pages, misplaced pages, etc.
Tree 02:09, 16 Feb 2005 (CST)
New! GeShi: Syntax Highlighting for Python & More
Update: I have added the option for numbered syntax highlighting and non-numbered.
<source lang="python">Non line-numbered code here</source>
<npython>line-numbered code here</npython>
We now have a syntax highlighter installed. It now supports something like 28 programming languages! When you paste your code simply wrap it in
<language_name> ... code here ... </language_name>.
Here's an example:
<python> # axes.py from pymol.cgo import * from pymol import cmd from pymol.vfont import plain # create the axes object, draw axes with cylinders coloured red, green, #blue for X, Y and Z obj = [ CYLINDER, 0., 0., 0., 50., 0., 0., 0.2, 1.0, 1.0, 1.0, 1.0, 0.0, 0., CYLINDER, 0., 0., 0., 0., 50., 0., 0.2, 1.0, 1.0, 1.0, 0., 1.0, 0., CYLINDER, 0., 0., 0., 0., 0., 50., 0.2, 1.0, 1.0, 1.0, 0., 0.0, 1.0, ] # add labels to axes object (requires pymol version 0.8 or greater, I # believe cyl_text(obj,plain,[-5.,-5.,-1],'Origin',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]]) cyl_text(obj,plain,[50.,0.,0.],'X',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]]) cyl_text(obj,plain,[0.,50.,0.],'Y',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]]) cyl_text(obj,plain,[0.,0.,50.],'Z',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]]) # then we load it into PyMOL cmd.load_cgo(obj,'axes') <python>
gives us the code
# axes.py
from pymol.cgo import *
from pymol import cmd
from pymol.vfont import plain
# create the axes object, draw axes with cylinders coloured red, green,
#blue for X, Y and Z
obj = [
CYLINDER, 0., 0., 0., 50., 0., 0., 0.2, 1.0, 1.0, 1.0, 1.0, 0.0, 0.,
CYLINDER, 0., 0., 0., 0., 50., 0., 0.2, 1.0, 1.0, 1.0, 0., 1.0, 0.,
CYLINDER, 0., 0., 0., 0., 0., 50., 0.2, 1.0, 1.0, 1.0, 0., 0.0, 1.0,
]
# add labels to axes object (requires pymol version 0.8 or greater, I
# believe
cyl_text(obj,plain,[-5.,-5.,-1],'Origin',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]])
cyl_text(obj,plain,[50.,0.,0.],'X',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]])
cyl_text(obj,plain,[0.,50.,0.],'Y',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]])
cyl_text(obj,plain,[0.,0.,50.],'Z',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]])
# then we load it into PyMOL
cmd.load_cgo(obj,'axes')
Now with line numbers!
<npython>
# axes.py
from pymol.cgo import * from pymol import cmd from pymol.vfont import plain
- create the axes object, draw axes with cylinders coloured red, green,
- blue for X, Y and Z
obj = [
CYLINDER, 0., 0., 0., 50., 0., 0., 0.2, 1.0, 1.0, 1.0, 1.0, 0.0, 0., CYLINDER, 0., 0., 0., 0., 50., 0., 0.2, 1.0, 1.0, 1.0, 0., 1.0, 0., CYLINDER, 0., 0., 0., 0., 0., 50., 0.2, 1.0, 1.0, 1.0, 0., 0.0, 1.0, ]
- add labels to axes object (requires pymol version 0.8 or greater, I
- believe
cyl_text(obj,plain,[-5.,-5.,-1],'Origin',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]]) cyl_text(obj,plain,[50.,0.,0.],'X',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]]) cyl_text(obj,plain,[0.,50.,0.],'Y',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]]) cyl_text(obj,plain,[0.,0.,50.],'Z',0.20,axes=[[3,0,0],[0,3,0],[0,0,3]])
- then we load it into PyMOL
cmd.load_cgo(obj,'axes') </npython>