/ README.md
README.md
1 # <img src="./assets/logo.svg" alt="The logo of Babel: an icon of the Tower of Babel in a turquoise square" width="48px" /> <span style="font-variant: small-caps; color: #239dad">Babel</span>: Redact text by replacing it with random characters in Typst 2 3 [](https://typst.app/universe/package/babel) 4 [](https://codeberg.org/afiaith/babel) 5 [](./docs/manual.pdf) 6 [](./LICENSE) 7 [](https://codeberg.org/afiaith/babel/releases/) 8 [](https://codeberg.org/afiaith/babel/stars) 9 10 This package provides functions that replace actual text with random characters, which is useful for redacting confidential information or sharing the design and structure of an existing document without disclosing the content itself. 11 A variety of ready-made sets of characters for replacement are available (75 in total; termed *alphabets*), representing diverse writing systems, codes, notations and symbols. 12 Some of these are more conservative (such as emulating redaction using a wide black pen) and many are more whimsical, as demonstrated by the following example: 13 14 ```typ 15 #import "@preview/babel:0.1.1": * 16 17 #baffle(alphabet: "welsh")[Hello]. My #tippex[name] is #baffle(alphabet: "underscore")[Inigo Montoya]. You #baffle(alphabet: "alchemy")[killed] my #baffle(alphabet: "shavian")[father]. Prepare to #redact[die]. 18 19 Using show rules strings, regular expressions and other selectors can be redacted automatically: 20 21 #show "jan Maja": baffle.with(alphabet: "sitelen-pona") 22 #show regex("[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*"): baffle.with(alphabet: "maze-3") 23 24 I’m jan Maja, and my email is `foo@digitalwords.net`. 25 ``` 26 27  28 29 ## 📖 The manual 30 31 Using <span style="font-variant: small-caps; color: #239dad">Babel</span> is quite straightforward. 32 A [**comprehensive manual**](./docs/manual.pdf) covers: 33 34 - Introductory background. 35 - How to use the provided functions (`baffle()`, `redact()` and `tippex()`). 36 - A list of the provided alphabets, each demonstrated by a line of random text. 37 38 If the version of the precompiled manual doesn’t match the version of the package, it means no difference between the two versions is reflected in the manual. 39 40 ## 🗼 The Tower of <span style="font-variant: small-caps; color: #239dad">Babel</span> 41 42 A poster demonstrating the provided alphabets: 43 44 [](./assets/poster.webp) 45 46 ## 🔨 Complementary tools 47 48 If you wish to share the Typst source files of your document, not just the precompiled output, a tool called [_Typst Mutilate_](https://github.com/frozolotl/typst-mutilate) might be useful for you. 49 Unlike <span style="font-variant: small-caps; color: #239dad">Babel</span>, it is not a Typst package but an external tool, written in Rust. 50 It replaces the content of a Typst document with random words selected from a wordlist or random characters (similarly to <span style="font-variant: small-caps; color: #239dad">Babel</span>), changing the document in place (so make sure to run it on a *copy*!). 51 As a package for Typst, <span style="font-variant: small-caps; color: #239dad">Babel</span> cannot change your source files.