stuart macgregor wrote:

> 
>> If these scraps exist as separate text files, then use the External
>> inset.
> 
> They do not - they are just an lyx paragraph of scrap type in a
> noweb layout
> document type.  After lyx exports to noweb format, noweb (notangle)
> can be used to collect the scraps and build the source from them.
> 
> The interface would have to place the scrap in a temp file or pipe
> or etc. for gvim to process.

I don't think that a mechanism exists currently to 'export' a block 
of text to the outside world, or to 'import' a block of text in place 
of an existing block.

Actually, it shouldn't be too hard. How would you identify the 
'scrap' you want to export? Would you mark (highlight) a block of 
text or would you 'deduce' the block from the position of the cursor?

Either way, I can imagine an lfun, "export-scrap", that simply posts 
this block, however identified, to the 'out' pipe of the lyxserver.

Similarly, I can imagine an lfun, "import-scrap <data>" that replaces 
the block, however identified, with <data>.

That is all that LyX needs to do. The rest, opening and closing a 
console/vi session, would be the job of whatever has opened the pipe 
connection with LyX.

Would this fit the bill?


>> The version in lyx 1.3.x isn't very pretty: the data is displayed
>> on the LyX screen as a grey box. Nonetheless, you would have givent
>> full control over the eventual output of the typeset document if
>> you wrote a NowebScrap template. See the external_templates file
>> for the 'language' and the templates that we currently provide.
> 
> I had a look, but it did not seem to be a good match to the problem
> - perhaps there is more doc somewhere which will let me see how it
> can be used?
> 
> I wondered if the server interface might be called for?

-- 
Angus

Reply via email to