Moved second README and change log from source to /doc

This commit is contained in:
Tony Bark 2023-08-10 22:41:12 -04:00
parent df5ebd3954
commit 6bc99bb7cc
6 changed files with 43 additions and 73 deletions

39
doc/README.md Normal file
View file

@ -0,0 +1,39 @@
# CST.NET
Caret-Separated Text (or CST) is a key-value pair format represented by digits or words as keys and the value as text enclosed between carets. (e.g. ``<key> ^<text>^``) Any text which is not enclosed with carets is considered a comment and ignored. Neither strings nor comments may use the caret character. CST.NET is a library for parsing the CST format.
## Usage
### Basic Parsing
If you want to create your own internal CST parsing framework, you can use the `CST` or `CaretSeparatedText` class directly.
```text
1 ^The quick brown fox jumps over the lazy dog.^
```
```csharp
#r "nuget:CSTNet,2.0.103"
using CSTNet;
var file = File.ReadAllText("example.cst");
var example = CST.Parse(file, 1);
// "The quick brown fox jumps over the lazy dog."
Console.WriteLine(example);
```
### In Production
```csharp
#r "nuget:CSTNet,2.0.103"
using CSTNet;
var english = new UIText(); // UIText assumes English
var swedish = new UIText("swedish");
var engExample = english.GetText(152, 1); // english.dir/_154_miscstrings.cst
var sweExample = swedish.GetText(152, 1); // swedish.dir/_154_miscstrings.cst
Console.WriteLine(engExample);
Console.WriteLine(sweExample);
```

52
doc/changelog.md Normal file
View file

@ -0,0 +1,52 @@
# Change Log
## 2.0.102
- Properly commented and documented the rest of the code.
## 2.0.100
This version supports both .NET Standard 2.1 and .NET 6 and brings with it (much needed) quality of life changes internally. Apart from that, nothing has changed to the API itself apart from much needed documentation.
### UIText class and interface
Based on FreeSO's API, the ``UIText`` class allows for traversing in ``/<directory>/<language>.dir`` directories and searching CST files by their Id number. (e.g. _*154*_miscstrings.cst). By defualt, the base path is ``/<program directory>/uitext/<language>.dir``. You may also create your own implementation based on these APIs using the ``IUIText`` interface which mine also uses.
For more info, see [usage.md](./usage.md).
### New Release Cycle
Because this library has no third-party dependencies, CST.NET's release cycle will generally follow .NET's LTS cycle. This is why .NET 5 was skipped. Minor releases will consist of targeting latest LTS.
For example, 2.5 adds .NET 8.0 next to 6.0 until the latter reaches end of life and finally 2.6 targets only 8.0. Keep in mind, this is all just hypothetical. Realistically, this could happen as soon as 2.2 because parameters will land as earlier as 2.1.
## 1.0.300
- Minor patch.
## 1.0.3
- Backport switch to CSTNet namespace
- Internal improvements.
## 1.0.2
- Fixed the multiple line parsing in the v2 format.
- Replaced "``[ENTRY NOT FOUND]``" message with "``***MISSING***``".
## 1.0.1
Despite only being a patch release, this includes a major refinement to the normalizing algorithm.
### Rewrote normalizing algorithm
The normalizing algorithm has been rewritten to be more efficient and hopefully more reliable. The new algorithm de-constructs each line after converting it to the system's native line ending. Then it searches for the key and returns value. The rewrite also normalizes line endings to match the system's within the entry itself before returning the final output. This should make things more stable and predictable.
### Known issues
- Skipping comments is still a little buggy.
- Multiline parsing with the v2 format is still a little unpredictable.
## 1.0.0
- Initial release.