Autoconvert text to element
Posted: Fri Jun 17, 2011 11:34 pm
I have this idea that I would like to implement using oXygen customizations. It is for a custom DocBook framework.
The user basically types something like "[1]" or "[1,3]", which represents links to reference section, and the editor will automatically detect such text and turn it into <xref linkend="bib.workscited.1" xrefstyle="bib"/> or <xref linkend="bib.workscited.1" xrefstyle="bib"/><xref linkend="bib.workscited.3" xrefstyle="bib"/>
I already figured out how to display <xref linkend="bib.workscited.1" xrefstyle="bib"/> as [1]. Now I need a simple way to add these elements. Currently I have it implemented as a dialog where user types in numbers separated by commas and elements are inserted automatically. I want to make it even easier.
If you think that making editor look at each character is too much processing power, then I can limit the code execution to only work after '[' key press. Another alternative is to make it non real time at all, but to invoke it on a user's command: A user would, optionally, highlight some text and press a button and the highlighted chunk of text or whole document will get processed.
The user basically types something like "[1]" or "[1,3]", which represents links to reference section, and the editor will automatically detect such text and turn it into <xref linkend="bib.workscited.1" xrefstyle="bib"/> or <xref linkend="bib.workscited.1" xrefstyle="bib"/><xref linkend="bib.workscited.3" xrefstyle="bib"/>
I already figured out how to display <xref linkend="bib.workscited.1" xrefstyle="bib"/> as [1]. Now I need a simple way to add these elements. Currently I have it implemented as a dialog where user types in numbers separated by commas and elements are inserted automatically. I want to make it even easier.
If you think that making editor look at each character is too much processing power, then I can limit the code execution to only work after '[' key press. Another alternative is to make it non real time at all, but to invoke it on a user's command: A user would, optionally, highlight some text and press a button and the highlighted chunk of text or whole document will get processed.