[texworks] Script: Questions about the API

Paul A Norman paul.a.norman at gmail.com
Mon Apr 19 02:31:22 CEST 2010


Dear Stefan,

I was very encouraged to just read your last posting.

Thank you very much for your great effort there and especially with
this last major improvement!

This should now reopen other possibialities which have been stalled.

The issue of different web engines handling of css and script has held
me up for now, as some people (perhaps even Alain), depending on their
browser  (and particualrly the version) could not even see the opening
page on my first main big trial!

Gecko or WebKit would have been great, but TeXWorks now having a
definite web browser engine (WebKit) to focuss on, will enable many
things for different developers and users to progress really well.

When I first started profiling intergrating LaTeX help, Jonathan Kews
correctly pointed out that the NASA module I was working with was
potentially outdated.

Well, Karl Berry contacted me after viewing the original trial (that
ginormous thing including many different aspects) and suggested using
a replacement, for the NASA module, that he had taken over the
maintainence of.  It endeavours to cover all the main LaTeX commands
and environments, and a few other key aspects as well.
He has invited any one to add and to and improve that module, so that
could happen as well along the way.

So I am thinking with what you have done, I could try to intergrate (a
cut down version of my first main trial) using Karl's html module to
generate context sensative help for LaTeX commands with the TeXWorks
editor, and give the oppertunity to the user to choose a command or
environment, and return the necessary mark-up to the Tw editor.

Also I am looking to produce a summary of the often used packages in
html form (which can also return any chosen command to the editor).
This could dynamically point to the pdfs for deeper information for
MiTeK and TeXLive using the texdoc command from script in the new
webkit forms.

First, a few of us hope to help update the hyperref package
documentation and Karl Berry and Heiko Oberdiek have established a new
repository for the hyperref package and made an alpha docs space for
work to be done in.  So a spin-off of that should provide better html
help for at least hyperref at first.

Two quick question please,

1.  When you write ">There are a few limitations (no file uploads, for
example), ", is there a XMLHttpRequest(); type object available (used
for Ajax type functions for reading in purposes)?

        (If not, no doubt a File reading workaround through TW
functions will work well.)

2. Can Tw Script return particualry the word, or line contents?

  I see line number as  __LINE__ , is there an array of lines
corresponding to that number,
  or a function to return  the line of text (and or word?) where the
user has the cursor?

        (If not hopefully I can fashion it all from the TW.target.text
property and the selection
        functions and regular expressions, but thought I should see if
the wheel has
        been invented first!)

Many many thanks again, I am sure that along with everything else that
Jonathan and you and every one else is doing, this QtWebkit
integration will longterm prove to be a big step forward for Tw users!

I look forward to exploring it more fully soon!

Paul

On 19 April 2010 00:14, Stefan Löffler <st.loeffler at gmail.com> wrote:
> Hi again,
>
> Am 2010-03-18 02:51, schrieb Paul A Norman:
>> Jonathan, did you mention a while ago that QT could display an html
>> browser window?
>>
>> If so can QTScript call this and communicate with it through the
>> browser's object's DOM?
>>
>> Then we could design user interaction windows and use them from script.
>>
>
> I finally got around to this last (and probably most difficult ;)) item
> on your request list. I posted a patch on GC
> (http://code.google.com/p/texworks/issues/detail?id=221#c6) that should
> give you the possibility to display an html dialog for information
> purposes or an html form to get user input data.
> There are a few limitations (no file uploads, for example), and most
> importantly it only works with Qt >= 4.4. But I think it's a big step
> towards more complex scripts. Thanks for pointing me at QtWebKit, btw.
>
> Stefan
>



More information about the texworks mailing list