A cli tool for converting 'tags' to regular html, php or some other format
npm install xweb-templatingconsole
npm install -g xweb-templating
`usage
You can always view the help using 'xweb --help', but I'll also give you a description of all the posible commands right here$3
You can run the following
`console
xweb
`
or
`
xweb run
`to scan the source folder (defined in the config file or using the default, 'src') and search for any .xweb file (or some other file extension defined in the config file) and convert it to the desired output.
$3
This is a command to setup a basic xweb project.
It asks you for your preferences and sets up the rest automaticly.
`console
xweb init
`
If you add the --yes or simply -y flag to the end it will not prompt you, but just use the defaults
`console
xweb init --yes
`$3
This command checks wich tagsets are inside the tagsets folder (also defined in config file) and compares them with the list defined in the config file.
If it notices there is a tagset defined inside the config file that is not inside the tagset folder it will attempt to fetch it from this repo
`console
xweb install
`$3
This command is similar to the install command, but doesn't compare the list defined in the config file against the tagsets folder.
Instead it fetches all tagsets defined in the config and adds them to the tagsets folder or overwrites them
`console
xweb update
`$3
This command adds a tagset to the config and also fetches it
`console
xweb add my-package
`
or
`console
xweb add my-package other-package
`remove
This command does the opposite from the add command, because it removes a tagset from the config and also deletes it's file from the tagset folder
`console
xweb remove my-package
`
or
`console
xweb remove my-package other-package
`writing stuff using xweb
There are 3 important things in xweb at the moment: tags, inline xweb and ignoring tags and inline xweb$3
A 'tag' is kindof like calling a function.
Every tag starts with a '@' symbol followed by it's name and (optionally) it's arguments inside '(' and ')' and seperated by a ','
Say you have a greet tag which shows a welcome message and a day of the week.
You could write the following 'tag' (if there would be a tagset with the definition for 'greet')
`
...some html
@greet("username12", "monday")
...some html
`
This could be converted to
`
...some html
Welcome, @username12
Today it is monday
...some html
`$3
Inline xweb was primarely made for usage with php.
This allows you to use '{{' and '}}' instead of '=' and '?>'.
This can be customized in the config file.
Here is an example (with php) when you want to show a list of usernames`
@foreach($users as $user)
username: {{ $user->name }}
@end
`is converted to
`
username: = $user->name ?>
`$3
If you want to show a '@' character you'll have to do some extra work, because it is recognised as a tag start by default.
If you put a '\' directly before the '@' it will be ignored and will therefor will remain a '@' symbol.
If you still want to show the '\@' combination you have to write it like '\\\@', because the first '\' ignores the second '\' and the third '\' ignores the '@' symbol
This also works with inline xweb. Here is an example:`
User \@user12
Here is some ignored inline xweb \{{ content }}
Some weird combination \\\@
`This example is converted to
`
User @user12
Here is some ignored inline xweb {{ content }}
Some weird combinatin \@
``