![]() Currently translated at 100.0% (39 of 39 strings) Translation: Template Text Tool/Web app Translate-URL: https://translate.codeberg.org/projects/template-text-tool/web-app/nl/ |
||
---|---|---|
doc | ||
template-text-tool | ||
.gitignore | ||
Dockerfile | ||
LICENSE.txt | ||
README.md |
With the Template Text Tool you can create standardized texts based on templates.
The templates are JSON files and can contain a lot of different features that are presented as various input fields and will be rendered in a copy&paste-able form. For a detailed overview on how to create sets, please refer to the sets readme file.
The web application comes with light mode and dark mode colors.
Unconfigured default view with only the example set available
Setup
The setup is Docker-first so any containerization solution that is compatible with Dockerfile
s or container container images based on that files can be used. Simply clone the repository and create the container image.
You can also directly use the created image from here. It is occasionally updated and is generally a few commits behind but always in an operational state.
The image uses the awesome Static Web Server Docker image as base.
Manual Setup
It’s generally advised to just use the Docker image or building the image yourself using the provided Dockerfile
.
If you really want to manually set up and run this web application you can easily do that. Since it is (mostly) static on server-side, just fire up whatever web server you like, place all files in a directory, and you’re (almost) good to go.
The web application uses JSON “files” in two location: For getting the translation strings and for getting the list of templates. So you need to make sure, your webserver responds with the expected data.
Translations
The web app calls /i18n/messages/
and expects a JSON string like this:
[
{ "name": "messages.XX.json", "type":"file" },
{ "name": "messages.YY.json", "type":"file" },
{ "name": "messages.ZZ.json", "type":"file" }
]
Where XX
, etc. is a short language code. The files are in the directory /i18n/messages/
.
Template sets
The web app calls /sets/
and expects the following string to be returned
[
{ "name": "set_one.json", "type": "file" },
{ "name": "second_set.json", "type": "file" },
{ "name": "and-so-on.json", "type": "file" }
]
The files are in the directory /sets/
.
Better solution
If you want to have it half automatic
you can use the following configuration for SWS and serve the ./template-text-tool/
directory of this repository.
[general]
host = "::"
port = 8000
root = "."
log-level = "info"
directory-listing = true
directory-listing-order = 0
directory-listing-format = "json"
The last three lines set up the directory listing of SWS as needed.