A tool for template-based and easy text creation.
Find a file
Dirk 2ee3877f48
Translated using Weblate (Dutch)
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/
2024-06-22 14:18:23 +00:00
doc add details to readme 2024-04-09 01:31:46 +02:00
template-text-tool Translated using Weblate (Dutch) 2024-06-22 14:18:23 +00:00
.gitignore use .gitignore to ignore user-added sets 2024-03-06 00:38:01 +01:00
Dockerfile make CMD one line 2024-03-14 23:54:33 +01:00
LICENSE.txt add licensing information 2024-03-09 23:00:33 +01:00
README.md use correct screenshot link 2024-04-09 01:32:36 +02:00

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

Unconfigured default view with only the example set available

Setup

The setup is Docker-first so any containerization solution that is compatible with Dockerfiles 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

Its 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 youre (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.