public JavaHelpGenerator(string mainSourceFile, ChmDocument document, UserInterface ui, ChmProject project, HtmlPageDecorator decorator) : base(document, ui, project, decorator) { JavaHelpDirectoryGeneration = Path.Combine(Path.GetTempPath(), Path.GetFileNameWithoutExtension(mainSourceFile)) + "-javahelp"; }
protected ContentDirectoryGenerator(ChmDocument document, UserInterface ui, ChmProject project, HtmlPageDecorator decorator) { this.Document = document; this.UI = ui; this.Project = project; this.Decorator = decorator; }
public ChmGenerator(ChmDocument document, UserInterface ui, ChmProject project, List <string> additionalFiles, HtmlPageDecorator decorator) : base(document, ui, project, decorator) { this.Document = document; this.UI = ui; this.Project = project; this.AdditionalFiles = additionalFiles; // Get the encoding and culture for the chm: this.HelpWorkshopCulture = project.GetChmCulture(UI); this.Encoding = ChmProject.GetChmEncoding(UI, this.HelpWorkshopCulture); }
/// <summary> /// Saves the splitted content of this node into a file, if it has any. /// </summary> /// <param name="document">Owner of this node</param> /// <param name="directoryDstPath">Directory path where the content files will be stored</param> /// <param name="decorator">Tool to generate and decorate the HTML content files</param> /// <param name="indexer">Tool to index the saved content files. It can be null, if the content /// does not need to be indexed.</param> /// <returns>The content file name saved. Is this node has no content, it returns null</returns> public string SaveContent(ChmDocument document, string directoryDstPath, HtmlPageDecorator decorator, WebIndex indexer) { if (SplittedPartBody == null) { return(null); } // Save the section, adding header, footers, etc: string filePath = Path.Combine(directoryDstPath, DestinationFileName); decorator.ProcessAndSavePage(this, document, filePath); if (indexer != null) { // Store the document at the full text search index: indexer.AddPage(DestinationFileName, Title, SplittedPartBody); } return(DestinationFileName); }
/// <summary> /// Saves the splitted content files of the document to HTML files into a directory. /// </summary> /// <param name="directoryDstPath">Directory path where the content files will be stored</param> /// <param name="decorator">Tool to generate and decorate the HTML content files</param> /// <param name="indexer">Tool to index the saved content files. It can be null, if the content /// does not need to be indexed.</param> /// <returns>The content file names saved</returns> public List <string> SaveContentFiles(string directoryDstPath, HtmlPageDecorator decorator, WebIndex indexer) { // Search nodes with body on the document tree List <string> savedFiles = new List <string>(); foreach (ChmDocumentNode node in RootNode.Children) { SaveContentFiles(node, savedFiles, directoryDstPath, decorator, indexer); } // Save the CSS file: if (!string.IsNullOrEmpty(EmbeddedStylesTagContent)) { string cssFilePath = Path.Combine(directoryDstPath, EMBEDDEDCSSFILENAME); StreamWriter writer = new StreamWriter(cssFilePath); writer.Write(EmbeddedStylesTagContent); writer.Close(); savedFiles.Add(EMBEDDEDCSSFILENAME); } return(savedFiles); }
public WebHelpGenerator(ChmDocument document, UserInterface ui, ChmProject project, HtmlPageDecorator decorator) : base(document, ui, project, decorator) { }
/// <summary> /// Saves the splitted content files of the document to HTML files into a directory. /// </summary> /// <param name="node">Current node on the recursive search</param> /// <param name="savedFiles">The content file names saved</param> /// <param name="directoryDstPath">Directory path where the content files will be stored</param> /// <param name="decorator">Tool to generate and decorate the HTML content files</param> /// <param name="indexer">Tool to index the saved content files. It can be null, if the content /// does not need to be indexed.</param> private void SaveContentFiles(ChmDocumentNode node, List <string> savedFiles, string directoryDstPath, HtmlPageDecorator decorator, WebIndex indexer) { string fileName = node.SaveContent(this, directoryDstPath, decorator, indexer); if (fileName != null) { savedFiles.Add(fileName); } foreach (ChmDocumentNode child in node.Children) { SaveContentFiles(child, savedFiles, directoryDstPath, decorator, indexer); } }