Formatting Paths
This page will go over how to format folder/file paths in Reyveld.
Making folder paths for different platforms at once can be tricky, so Reyveld tries to make paths easier for developers by having a few path formatting features to make sure your logic works on every platform.
Formatting
Rule 1: Never Use Absolute Paths
Rule 2: No backslashes.
Environment Variables
Windows, Linux, and MacOS all have their own way of accessing environment variables, and if want to port Reyveld to more than just those three platforms, we need a universal way of representing variables.
So, I decided to use colons to act as our universal way of expressing variables, as it is not a valid character on most platforms.
Platform Tags
There are many cases when we may want a different path for a specific platform, however we would need to write logic to do so. Platform tags an easy alternative.
Every tag takes a unique three letter identifier to represent a specific platform, and a string right after.
You can even have different versions for each platform.
If you need a fallback on other platforms, use the any
identifier.
Example
/// 'any' must always come after every other platform.
<win>'path-to-something'<any>'path-to-something-else'
You can even have one string for multiple identifiers.
Last updated