Kent and I spent quite awhile at the sprint discussing Leo as a platform for rST markup. Kent's idea was that Leo should be able to import rst files, have the user edit the files, and then write the files with no changes whatever except the changes the user actually made. I agree completely that this is a good goal.
During the sprint, Kent talked to David Goodger, the author of docutils, about how to use the docutils rst parser to help import rst files into Leo. Kent worked on a script that was supposed to do the job. However, I think there is another way, namely to create a Leo importer for rst files. Parsing rst files is actually not too difficult. The problem lies in retaining the exact markup used to represent rST section. That is, we want to remember, say, that the original file used ###### as the underlining for top-level markup. Kent proposed to keep this info in uA's, but I think a clearer, more explicit way would be to create a new Leo directive, say @rst- underlines. This would correspond to the rst3 plugins underline_characters option. The idea is that the importer code would automatically create this directive when importing, and the code (maybe a separate command) that writes the rst file would use the @rst- underlines directive to generate the rST markup for sections. Some important details remain. For example, importing an rst file probably should not create an @thin node (or any other kind of @<file> node), because Leo's write code doesn't understand rST markup, and should not be asked to create such markup. Instead, as I said above, a separate command, say rst-write, would be needed to write the revised rst file. But this kind of complication will remain regardless of how the rst file gets imported into Leo. Your comments, please. Edward --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en -~----------~----~----~----~------~----~------~--~---
