[Android Software Development] fattire:
Script Syntax (Tutorial)

SCRIPT SYNTAX​

So you want to write a Derp installation script? It's easier than you might think. Derp isn't too complicated-- it doesn't have a lot of "logic". It just follows a script and does what you tell it.

To start a script file, just get out any text editor (or XML editor) and name it something with the .derp file extension, such as:

sample.derp

Once you write up a sample script, you can load the file with Derp to see if it works.

The <derp> tag

Every script starts with the <derp> tag and ends with the </derp> tag. Within the "<derp>" tag, at least for this pre-alpha version, you need to put at least one required attribute, app_version:

<derp app_version="0.001">

</derp>

This is to identify the version of Derp that your script is for. Future versions may not support your script. You can put other attributes that might be used in the future:

<derp device_codename="mako" os="Linux Darwin" title="CM10.1-M1 for Mako" device_name="Nexus 4" device_vendor="lge" app_version="0.001" script_version=".5" author = "fattire" author_email="fattire@example.com" author_twitter="@fat__tire" license="GPLv2">

These additional tags may be required in future versions of Derp, so if you are able to supply 'em, it's recommended. They'll simply be ignored if they're not needed.

The title="CM10.1-M1 for Mako" is a general title for the script. VERY briefly explain what it does. It's not required, but recommended.

The one other important attribute, os="Linux Darwin", will be explained later. For now, just know that it is optional, but you can use it to restrict the whole script to only run only in certain operating systems.

The <section> tag

Every set of instructions should be divided into logical sections, such as the ones on the left. The section has its own required attribute, the name:

<derp app_version="0.001" os="Linux Darwin" script_version=".5">

<section name="This is the first section"></section>

</derp>

Notice the name attribute is used with a section to identify what the section is for.

There's not much more to say about sections. It's easy. Let's move on.

The <step> tag

Each Section can be made of (at least one but) an unlimited number of individual steps. And the tag for that is called <step>. Here's how it's used:

<derp app_version="0.001" script_version=".5">

<section name="This is the first section">

<step name="This is step one"></step>

<step name="This is step two"></step>

</section>

<section name="This is the second section">

<step name="This is step three"></step>

<step name="This is step four"></step>

</section>

</derp>

Notice that steps, like sections, need to have a designated name attribute so that Derp knows what to display. The step name will appear to the user at the top on the right as the centered step heading.

The <info> tag

The stuff that appears in the main info area should be wrapped in info tags.

Example:

<derp app_version="0.001" script_version=".5">

<section name="This is the first section">

<step name="This is step one">

<info>This is the text you'll see! It explains what's going on to the user. <b>I'm bolding this part because it's really important for the user to see.</b></info>

</step>

</section>

</derp>

Note: The stuff that you put between the <info> and </info> tags is...HTML!

So you can format it however you want. You can even include images from the Internet.

Here is the list of HTML tags that are recognized:

A NAME=[string]

HREF=
TARGET=[target window spec]
ADDRES... can add os="Linux Darwin" to the <derp> tag.