docs: added old read me files

This commit is contained in:
D. Moonfire 2023-07-10 20:39:45 -05:00
parent 2d7de86856
commit 08e8fe3a24
6 changed files with 184 additions and 0 deletions

View file

@ -0,0 +1,4 @@
# MfGames.Gallium for C#
A small Entity-Component-System (ECS) that is built around LINQ calls and `IEnumerable<Entity>` objects.

102
src/MfGames.IO/README.md Normal file
View file

@ -0,0 +1,102 @@
# MfGames.IO CIL
This a small collection of classes and extensions to make working with System.IO a little bit easier.
## Installation
At the moment, this library is not on [NuGet.org](https://nuget.org/). Instead,
it is hosted at [MyGet](https://www.myget.org/feed/Packages/mfgames).
```
dotnet add package MfGames.IO --source https://www.myget.org/F/mfgames/api/v3/index.json
```
The repository can also be added to a project by setting the `NuGet.Config` file.
```
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="mfgames" value="https://www.myget.org/F/mfgames/api/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
```
## Extensions
### Assembly Extensions
#### `DirectoryInfo? GetDirectory(this Assembly? assembly)`
Gets a directory containing the assembly directory.
#### `FileInfo? GetFile(this Assembly? assembly)`
Gets a file representing the assembly's `Location` property or null.
### DirectoryInfo Extensions
#### `DirectoryInfo? CreateIfMissing(this DirectoryInfo? directory)`
Creates `directory` if it doesn't exist and `directory` is not null. This will
also create any parent directories to duplicate the `mkdir -p directory`
functionality that inspired it.
#### `DirectoryInfo? FindGitRoot(this DirectoryInfo?)`
Finds the Git root from the given directory, using `FindSelfOrParent`.
#### `DirectoryInfo? FindParent(this DirectoryInfo?, Func<DirectoryInfo, bool> match)`
Finds a parent directory that returns true from the given `match`. This does not
check the given `directory`, but only parents. If none are found, this returns
null.
#### `DirectoryInfo? FindSelfOrParent(this DirectoryInfo?, Func<DirectoryInfo, bool> match)`
Finds a parent directory that returns true from the given `match`. This checks
the given `directory` before going to parents. If none are found, this returns
null.
#### `DirectoryInfo GetDirectory(this DirectoryInfo directory, string[] paths)`
The equivalent of `new DirectoryInfo(Path.Combine(directory.FullName, ...paths))`.
#### `FileInfo GetFile(this DirectoryInfo directory, string[] paths)`
The equivalent of `new FileInfo(Path.Combine(directory.FullName, ...paths))`.
#### `bool IsGitRoot(this DirectoryInfo? directory)`
Returns `true` if the given directory is non-null and contains the `.git` folder.
Otherwise, returns false.
### FileInfo Extensions
#### `string ReadAllText(this FileInfo file)`
The same as `File.ReadAllText(file.GetFullPath)`.
#### `string ReadAllText(this FileInfo file, Encoding encoding)`
The same as `File.ReadAllText(file.GetFullPath, encoding)`.
#### `void WriteAllText(this FileInfo file, string text)`
The same as `File.WriteAllText(file.GetFullPath, text)`.
#### `void WriteAllText(this FileInfo file, string text, Encoding encoding)`
The same as `File.WriteAllText(file.GetFullPath, text, encoding)`.
### Type Extensions
#### `DirectoryInfo? GetDirectory(this Type? type)`
Gets a directory containing the type's assembly directory.
#### `FileInfo? GetFile(this Type? type)`
Gets a file representing the type's assembly's `Location` property or null.

View file

@ -0,0 +1,15 @@
MfGames.Locking CIL
===================
This a small collection of classes that provide some simplification while working with locking in C# applications.
```
//using MfGames.Locking;
ReaderWriterLockSlim locker;
using (new ReadLock(locker))
{
// Do something.
}
```

View file

@ -0,0 +1,39 @@
# MfGames.Markdown CIL
This is a set of libraries for working with Markdown in C#. Most of the code are extensions in [MarkDig](https://github.com/xoofx/markdig), an extensible library for converting Markdown.
The library includes the following:
- An extension for converting wiki links, such as `[[MfGames]]` into a link based on the title. This is for both HTML and Gemtext.
- A output library for using MarkDig to generate Gemtext for Gemini pods.
The documentation is rather light at the moment, but the tests can show various ways of using the libraries.
## Usage
These library are not on nuget.org (for various reasons). To use them, set up your NuGet.config to pull them from their repository.
```
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="mfgames.com" value="https://src.mfgames.com/api/packages/mfgames-cil/nuget/index.json" protocolVersion="3" />
</packageSources>
<packageSourceMapping>
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
<packageSource key="mfgames.com">
<package pattern="MfGames.*" />
</packageSource>
</packageSourceMapping>
</configuration>
```
The two libraries are:
- MfGames.Markdown
- MfGames.Markdown.Gemtext

View file

@ -0,0 +1,20 @@
# Nitride CIL
A static site generator written in C#.
## Entity Component System
It is build on [Gallium ECS](https://gitlab.com/mfgames-cil/gallium-cil/), an [entity-component-system](https://en.wikipedia.org/wiki/Entity_component_system) that allows for a flexibility of adding and removing aspects of individual files including creating new ones from JSON/YAML, web servers, or the file system. Additional markers and details can be added without significant changes, allowing for new concepts that weren't envisioned by the original developers.
## Configuration as Code
Because it can be difficult to explain the complexities of a website with just a collection of templates and scripts, this library uses C# for the configuration. In effect, you create a program that generates a website from source files.
## Unix Philosophy
This library is designed with the [Unix Philosophy](https://en.wikipedia.org/wiki/Unix_philosophy):
> Do one thing well.
It generates website HTML from a variety of sources (mostly Markdown). The core library doesn't try to wrangle Javascript or minify CSS. It doesn't have plugins for pushing up to S3 or copy files. Those are things [Webpack](https://webpack.js.org/), [Parcel](https://parceljs.org/), `scp`, or other tools specialize in.

View file

@ -0,0 +1,4 @@
# MfGames.TestSetup
An opininated setup for unit tests using Xunit, Autofac, and Serilog.