[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwrite-devel
Subject:    Kate snippets
From:       Gerald Senarclens de Grancy <gerald () senarclens ! eu>
Date:       2017-11-02 14:25:29
Message-ID: CAPszUgij_OqGEn0U=LkV5vfWg7YQZm_3PEiT4eGLTyfoVax4LA () mail ! gmail ! com
[Download RAW message or body]

Hi,
I'm trying to create a kate snippet that depends on external data to
automate some of my tasks at work. Is there any way to achieve this?
I'm flexible wrt how the data is provided (eg. as website (ideal), via a
file on http://localhost/ or anywhere in the local file system).
I've found

String read(*String file*);

Will search the given *file* relative to the katepart/script/files
directory and return its content as a string.

on https://docs.kde.org/stable5/en/applications/katepart/dev-scripting.html
but it seems to be restricted (worked for eg.
read('quickcoding/cpp/c.template') or read('../commands/emmet.js'); but not
much further up and didn't work for a file I created in
katepart/script/files for testing purposes.
Any hints are welcome.
Thx, g

-- 
Gerald Senarclens de Grancy
http://senarclens.eu/~gerald/
Open minds on open source!

[Attachment #3 (text/html)]

<div dir="ltr"><div><div><div>Hi,<br></div>I&#39;m trying to create a kate snippet \
that depends on external data to automate some of my tasks at work. Is there any way \
to achieve this?<br></div>I&#39;m flexible wrt how the data is provided (eg. as \
website (ideal), via a file on <a href="http://localhost/">http://localhost/</a> or \
anywhere in the local file system).<br></div>I&#39;ve found <br><div \
class="gmail-variablelist"><dl class="gmail-variablelist"><dt><span \
class="gmail-term"><pre class="gmail-synopsis">String read(<span \
class="gmail-parameter"><em class="gmail-parameter"><code>String <span \
class="gmail-replaceable"><em \
class="gmail-replaceable"><code>file</code></em></span></code></em></span>); \
</pre></span></dt><dd><p> Will search the given <span class="gmail-replaceable"><em \
class="gmail-replaceable"><code>file</code></em></span> relative to the <code \
class="gmail-literal">katepart/script/files</code> directory and return its content \
as a string. </p></dd></dl><p>on <a \
href="https://docs.kde.org/stable5/en/applications/katepart/dev-scripting.html">https://docs.kde.org/stable5/en/applications/katepart/dev-scripting.html</a> \
but it seems to be restricted (worked for eg. \
read(&#39;quickcoding/cpp/c.template&#39;) or read(&#39;../commands/emmet.js&#39;); \
but not much further up and didn&#39;t work for a file I created in <code \
class="gmail-literal">katepart/script/files</code> for testing \
purposes.<br></p></div><div><div><div><div>Any hints are welcome.</div><div>Thx, \
g<br></div><div><br>-- <br><div class="gmail_signature">Gerald Senarclens de \
Grancy<br><a href="http://senarclens.eu/~gerald/" \
target="_blank">http://senarclens.eu/~gerald/</a><br>Open minds on open source!</div> \
</div></div></div></div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic