Luna updated for third-party TNS document generation

I’m pleased to announce the availability of Luna v0.2!

This version adds support for arbitrary TI-Nspire “problems” conversion from XML format to TI-Nspire TNS documents compatible with OS 3.0.2 and above. This could not easily be done on the latest OS versions before, because TI took the sad decision to protect its OS from interoperability with third-party user tools.

Suppose you now want to build a computer tool that generates TI-Nspire documents with Notepad widgets.

1) Build the problem template: on nspire_emu, create a new document with a Notepad widget (“Add notes”). Put a debugger breakpoint to export the document in XML form, before it is compressed and encrypted: on a non-CAS OS 3.0.1, you would use something like:
k 10032AA0 +x
[save the document here]
w problem.xml r1 400
[repeat if the problem is bigger than 1024 bytes to get each problem chunk]

Some alternative methods such as copying from TI-Nspire Software and exporting the content with Levak’s clipboard dumper may also be used instead, or as adriweb suggests for Mac users the “Clipboard Viewer” available with XCode in /developer/Applications/Utilities/.

You will get an XML document that looks like (the Notepad only contains a “Hello world” here, the TI-Nspire XML format is indeed quite verbose):

<?xml version="1.0" encoding="UTF-8" ?>
<prob xmlns="urn:TI.Problem" ver="1.0" pbname="">
<sym></sym><card clay="0" h1="10000" h2="10000" w1="10000" w2="10000"><isDummyCard>0</isDummyCard><flag>0</flag>
<wdgt xmlns:np="urn:TI.Notepad" type="TI.Notepad" ver="2.0"><np:mFlags>1024</np:mFlags><np:value>3</np:value>
<np:fmtxt>&lt;r2dtotree&gt;&lt;node name=&quot;1doc&quot;&gt;&lt;node name=&quot;1para&quot;&gt;&lt;node name=&quot;1rtline&quot;&gt;&lt;leaf name=&quot;1word&quot;&gt;hello &lt;/leaf&gt;&lt;leaf name=&quot;1word&quot;&gt;world&lt;cursor index=&quot;0&quot;/&gt;&lt;/leaf&gt;&lt;/node&gt;&lt;/node&gt;&lt;/node&gt;&lt;/r2dtotree&gt;</np:fmtxt></wdgt></card></prob>

2) Write your problem generator based on this template

3) Integrate Luna with your generator:
luna problem.xml outdoc.tns

Quite easy, isn’t it? :)

[update 2011/09/21] Levak tells me his Make3D program which features a Lua plugin system can now be built with Luna and its XML converter for compatibility with OS 3.0.2 and later! Minor encoding issues had to be worked around, we’re looking further into them.

9 thoughts on “Luna updated for third-party TNS document generation

  1. * For Ndless 3, it’s likely that no details, especially technical details, are going to be published before the release. Just like it happened for Ndless 1.0, Nleash, Ndless 1.7/2.0, with good reason (TI is still actively trying to lock down).

    * TI’s crippled implementation of Lua, in the calculator or computer software, cannot read or write files. Therefore, no Luna in TI Lua.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s