← Back to team overview

zim-wiki team mailing list archive

Re: How to copy-paste from Zim without the wiki code?

 

Your assumption is right, my code is in verbatim text. Having the option to have headings transferred to comments would be great, but unfortunately I know less then a bit of python. But even the option to copy/paste without any format would be great. I just start all my headings with a hash, so when copied to my code editor, they are commented automatically.

By the way, the headings level 3 and below are already copied with hash tags in front, like e.g., below:

Heading level 1
===============
This is a test

Heading level 2
---------------
This is a test

### Heading level 3
This is a test

#### Heading level 4
This is a test

So it seems it is already partially implemented :-)

Cheers,

Paulo

p.s. if I may sneak in an idea for plugin, what about the other way around, a function that converts code (plain text) to verbatim text and commented text (all lines starting with a hash for example) to a headings? Perhaps different heading levels depending on the number of hash tags. Just an idea :-)




On Fri 29 Mar 2013 10:50:17 AM CET, Jaap Karssenberg wrote:
On Thu, Mar 28, 2013 at 1:22 PM, Paulo van Breugel
<p.vanbreugel@xxxxxxxxx> wrote:
For me a clean text copy/paste option would be great. I keep a record of R
and shell scripting code in zim. I use headings to structure the code in
ZIM. This works great, except that often I want to copy some code from a Zim
page to my text editor and I would prefer not to have to remove all the
heading format code.

My first thought is that the headings in the wiki page should probably
transfer to comments in the code. And I assume the actual code in the
zim page is formatted as blocks of verbatim text.

Continuing that thought you could even define a special copy-paste
format that turns all normal text into comments and only leaves
verbatim blocks as normal text.

Does this make sense for your use case, or am I assuming to much about
how you use it ?

( Only complexity would be the different comment styles. Probably you
would need a variant that uses "#" for comments and one that uses "//"
for comments. )

Regards,

Jaap


References