Lib.InGameWiki
1.5.0
See the version list below for details.
dotnet add package Lib.InGameWiki --version 1.5.0
NuGet\Install-Package Lib.InGameWiki -Version 1.5.0
<PackageReference Include="Lib.InGameWiki" Version="1.5.0" />
paket add Lib.InGameWiki --version 1.5.0
#r "nuget: Lib.InGameWiki, 1.5.0"
// Install Lib.InGameWiki as a Cake Addin #addin nuget:?package=Lib.InGameWiki&version=1.5.0 // Install Lib.InGameWiki as a Cake Tool #tool nuget:?package=Lib.InGameWiki&version=1.5.0
How to install
- Open your mod project in visual studio.
- Right click on References>Manage NuGet Packages
- Inside the package manager window, click Browse and search for 'Lib.InGameWiki'.
- Select the package (author: Epicguru) and select Install.
- Package should now be installed. Under references, click on InGameWiki and find the properties tab.
How to add basic auto-generated wiki
- Create a new C# file in your project called
Wiki.cs
- Put this code in the file:
using InGameWiki;
using Verse;
namespace YourModNamespace
{
[StaticConstructorOnStartup]
internal static class Wiki
{
static Wiki()
{
// Get a reference to your mod instance.
Mod myMod = MyModClass.Instance;
// Create and register a new wiki.
var wiki = ModWiki.Create(myMod);
// Check if wiki creation was successful. If not, exit from the method.
if(wiki == null)
return;
// Change some wiki properties.
wiki.WikiTitle = "MyMod: My wiki";
}
}
}
- Edit the code to work with your mod; change namespace, get a reference to your mod class, change wiki title etc.
Note: If you are confused as how to get the reference to your mod class, see this example file for an example mod class. If you are familiar with C# modding, you probably already have one.
How to add custom pages
In your mod folder, next to the Textures, Assemblies, About folders, create a new folder called Wiki
.
Inside this folder, you can add custom pages.
Click here to see how to create custom pages.
You can also add custom content to auto-generated item pages. For example, add images and text to the page that was generated for a gun added by your mod.
Click here to see how to add content to existing auto-generated pages.
How to exclude certain defs
The wiki mod takes all of the defs added by your mod and discards certain ones, such as Motes, Projectiles, Blueprints etc. However, sometimes you want to tell the mod to ignore a specific def. This could be either to hide content from the player, or just because it gives no useful information.
Suppose that you want to remove the generated page for a def called MyBoringDef
. The steps are as follows:
- Go into your
Wiki
folder. See here for more info on folder structure. - Create a new file called
Exclude.txt
. Spelling is imporant! - Open the txt file.
- Type the name(s) of the def that you want to exclude, such as
MyBoringDef
. One def name per line. - Save the file.
Inside the Excluded.txt
file, blank lines are ignored. You can also type comments by starting the line with // such as // I am a comment
.
Example mod
This wiki mod was initially created for my mod Antimatter Annihilation:
Link to Antimatter Annihilation repository
There you will find all the wiki files, folder structures and every source file required to make a fully funcional wiki.
WIP documentation.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
-
.NETFramework 4.7.2
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Wiki API updated to allow mods to have only optional support of the wiki.