Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/macdoc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremie Laval <jeremie.laval@gmail.com>2013-01-25 19:27:11 +0400
committerJeremie Laval <jeremie.laval@gmail.com>2013-01-25 19:30:28 +0400
commitcd448231ab20fe8098efdf738afa472883a0922c (patch)
tree13d0c8f75455a8e4baaceb784e343966a806930f
parentc2b6b52979c46735bc8749c0dd8febafe16301fd (diff)
[macdoc] Update to new monodoc
-rw-r--r--AppDelegate.cs9
-rw-r--r--DocTools.cs27
-rw-r--r--MonodocDataSources.cs4
-rw-r--r--MyDocument.cs2
-rwxr-xr-xlib/monodoc.dllbin1150976 -> 1097216 bytes
-rw-r--r--lib/monodoc.dll.config10
-rw-r--r--lib/monodoc.dll.mdbbin437631 -> 436534 bytes
7 files changed, 27 insertions, 25 deletions
diff --git a/AppDelegate.cs b/AppDelegate.cs
index a45c68c..be81626 100644
--- a/AppDelegate.cs
+++ b/AppDelegate.cs
@@ -87,9 +87,9 @@ namespace macdoc
if (extraUncompiledDocs != null)
foreach (var dir in extraUncompiledDocs)
- RootTree.UncompiledHelpSources.Add (dir);
+ RootTree.AddUncompiledSource (dir);
- Root = RootTree.LoadTree (null);
+ Root = RootTree.LoadTree ();
if (extraDocs != null)
foreach (var dir in extraDocs)
@@ -107,11 +107,6 @@ namespace macdoc
macDocPath);
BookmarkManager = new BookmarkManager (macDocPath);
AppleDocHandler = new AppleDocHandler ("/Library/Frameworks/Mono.framework/Versions/Current/etc/");
-
- // Configure the documentation rendering.
- SettingsHandler.Settings.EnableEditing = false;
- SettingsHandler.Settings.preferred_font_size = 200;
- HelpSource.use_css = true;
}
public override void FinishedLaunching (NSObject notification)
diff --git a/DocTools.cs b/DocTools.cs
index 39521c2..32f40f6 100644
--- a/DocTools.cs
+++ b/DocTools.cs
@@ -4,11 +4,15 @@
using System;
using Monodoc;
+using Monodoc.Generators;
using System.IO;
namespace macdoc
{
- public class DocTools {
+ public class DocTools
+ {
+ static IDocGenerator<string> generator = new HtmlGenerator (null);
+
public static string GetHtml (string url, HelpSource helpSource)
{
Node _;
@@ -21,17 +25,16 @@ namespace macdoc
match = null;
if (helpSource != null)
- htmlContent = helpSource.GetText (url, out match);
- if (htmlContent == null){
+ htmlContent = AppDelegate.Root.RenderUrl (url, generator, out match, helpSource);
+ if (htmlContent == null) {
// the displayed url have a lower case type code (e.g. t: instead of T:) which confuse monodoc
if (url.Length > 2 && url[1] == ':')
url = char.ToUpperInvariant (url[0]) + url.Substring (1);
// It may also be url encoded so decode it
url = Uri.UnescapeDataString (url);
- htmlContent = AppDelegate.Root.RenderUrl (url, out match);
- if (htmlContent != null && match != null && match.tree != null){
- helpSource = match.tree.HelpSource;
- }
+ htmlContent = AppDelegate.Root.RenderUrl (url, generator, out match, helpSource);
+ if (htmlContent != null && match != null && match.Tree != null)
+ helpSource = match.Tree.HelpSource;
}
if (htmlContent == null)
return null;
@@ -39,11 +42,11 @@ namespace macdoc
var html = new StringWriter ();
html.Write ("<html>\n<head><title>{0}</title>", url);
- if (helpSource != null){
- if (helpSource.InlineCss != null)
- html.Write (" <style type=\"text/css\">{0}</style>\n", helpSource.InlineCss);
- if (helpSource.InlineJavaScript != null)
- html.Write ("<script type=\"text/JavaScript\">{0}</script>\n", helpSource.InlineJavaScript);
+ if (helpSource != null) {
+ if (HtmlGenerator.InlineCss != null)
+ html.Write (" <style type=\"text/css\">{0}</style>\n", HtmlGenerator.InlineCss);
+ /*if (helpSource.InlineJavaScript != null)
+ html.Write ("<script type=\"text/JavaScript\">{0}</script>\n", helpSource.InlineJavaScript);*/
}
html.Write ("</head><body>");
diff --git a/MonodocDataSources.cs b/MonodocDataSources.cs
index 61000a1..d3507ee 100644
--- a/MonodocDataSources.cs
+++ b/MonodocDataSources.cs
@@ -64,7 +64,7 @@ namespace macdoc
public override NSObject GetChild (NSOutlineView outlineView, int index, NSObject item)
{
WrapNode wrap;
- Node n = (Node) (item == null ? Root : (Node) GetNode (item)).Nodes [index];
+ Node n = (Node) (item == null ? Root.RootNode : (Node) GetNode (item)).Nodes [index];
if (nodeToWrapper.ContainsKey (n))
return nodeToWrapper [n];
@@ -83,7 +83,7 @@ namespace macdoc
public override int GetChildrenCount (NSOutlineView outlineView, NSObject item)
{
if (item == null)
- return Root.Nodes.Count;
+ return Root.RootNode.Nodes.Count;
return GetNode (item).Nodes.Count;
}
diff --git a/MyDocument.cs b/MyDocument.cs
index 8fe7923..21e5b88 100644
--- a/MyDocument.cs
+++ b/MyDocument.cs
@@ -538,7 +538,7 @@ namespace macdoc
return;
var node = WrapNode.FromObject (parent.outlineView.ItemAtRow ((int) indexes.FirstIndex));
- parent.LoadUrl (node.PublicUrl, false, node.tree.HelpSource);
+ parent.LoadUrl (node.PublicUrl, false, node.Tree.HelpSource);
}
}
diff --git a/lib/monodoc.dll b/lib/monodoc.dll
index 2a56595..6be48b4 100755
--- a/lib/monodoc.dll
+++ b/lib/monodoc.dll
Binary files differ
diff --git a/lib/monodoc.dll.config b/lib/monodoc.dll.config
index 856073c..25c5569 100644
--- a/lib/monodoc.dll.config
+++ b/lib/monodoc.dll.config
@@ -1,3 +1,7 @@
-<config>
- <path docsPath="/usr/local/lib/monodoc" />
-</config>
+<configuration>
+ <appSettings>
+ <add key="docPath" value="/Library/Frameworks/Mono.framework/Versions/Current/lib/monodoc/" />
+ <add key="docExternalPath" value="" />
+ <!-- <add key="cache" value="file,~/path/to/cache/directory" /> -->
+ </appSettings>
+</configuration>
diff --git a/lib/monodoc.dll.mdb b/lib/monodoc.dll.mdb
index 4da3a0b..b3042aa 100644
--- a/lib/monodoc.dll.mdb
+++ b/lib/monodoc.dll.mdb
Binary files differ