From 44cb3e2ff0a3394991480c5dc26269b8f8f8edde Mon Sep 17 00:00:00 2001 From: Andrew Miner Date: Tue, 3 Feb 2015 10:13:00 -0800 Subject: [PATCH] Created About Slugs (markdown) --- About-Slugs.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 About-Slugs.md diff --git a/About-Slugs.md b/About-Slugs.md new file mode 100644 index 0000000..8f4415c --- /dev/null +++ b/About-Slugs.md @@ -0,0 +1,8 @@ +This is a term which comes up a lot in Crafting Guide, so it's best to be clear about these up front. A slug is a version of a thing's name which has any troublesome characters removed, and which has been cleaned up for easy use in programs. These are generally created with the following steps: + +1. Replace any non-alphanumeric character with an `_` +2. Replace any duplicated `_` with a single one +3. Remove any `_` at the start or end of the slug. +4. Convert all letters to lowercase. + +In other words, you'd convert something like "Oak Wood Planks" to "oak_wood_planks" or "(Empty) Fuel Can" to "empty_fuel_can". \ No newline at end of file