EnglishFrenchSpanish

OnWorks favicon

templates2ada - Online in the Cloud

Run templates2ada in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command templates2ada that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


templates2ada - generate Ada sources from a templates file

SYNOPSIS


templates2ada [options]

DESCRIPTION


templates2ada parses all the template files in a directory and then generates an output
file from these, based on a template file (a default example of which is provided as
/usr/share/doc/libtemplates-parser-dev/examples/templates.tads). The latter contains in
fact two examples, depending on whether one Ada package should be generated per template,
or whether a single package should be built. In the former case, if you are using the
GNAT compiler, you should run `gnatchop' on the resulting file. Here is an example:

$ rm -f src/templates/*.ads
$ templates2ada -d resources/ -o src/templates/generated -r
$ cd src/templates; gnatchop -w -q generated
$ rm -f src/templates/generated

One of the goals of templates2ada is to ensure that you are only setting tags that
actually exist in the template (and thus prevent, as much as possibly, typos in the name
of tags); also, when combined with other tools, to help ensure that all tags needed by the
template are properly set.

templates2ada also has special knowledge about HTTP constructs and will generate Ada
constants for the HTTP parameters you might receive in return. Once more the goal is to
help avoid typos in the Ada code.

For instance, we will consider a simple template file, found in a local file
`resources/block1.thtml'. This template contains the following simple html code:

<form>
<input name="PARAM1" value="@_TAG1_@" />
<input name="PARAM2" value="@_TAG2_@" />
</form>

When you run templates2ada, the following Ada package will be generated. Note that this is
only the default output of templates2ada, which can be fully tailored to your needs.

package Templates.Block1 is
pragma Style_Checks (Off);
Template : constant string := "resources/block1.thtml";
Tag1 : constant String := "TAG1";
Tag2 : constant String := "TAG2";
package Http is
Param1 : constant String := "PARAM1";
Param2 : constant String := "PARAM2";
end Http;
end Templates.Block1;

OPTIONS


-d dir Search for template files in dir.

-h Display a summary of options.

-o file
Write the output to file.

-e ext Process all files with extension ext that are in the input directory; consider
these files as template files.

-r Recurse into subdirectories.

-t file
Use file as the output template file. The templates parser comes with an example
for such a file, /usr/share/doc/templates-parser/examples/templates.tads, that you
can adapt to your own needs.

-v Verbose mode. This will output a warning when an http parameter has a name made
only of template parser tags, since no matching entry can then be created for it in
the output file.

Use templates2ada online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    Osu!
    Osu!
    Osu! is a simple rhythm game with a well
    thought out learning curve for players
    of all skill levels. One of the great
    aspects of Osu! is that it is
    community-dr...
    Download Osu!
  • 2
    LIBPNG: PNG reference library
    LIBPNG: PNG reference library
    Reference library for supporting the
    Portable Network Graphics (PNG) format.
    Audience: Developers. Programming
    Language: C. This is an application that
    can also...
    Download LIBPNG: PNG reference library
  • 3
    Metal detector based on  RP2040
    Metal detector based on RP2040
    Based on Raspberry Pi Pico board, this
    metal detector is included in pulse
    induction metal detectors category, with
    well known advantages and disadvantages.
    RP...
    Download Metal detector based on RP2040
  • 4
    PAC Manager
    PAC Manager
    PAC is a Perl/GTK replacement for
    SecureCRT/Putty/etc (linux
    ssh/telnet/... gui)... It provides a GUI
    to configure connections: users,
    passwords, EXPECT regula...
    Download PAC Manager
  • 5
    GeoServer
    GeoServer
    GeoServer is an open-source software
    server written in Java that allows users
    to share and edit geospatial data.
    Designed for interoperability, it
    publishes da...
    Download GeoServer
  • 6
    Firefly III
    Firefly III
    A free and open-source personal finance
    manager. Firefly III features a
    double-entry bookkeeping system. You can
    quickly enter and organize your
    transactions i...
    Download Firefly III
  • More »

Linux commands

Ad