[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Texmacs-dev] "hello world" for converter plugin wanted
From: |
Immanuel Normann |
Subject: |
[Texmacs-dev] "hello world" for converter plugin wanted |
Date: |
Mon, 23 Aug 2004 01:07:25 +0200 |
Hi,
currently I struggle with writing a converter as plugin. Unfortunately I can't
find an example from where I could learn all steps. I know that there are these
examples of plugins in "example/plugins", but none of them are converters (btw.
the "world" plugin does not work in texmacs 1.4.1, as "insert-string" is an
unbound variable). On the other hand I can find converters in "progs/convert",
but these are not plugins.
So in my opinion a kind of hello world converter as plugin would be a nice
thing! Let me try this with your help:
Assume we have:
> ls $TEXMACS_HOME_PATH/plugins/my-converter/prog
init-my-converter.scm
my-converter.scm
And the content of init-my-converter.cm would be:
---------------------------------------
(define-format xyz
(:name "Xyz")
(:suffix "xyz")
(:recognize xyz-recognizes?))
(converter xyz-document xyz-stree
(:function parse-xyz-document))
(converter xyz-stree xyz-document
(:function serialize-xyz))
(converter xyz-snippet xyz-stree
(:function parse-xyz-snippet))
(converter xyz-stree xyz-snippet
(:function serialize-xyz))
(converter xyz-stree texmacs-stree
(:function xyz->texmacs))
(converter texmacs-stree xyz-stree
(:function texmacs->xyz))
---------------------------------------
And all the functions referred by ":function" would be defined in
my-converter.scm.
Appearently this is not sufficient to make the converter accessable in TeXmacs!
What is missing such that I can use my converter as user in TeXmacs like for
instance the html converter? More precisely: I want to be able to import/export
files via the "File/Import/Xyz" and "File/Export/Xyz" menu. And I want to be
able to copy and paste via "Edit/Copy to/Xyz" and "Edit/Paste from/Xyz". How is
this done?
Further: If I want to use inside of my-converter.scm a function foo which
resides in a file my-helpers.scm (in the dir of my-converter.scm), how do I
make this foo accessable in my-converter? To put this question more general:
There is this "texmacs-module" macro and also an "import-from" and I don't know
exactly how to use that (and I could not find help docs).
Immanuel
________________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt neu bei WEB.DE FreeMail: http://freemail.web.de/?mc=021193
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Texmacs-dev] "hello world" for converter plugin wanted,
Immanuel Normann <=