Skip to content

Commit b5d9f86

Browse files
committed
Adding tests, improving docs & aligning them to actual specs.
1 parent d6e865a commit b5d9f86

File tree

14 files changed

+73
-45
lines changed

14 files changed

+73
-45
lines changed

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ This preprocessor can be used in one of two ways:
5151

5252
### As a library
5353

54-
`vs.templ` is specifically intended to be embedded in other applications.
54+
_vs.templ_ is specifically intended to be embedded in other applications.
5555
You can use it either as a dynamic or a static library.
56-
If you want to integrate `vs.templ` in your own codebase, [this](./docs/for-developers.md) is where to start.
56+
If you want to integrate _vs.templ_ in your own codebase, [this](./docs/for-developers.md) is where to start.
5757

5858
### Via its CLI
5959

@@ -73,7 +73,7 @@ with both files added via pipes, like `vs.tmpl <(cat template.xml) <(cat data.xm
7373

7474
#### vs.templ.js
7575

76-
If you don't want to install `vs.templ`, it can be used standalone if you have a compatible WASM runtime on your system.
76+
If you don't want to install _vs.templ_, it can be used standalone if you have a compatible WASM runtime on your system.
7777
WASM builds are attached to releases.
7878

7979
```bash
@@ -84,16 +84,19 @@ bun run ./vs.templ.js [...]
8484

8585
```bash
8686
meson setup build
87+
#In a real world context you might want something more complex, like:
88+
#meson setup -Db_lto=true -Db_thinlto_cache=true -Db_lto_mode=thin --reconfigure build/ --buildtype=release
89+
8790
meson install -C build
8891
```
8992

9093
This works on most systems.
9194
Still, to ensure expected behaviour, I highly suggest a dry run by setting `DESTDIR` somewhere safe.
9295

93-
## Projects using `vs.templ`
96+
## Projects using _vs.templ_
9497

