30 Apr 2012 06:45
how to incorporate a new role into distutils
Angel Yanguas-Gil <angel.yanguas <at> gmail.com>
2012-04-30 04:45:42 GMT
2012-04-30 04:45:42 GMT
Hi, I have been playing with docutils and I have created a new role :chem:, to process subscripts and superscripts for chemical formula (i.e. :chem: or :ch:`Al2O3` == Al<sub>2</sub>O<sub>3</sub>). It worked, and now I have it running in my local copy. However, I still have a couple of questions: 1) So far I have included it in my local copy of roles.py. Is there any other way of loading custom roles / add-ons to distutils that does not involve modifying roles.py? (like a local directory where custom roles could be added/imported into distutils?). 2) Is nodes.Text the standard way of returning a text node? 3) Can roles be made to work recursively? In other words, am I missing a simple way of calling a role within a role (i.e. so that I can expand Al2O3 into "Al :subs:`2`\ O:subs:`3`\ " and that magically everything is taken care of)?. 4) Is a role the best way of doing this? Should I be using a directive instead, or is it an overkill? Many thanks, ay ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware(Continue reading)
RSS Feed