[Om] Adding a symbol to a CD in the SWiM wiki

Christoph LANGE ch.lange at jacobs-university.de
Mon Dec 22 02:07:44 CET 2008

Hi Chris,

  sorry for replying so late.  I will reply to the other parts of your mail
even later.  This is just a reply concerning CD editing in the wiki.
Therefore I'm sending it to the OpenMath list as well.

On Tuesday 25 November 2008 13:53:17 you wrote:
> Also I have not been able to get back to trying out the CD edior again.

When we met, we had figured out an easily implementable way of adding a symbol
(CDDefinition) to a CD.  Well, it turned out to be not that easy, that's why
it took me so long and still isn't done.  (I made some progress around one
week after our meeting, then got stuck halfway, then was busy with other
things, and now I'm back at that problem.)

It is now possible to add a symbol, BUT…

Please go to http://wiki.openmath.org/?title=cd%3Aswimtest and notice that at
the bottom of the CD there are some random symbol definitions.  I have added
these during my tests.  Then click "edit".  Scroll to the bottom of the text
field and click into the empty space below the last cd:CDDefinition table.
Watch out the table borders and be sure to click at the right place.  Be sure
not to add the new symbol outside the enclosing cd:CD.  The editor cannot yet
handle such errors and may behave in an undefined way.  Then use the OpenMath
menu from the annotation toolbar.  I still have not designed an icon.  It's
the second down-arrow in the second row of the toolbar.  Select "Content
Dictionaries -> Symbol".  A new cd:CDDefinition element with a placeholder of
a Name field will be added.  Carefully (!) replace the value of the "Name"
field by your desired symbol name; it's best if you only use Del and Backspace
for deleting the placeholder.  I need to make this more user-friendly soon.
Then save, see the new CDDefinition render, and, if you like, update the
OpenMath 3 svn and notice that the CD has changed.

OK, seems to work (at least for me), but let me tell you what remains to be
done:  When you edit the wiki page next time, the new CDDefinition is still
there, where you entered it.  But actually it should have been split off into
a subpage of its own, and replaced by an XInclude in the main CD.  (As you see
for the upper symbols in the swimtest CD.)  Sure, these split subparts are not
yet accessible in the _editor_ in a friendly way, but they are absolutely
necessary for enabling all the other nice features that SWiM already has --
all features related to browsing and changing _existing_ content, which I
deemed most important when I started enabling the wiki for OpenMath 3:

 * middle-clicking on a symbol in a formula to navigate to its CDDefinition
 * navigating from and to that symbol using the "references" tree on the right
 * editing the metadata of a symbol
 * generally editing a symbol and getting an exact svn log message that says
   "this symbol has been edited" and not just "something in this large CD has
 * specifically discussing _that_ symbol

(Convinced?  Well, otherwise it may sound stupid that it is so hard for me to
enable such a simple feature as adding a symbol.)

So this remains on my to-do list, rather for after Christmas than before
Christmas.  It will be somewhat involved, as, at the moment, the code for
splitting a CD is deeply hidden in the "import" module (which is used when
updating from the svn, as well as uploading a local file into the wiki) and
thus not easily accessible from the module that saves a page after editing.
Now I think I know how to solve it.  At the moment, the only workaround for
adding a symbol to a CD _and_ getting it split is:

1. add the symbol as described above
2. update your svn working copy
3. change the respective CD file (even trivially, e.g. by changing whitespace)
   with some other editor and commit it
4. visit the wiki page again.  Then, SWiM will perform an svn update and split
   the page in the course of re-importing it from the svn.

Hope that helps -- for now -- stay tuned for further improvements.  And, first
of all, have a merry Christmas :-)



Christoph Lange, Jacobs Univ. Bremen, http://kwarc.info/clange, Skype duke4701

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://openmath.org/pipermail/om/attachments/20081222/596e16b4/attachment.pgp 

More information about the Om mailing list