npm.io
0.1.3 • Published 6 years agoCLI

final-web

Licence
ISC
Version
0.1.3
Deps
2
Size
24 kB
Vulns
1
Weekly
0
Stars
1

Final-Web

Compile organized XML files into PHP.

Basic Example

Create a source/example.web file inside a source folder:

<page>
    <set $name="Example" />
    <settings>
        <title>{$name} Title</title>
    </settings>
    <header>{$name} Header</header>
    <paragraph>This is a paragraph with a
        <link to="page">link</link>.
    </paragraph>
</page>

Install Final-Web with NPM npm install final-web -g.

Run the compiler "final source-folder destination-folder" from the parent directory of the source folder.

Final outputs the following output/example.php:

<!DOCTYPE html>
<html>
    <?php $name = "Example"; ?>
    <head>
        <title><?php print($name); ?> Title</title>
    </head>
    <body class="page">
        <h1 class="header"><?php print($name); ?> Header</h1>
        <p class="paragraph">This is a paragraph with a
            <a href="page.php" class="link">link</a>.
        </p>
    </body>
</html>

Which renders in the browser:

Example Title

This is a paragraph with a link.