Merge pull request #8078 from Mailaender/make-all-docs

Fixed the trait documentation
This commit is contained in:
abcdefg30
2015-05-20 17:05:46 +02:00
7 changed files with 50 additions and 5 deletions

View File

@@ -321,15 +321,14 @@ dependencies: $(os-dependencies)
all-dependencies: cli-dependencies windows-dependencies osx-dependencies
version: mods/ra/mod.yaml mods/cnc/mod.yaml mods/d2k/mod.yaml mods/modchooser/mod.yaml
version: mods/ra/mod.yaml mods/cnc/mod.yaml mods/d2k/mod.yaml mods/modchooser/mod.yaml mods/all/mod.yaml
@for i in $? ; do \
awk '{sub("Version:.*$$","Version: $(VERSION)"); print $0}' $${i} > $${i}.tmp && \
mv -f $${i}.tmp $${i} ; \
done
# Documentation (d2k depends on all mod libraries)
docs: utility mods version
@mono --debug OpenRA.Utility.exe d2k --docs > DOCUMENTATION.md
@mono --debug OpenRA.Utility.exe all --docs > DOCUMENTATION.md
@mono --debug OpenRA.Utility.exe ra --lua-docs > Lua-API.md
install: install-core

View File

@@ -23,6 +23,7 @@ namespace OpenRA
public string Description;
public string Version;
public string Author;
public bool Hidden;
static Dictionary<string, ModMetadata> ValidateMods()
{

View File

@@ -34,12 +34,20 @@ namespace OpenRA.Mods.Common.UtilityCommands
var toc = new StringBuilder();
var doc = new StringBuilder();
var currentNamespace = "";
foreach (var t in Game.ModData.ObjectCreator.GetTypesImplementing<ITraitInfo>().OrderBy(t => t.Namespace))
{
if (t.ContainsGenericParameters || t.IsAbstract)
continue; // skip helpers like TraitInfo<T>
if (currentNamespace != t.Namespace)
{
currentNamespace = t.Namespace;
doc.AppendLine();
doc.AppendLine("## {0}".F(currentNamespace));
}
var traitName = t.Name.EndsWith("Info") ? t.Name.Substring(0, t.Name.Length - 4) : t.Name;
toc.AppendLine("* [{0}](#{1})".F(traitName, traitName.ToLowerInvariant()));
var traitDescLines = t.GetCustomAttributes<DescAttribute>(false).SelectMany(d => d.Lines);

View File

@@ -65,7 +65,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
};
sheetBuilder = new SheetBuilder(SheetType.BGRA);
allMods = ModMetadata.AllMods.Values.Where(m => m.Id != "modchooser")
allMods = ModMetadata.AllMods.Values.Where(m => !m.Hidden)
.OrderBy(m => m.Title)
.ToArray();

View File

@@ -162,7 +162,7 @@ elseif ($command -eq "check")
elseif ($command -eq "docs")
{
./make.ps1 version
./OpenRA.Utility.exe d2k --docs | Out-File -Encoding "UTF8" DOCUMENTATION.md
./OpenRA.Utility.exe all --docs | Out-File -Encoding "UTF8" DOCUMENTATION.md
./OpenRA.Utility.exe ra --lua-docs | Out-File -Encoding "UTF8" Lua-API.md
}
else

36
mods/all/mod.yaml Normal file
View File

@@ -0,0 +1,36 @@
Metadata:
Title: All mods
Version: {DEV_VERSION}
Author: The OpenRA Developers
Hidden: true
Description: Depending on all DLLs.
Folders:
.
Cursors:
Chrome:
Assemblies:
./mods/common/OpenRA.Mods.Common.dll
./mods/ra/OpenRA.Mods.RA.dll
./mods/d2k/OpenRA.Mods.D2k.dll
./mods/cnc/OpenRA.Mods.Cnc.dll
./mods/ts/OpenRA.Mods.TS.dll
ChromeLayout:
Notifications:
LoadScreen: BlankLoadScreen
ChromeMetrics:
Fonts:
LobbyDefaults:
SpriteFormats:
SpriteSequenceFormat: DefaultSpriteSequence

View File

@@ -2,6 +2,7 @@ Metadata:
Title: Mod Chooser
Version: {DEV_VERSION}
Author: The OpenRA Developers
Hidden: true
Folders:
.