From 251a1962776c606822a5a9baded2ca3757357b2c Mon Sep 17 00:00:00 2001 From: "Breno A." Date: Thu, 9 May 2024 03:32:38 -0300 Subject: [PATCH] tests: base prp file --- example/readme.prp.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 example/readme.prp.md diff --git a/example/readme.prp.md b/example/readme.prp.md new file mode 100644 index 0000000..1f47352 --- /dev/null +++ b/example/readme.prp.md @@ -0,0 +1,37 @@ +## Tutorial + +This action allows you to replace variables in a text file. The variables are defined in a map and can be used in the +text file with the following syntax: `{_ variable _}`. Spaces are allowed around the variable name. + +### Example + +Here's an example of how to use: + +```typescript +import { processFiles } from 'library'; + +const variables = new Map(); +variables.set('EXAMPLE', 'World'); +variables.set('what', 'Hello'); + +processFiles({ + files: ['readme.prp.md'], + variables: variables, + encodings: 'utf8', + extension: '.prp.md' +}); +``` + +### Greetings + +{_ what _}, {_ EXAMPLE _}! {_what _} {_ EXAMPLE_}{_what_} + +### Complex Variables + +This section includes variables with more complex names to test the robustness of the regular expression in +the `replaceVariables` function. + +{_ variable with spaces _} +{_ variable_with_underscores _} +{_ variable-with-dashes _} +{_ variable.with.dots _} \ No newline at end of file