mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 11:21:08 -10:00
[mdoc] Use monodoc improved API
This commit is contained in:
1 parent
483cd5ea50
commit
44b2b4a82c
5 files changed
+16
-17
No files matched your search
@@ -11,6 +11,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml;
|
||||
using Monodoc;
|
||||
using Monodoc.Providers;
|
||||
using Mono.Options;
|
||||
|
||||
namespace Mono.Documentation {
|
||||
@@ -90,10 +91,6 @@ public class MDocAssembler : MDocCommand {
|
||||
list.Add (new ManProvider (formats [format].ToArray ()));
|
||||
break;
|
||||
|
||||
case "simple":
|
||||
list.AddRange (formats [format].Select (d => (Provider) new SimpleProvider (d)));
|
||||
break;
|
||||
|
||||
case "error":
|
||||
list.AddRange (formats [format].Select (d => (Provider) new ErrorProvider (d)));
|
||||
break;
|
||||
@@ -116,7 +113,7 @@ public class MDocAssembler : MDocCommand {
|
||||
}
|
||||
|
||||
if (sort && hs.Tree != null)
|
||||
hs.Tree.Sort ();
|
||||
hs.Tree.RootNode.Sort ();
|
||||
|
||||
//
|
||||
// Flushes the EcmaProvider
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace Mono.Documentation {
|
||||
? null
|
||||
: RootTree.GetHelpSource (format, file.Replace (".tree", ""));
|
||||
Tree t = new Tree (hs, file);
|
||||
Node.PrintTree (t);
|
||||
TreeDumper.PrintTree (t.RootNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,13 +54,13 @@ namespace Mono.Documentation {
|
||||
foreach (var action in extra) {
|
||||
switch (action) {
|
||||
case "tree":
|
||||
RootTree.MakeIndex (root);
|
||||
root.GenerateIndex ();
|
||||
break;
|
||||
case "search":
|
||||
RootTree.MakeSearchIndex (root);
|
||||
root.GenerateSearchIndex ();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -119,10 +119,12 @@ public class MDocToMSXDocConverter : MDocCommand {
|
||||
XmlElement members = outputfiles [assemblyname];
|
||||
if (members == null) continue; // assembly is strangely not listed in the index
|
||||
|
||||
CreateMember(EcmaDoc.GetCref (type.DocumentElement), type.DocumentElement, members);
|
||||
//CreateMember(EcmaDoc.GetCref (type.DocumentElement), type.DocumentElement, members);
|
||||
|
||||
foreach (XmlElement memberdoc in type.SelectNodes("Type/Members/Member")) {
|
||||
string name = EcmaDoc.GetCref (memberdoc);
|
||||
//string name = EcmaDoc.GetCref (memberdoc);
|
||||
// FIXME
|
||||
string name = ns + "." + typename + "." + memberdoc.GetAttribute ("MemberName");
|
||||
CreateMember(name, memberdoc, members);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,8 @@ using System.Web;
|
||||
using System.Xml.Linq;
|
||||
|
||||
using Monodoc;
|
||||
using Monodoc.Generators;
|
||||
using Monodoc.Caches;
|
||||
using Mono.Documentation;
|
||||
|
||||
using Mono.Options;
|
||||
@@ -92,9 +94,6 @@ namespace Mono.Documentation
|
||||
if (opts.Formats.Values.All (files => files.Count == 0))
|
||||
Error ("No files specified.");
|
||||
ProcessSources (opts);
|
||||
HelpSource.use_css = true;
|
||||
HelpSource.FullHtml = false;
|
||||
SettingsHandler.Settings.EnableEditing = false;
|
||||
foreach (var p in opts.Formats)
|
||||
ProcessFiles (opts, p.Key, p.Value);
|
||||
}
|
||||
@@ -196,15 +195,16 @@ namespace Mono.Documentation
|
||||
docRoot.AddSourceFile (source);
|
||||
}
|
||||
hs.RootTree = docRoot;
|
||||
foreach (Node node in tree.TraverseDepthFirst<Node, Node> (t => t, t => t.Nodes.Cast<Node> ())) {
|
||||
var url = node.URL;
|
||||
var generator = new HtmlGenerator (new NullCache ());
|
||||
foreach (Node node in tree.RootNode.TraverseDepthFirst<Node, Node> (t => t, t => t.Nodes)) {
|
||||
var url = node.PublicUrl;
|
||||
Message (TraceLevel.Info, "\tProcessing URL: {0}", url);
|
||||
if (string.IsNullOrEmpty (url))
|
||||
continue;
|
||||
var file = XmlDocUtils.GetCachedFileName (outDir, url);
|
||||
using (var o = File.AppendText (file)) {
|
||||
Node _;
|
||||
string contents = hs.GetText (url, out _) ?? hs.RenderNamespaceLookup (url, out _);
|
||||
string contents = docRoot.RenderUrl (url, generator, out _);
|
||||
o.Write (contents);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user