95-
- [vs](https://github.com/KaruroChori/vs-fltk) the parent project from which `vs.templ` derived.
96-
- [vs.http](https://github.com/lazy-eggplant/vs.http) an HTTP server built around `vs.templ`.
98+
- [vs](https://github.com/KaruroChori/vs-fltk) the parent project from which _vs.templ_ derived.
99+
- [vs.http](https://github.com/lazy-eggplant/vs.http) an HTTP server built around _vs.templ_.
97100

98101
## Why?
99102

TODO.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
- [ ] Rework the mechanisms used in `order-by` and fill missing comparisons in the RPN
66
- [ ] Extend `order-by` to support explicit types for comparison (extremely optional)
7-
- [ ] Support for string natural order (111 > 22).
8-
- [ ] In the UI for the demo, add a loader as the first boot is quite slow
9-
- [ ] Fill in the docs at least of the public interface
7+
- [x] Support for string natural order (111 > 22).
108

119
## `v0.4.5`
1210

1311
- [ ] Properly show ctx information while logging
12+
- [ ] In the UI for the demo, add a loader as the first boot is quite slow
13+
- [ ] Fill in the docs at least of the public interface
1414

1515
## `v0.4.x`
1616

dist/wasm-demo/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Just the wasm demo for `vs.templ`.
1+
Just the wasm demo for _vs.templ_.
22
Examples and `vs.templ.js` must be copied as part of the CI before building it.

docs/faq.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ While the XML ecosystem is often reliant on XSLT as a preprocessor, this option
1212
- The scope of XSLT, even in its very first version was excessive & its syntax just verbose. This is mostly a result of `xpath` being too powerful of a tool.
1313
- At some point `vs` will come with dynamic native components, and the idea is for them to match in syntax and behaviour the extended tags introduced by this preprocessor. A custom implementation is the only way to ensure a seamless integration between the two.
1414

15-
Hence, `vs` vendors `vs.templ` its own XSLT-ish preprocessor.
15+
Hence, `vs` vendors _vs.templ_ its own XSLT-ish preprocessor.
1616
Still, nothing about its semantics or syntax is directly tied to `vs`, so I am distributing it as a separate package, hoping it can reach a wider adoption.
1717

1818
## Why not [handlebars](https://handlebarsjs.com/) or [mustache](https://mustache.github.io/)?
@@ -32,4 +32,4 @@ That way, there is no need to load the entire data source in memory as it would
3232

3333
In theory, it would be possible for data to be expressed in other formats (eg. JSON) as well, but at the moment this is not a supported feature and is not likely going to be in scope for quite a while.
3434
For the time being, you can offer external data sources of whatever type by implementing the optional `loadfn` downstream.
35-
This allows `vs.templ` to indirectly work with any data source you desire.
35+
This allows _vs.templ_ to indirectly work with any data source you desire.

docs/for-developers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ I might consider adding `cmake` later on to gain a wider compatibility.
2525

2626
If `pugixml` is already provided as a dependency in the main project, that will be used.
2727

28-
`vs.templ` requires you implement some features downstream to support all features.
28+
_vs.templ_ requires you implement some features downstream to support all features.
2929
If not provided, the library will still be usable, but the command tags `include` and `data` will not work as expected.
30-
The CLI in `src/app` shows everything that is needed to use `vs.templ` as a library.
30+
The CLI in `src/app` shows everything that is needed to use _vs.templ_ as a library.
3131

3232
### C bindings
3333

docs/manual.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ with both files added via pipes, like `vs.tmpl <(cat template.xml) <(cat data.xm
2626

2727
## Syntax quick reference
2828

29-
`vs.templ` uses special elements and attributes to determine the actions to be performed by the preprocessor.
29+
_vs.templ_ uses special elements and attributes to determine the actions to be performed by the preprocessor.
3030
They are scoped under the namespace `s`, or any custom defined one.
3131
This man page only covers a quick syntax reference.
3232
If you are looking for the full specs, please check the [official repository](https://github.com/KaruroChori/vs-templ).

docs/ordering.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ Nodes should not be directly compared. Doing so is not illegal, just nonsensical
2222

2323
### Nodes
2424

25-
Nodes should not be directly compared. Doing so is not illegal, just nonsensical and UB. A more precise semantic for this case might be introduced later on.
25+
Nodes should not be directly compared.
26+
Doing so is not illegal, just nonsensical and UB.
27+
A more precise semantic for this case might be introduced later on.
2628

2729
### Attributes
2830

@@ -42,8 +44,7 @@ Comparison as expected from any basic math class.
4244

4345
### Strings
4446

45-
Strings are by far the most complex to handle as multiple criteria are possible.
46-
Strings
47+
Strings are by far the most complex to handle as multiple criteria are possible.
4748

4849
#### Encoding ordering
4950

@@ -57,4 +58,4 @@ Based on the binary representation of UTF-8 encoding.
5758

5859
For symbols in the Latin alphabet this is more or less equivalent to the encoding ordering.
5960
However, different languages have totally different customary approaches, and are not often based on alphabets.
60-
Basically any criteria rooted in linguistic arguments goes in here.
61+
Basically any criteria rooted in linguistic arguments goes in here.

docs/releases/v0.3.13.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ I will be resuming work on `vs.fltk`.
1313
- `data` command has been added to introduce external data sources in the template.
1414
- `random` order support in `order-by` for `for` loops. Stable random ordering depending on a seed number.
1515
- Examples! LOTS OF EXAMPLEEES! And improved tests.
16-
- We now have the [most blazingly fast web server](https://github.com/lazy-eggplant/vs.http) based on `vs.templ` (according to source myself)!
16+
- We now have the [most blazingly fast web server](https://github.com/lazy-eggplant/vs.http) based on _vs.templ_ (according to source myself)!
1717

1818
### Bug fixes
1919

docs/releases/v0.3.15.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## v0.3.15
22

33
All done! The last `for` and `for-props` prop based commands have been completed.
4-
With this development of functionality for `vs.templ` is done.
4+
With this development of functionality for _vs.templ_ is done.
55

66
There are minor features planned for the `v0.4.x` branch, but most will be documentation, better examples, formal XML schemas and testing infrastructure.
77
Once that is done we are going straight to `v1` if there are no architectural problems being discovered in the meanwhile.

docs/releases/v0.3.7.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## v0.3.7
22

3-
This release brings many new features which further expand the capabilities of `vs.templ`:
3+
This release brings many new features which further expand the capabilities of _vs.templ_:
44

55
- [x] Introduced a more robust logging infrastructure at all levels. Now errors and warnings are better logged.
66
- [x] Introduced `log` tag

0 commit comments

Comments
 (0)