Monthly Archives: August 2010

A Renewed ReStructuredText Editor!

Remember the ReStructuredText editor? Well I just spent my Google Summer of Code adding a bunch of new features to it:

  • A new toolbar with nice icons from the Tango icon library to give quick access to old and new features alike.
  • Buttons to apply inline markup for *emphasis*, **strong emphasis** and “inline literal“ to the selected text.
  • Functions to fix the length of the underline and overline of section headings. You can either use these functions with the buttons on the toolbar or use the Ctrl+D (for underline) and Ctrl+Shift+D (for underline and overline) keyboard shortcuts, which makes fixing titles extra quick when youre working on them.
  • View synchronization between the text editor and the HTML previewer. This can be done either by using the synchronize buttons on the toolbar or by activating the Sync view on change feature in the preference menu.
  • Quick conversion to HTML (using Docutils or Sphinx), LaTeX (using Docutils) and PDF (using rst2pdf) through the new Convert menu.
  • And no more being stuck with that ugly default font: the font of the text editor can now be changed through the preference menu.

There is also an experimental auto-fix table function that can be activated in the preference menu. This allows you to write text in an existing table without having to take care of rebuilding all the borders manually. The program will keep the structure of the table intact when writing text in a cell and will increase its length when there is no more room in the cell. Try it out on one of your existing table, but be careful, as said above, it is still very experimental and may cause the editor to crash (so save your files before using it!).

On a more technical side, we dropped support for the wxWidgets backend, so you will need Qt4 to run the editor. Here are two screenshots of the editor running on Ubuntu and Windows 7:

So, whats next?

Well for starters, the table auto-fix function has to be rewritten. As for further new features, Id like to work on allowing the user to select custom CSS files (or themes for Sphinx) for the HTML previewer. Also I think it might slowly be time for the editor to get actual installers, as currently it is still a pain to get it running if you arent familiar with ETS.

How about you, what features would you like to see in the editor?

EDIT:

Since quite a few people asked how to install the editor and that I won’t be able to build proper installer before sometime in September, I figure I’d at least write a small tutorial on how to install it from source.

First, you need to get SVN, Python 2.x (minimum 2.4), SetupTools, PyQt4 and NumPy and install them. (I’m not 100% sure, but MinGW might be needed too on Windows.)

Once that’s done, the following script should download the needed source from Enthought’s SVN and install the rest of the needed libraries by using SetupTools (easy_install…):

[code]svn co https://svn.enthought.com/svn/enthought/EnthoughtBase/trunk EnthoughtBase
svn co https://svn.enthought.com/svn/enthought/Traits/trunk Traits
svn co https://svn.enthought.com/svn/enthought/TraitsGUI/trunk TraitsGUI
svn co https://svn.enthought.com/svn/enthought/TraitsBackendQt/trunk TraitsBackendQt
svn co https://svn.enthought.com/svn/enthought/AppTools/trunk/enthought/rst RestEditor

cd EnthoughtBase
python setup.py install bdist_egg
cd ../Traits
python setup.py install bdist_egg
cd ../TraitsGUI
python setup.py install bdist_egg
cd ../TraitsBackendQt
python setup.py install bdist_egg
cd ..

easy_install -f dist/ -H dist/ EnthoughtBase Traits TraitsGUI TraitsBackendQt
easy_install configobj pygments docutils sphinx rst2pdf
[/code]

After that, you should be able to run the editor by going in the RestEditor folder and running app.py with Python:

[code]cd RestEditor
python app.py
[/code]