Created About Slugs (markdown)

This commit is contained in:
Andrew Miner
2015-02-03 10:13:00 -08:00
parent d5bb1abfc5
commit 44cb3e2ff0
+8
View File
@@ -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".