files.Select (f =>
Path.Combine (Path.GetDirectoryName (f), Path.GetFileNameWithoutExtension (f)))
.Distinct ()) {
- Console.WriteLine ("# Processing BasePath={0}", basePath);
string treeFile = basePath + ".tree";
string zipFile = basePath + ".zip";
if (!Exists (treeFile) || !Exists (zipFile))
if (!forceUpdate && Directory.Exists (outDir) &&
MaxWriteTime (treeFile, zipFile) < Directory.GetLastWriteTime (outDir))
continue;
+ Message (TraceLevel.Warning, "Processing files: {0}, {1}", treeFile, zipFile);
Directory.CreateDirectory (outDir);
ExtractZipFile (zipFile, outDir);
GenerateCache (basePath, treeFile, outDir);
ZipEntry entry;
while ((entry = zip.GetNextEntry ()) != null) {
string file = Path.Combine (outDir, entry.Name);
- Console.WriteLine ("# Extracting zip entry: {0}; to: {1}", entry.Name, file);
Directory.CreateDirectory (Path.GetDirectoryName (file));
using (var output = File.OpenWrite (file))
zip.WriteTo (output);
void GenerateCache (string basePath, string treeFile, string outDir)
{
- Console.WriteLine ("# Tree file={0}", treeFile);
Tree tree = new Tree (null, treeFile);
RootTree docRoot = RootTree.LoadTree ();
string helpSourceName = Path.GetFileName (basePath);
}
foreach (Node node in tree.TraverseDepthFirst<Node, Node> (t => t, t => t.Nodes.Cast<Node> ())) {
var url = node.URL;
- Console.WriteLine ("# NodeUrl={0}", url);
+ Message (TraceLevel.Info, "\tProcessing URL: {0}", url);
if (string.IsNullOrEmpty (url))
continue;
var file = XmlDocUtils.GetCachedFileName (outDir, url);
- Console.WriteLine ("# file={0}", file);
using (var o = File.AppendText (file)) {
Node _;
// Sometimes the HelpSource won't directly support a url.