Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[mdoc] Use monodoc improved API

  • Loading branch information...
commit 44b2b4a82cbe48853e87f52903326b54ae3eb7b3 1 parent 483cd5e
@garuma garuma authored
View
7 mcs/tools/mdoc/Mono.Documentation/assembler.cs
@@ -11,6 +11,7 @@
using System.Linq;
using System.Xml;
using Monodoc;
+using Monodoc.Providers;
using Mono.Options;
namespace Mono.Documentation {
@@ -90,10 +91,6 @@ public override void Run (IEnumerable<string> args)
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 override void Run (IEnumerable<string> args)
}
if (sort && hs.Tree != null)
- hs.Tree.Sort ();
+ hs.Tree.RootNode.Sort ();
//
// Flushes the EcmaProvider
View
2  mcs/tools/mdoc/Mono.Documentation/dump.cs
@@ -40,7 +40,7 @@ public override void Run (IEnumerable<string> args)
? null
: RootTree.GetHelpSource (format, file.Replace (".tree", ""));
Tree t = new Tree (hs, file);
- Node.PrintTree (t);
+ TreeDumper.PrintTree (t.RootNode);
}
}
}
View
6 mcs/tools/mdoc/Mono.Documentation/index.cs
@@ -54,13 +54,13 @@ public override void Run (IEnumerable<string> args)
foreach (var action in extra) {
switch (action) {
case "tree":
- RootTree.MakeIndex (root);
+ root.GenerateIndex ();
break;
case "search":
- RootTree.MakeSearchIndex (root);
+ root.GenerateSearchIndex ();
break;
}
}
}
}
-}
+}
View
6 mcs/tools/mdoc/Mono.Documentation/monodocs2slashdoc.cs
@@ -119,10 +119,12 @@ private static void Process (string basepath, Dictionary<string, XmlElement> out
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);
}
}
View
12 mcs/tools/mdoc/Mono.Documentation/webdoc.cs
@@ -36,6 +36,8 @@
using System.Xml.Linq;
using Monodoc;
+using Monodoc.Generators;
+using Monodoc.Caches;
using Mono.Documentation;
using Mono.Options;
@@ -92,9 +94,6 @@ public override void Run (IEnumerable<string> args)
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 @@ void GenerateCache (Options opts, string basePath, string format, string outDir)
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);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.