← Back to team overview

zim-wiki team mailing list archive

Verbatim in page created via custom tools

 

Hello!

I coded a small custom tool that imports some data (aminoacid sequences)
and write it to new subpages. Sequence example (60 characters + \newline):

REDAKHFVGL*AV*GFGLG**SAASMGAK*LRTCI*SKPF**VFR**RQLY*ERPRGLVL
VLEV*LHVSLMKLMYTFIINICYCKRVNLHCVP*FD*S*KVENQRPGFVKLVIFL**MIE
LALLI**RCVDIHHVPSLY*KLYFHY*ISTFTRRI*RKLM*CMLVSE***LLIIINVLEL

Since there are double asterisks sometimes, zim is interpreting as bold
text (changing the actual sequence):

REDAKHFVGL*AV*GFGLG*SAASMGAK*LRTCI*SKPF*VFR**RQLY*ERPRGLVL
VLEV*LHVSLMKLMYTFIINICYCKRVNLHCVP*FD*S*KVENQRPGFVKLVIFL**MIE
LALLI*RCVDIHHVPSLY*KLYFHY*ISTFTRRI*RKLM*CMLVSE**LLIIINVLEL

To overcome this I tried to wrap the sequence as verbatim by writing
'''before and after the sequence when creating the new subpage. But
this was
not interpreted as verbatim (it was just printed before and after the
sequence). If I go to Tools > Edit Source and save without any
modification, the sequence is then formatted into verbatim.

It is a python script and I am simply using:

file.write("'''\n")
file.write(sequence)
file.write("\n'''")

to write in the file (standard zim-wiki headers are also created for each
new page).

Any ideas on how to get the verbatim formatted on the fly?

thanks!

bruno

Follow ups