Changeset 8594


Ignore:
Timestamp:
Feb 4, 2020, 9:01:38 AM (2 years ago)
Author:
Sven Rech
Message:

Online Help Generation: Fixed relative path of template icons.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/OnlineDocumentationGenerator/Generators/HtmlGenerator/HtmlGenerator.cs

    r8398 r8594  
    150150                    var locTemplate = templateDocumentationPage.CurrentLocalization;
    151151                    var description = _objectConverter.Convert(locTemplate.SummaryOrDescription, templateDocumentationPage);
    152                     description = description.Replace("../", ""); //correct relative paths in images               
    153                     stringBuilder.AppendLine(string.Format("<tr class=\"filterable\"><td>&nbsp;</td><td><div class=\"boximage\"><img src=\"{0}\"></div></td><td><a href=\"{1}\">{2}</a></td><td>{3}</td></tr>",
    154                         templateDocumentationPage.Icon, locTemplate.FilePath, locTemplate.Name, description));
     152                    description = description.Replace("../", ""); //correct relative paths in images
     153                    var iconPath = Path.Combine(templateDocumentationPage.DocDirPath, $"{templateDocumentationPage.Name}.png");
     154                    stringBuilder.AppendLine(string.Format("<tr class=\"filterable\"><td>&nbsp;</td><td><div class=\"boximage\"><img src=\"{0}\"></div></td><td><a href=\"{1}\">{2}</a></td><td>{3}</td></tr>",
     155                        iconPath, locTemplate.FilePath, locTemplate.Name, description));
    155156                }
    156157            }
     
    209210                    var description = _objectConverter.Convert(locTemplate.SummaryOrDescription, templateDocumentationPage);
    210211                    var spaces = String.Join("", Enumerable.Range(0, categories.Count - 1).Select(x => "&nbsp;&nbsp;"));
    211                     description = description.Replace("../", ""); //correct relative paths in images               
    212                     stringBuilder.AppendLine(string.Format("<tr><td>{0}</td><td><div class=\"boximage\"><img src=\"{1}\"></div></td><td><a href=\"{2}\">{3}</a></td><td>{4}</td></tr>", spaces, templateDocumentationPage.Icon, locTemplate.FilePath, locTemplate.Name, description));
     212                    description = description.Replace("../", ""); //correct relative paths in images
     213                    var iconPath = Path.Combine(templateDocumentationPage.DocDirPath, $"{templateDocumentationPage.Name}.png");
     214                    stringBuilder.AppendLine(
     215                        string.Format("<tr><td>{0}</td><td><div class=\"boximage\"><img src=\"{1}\"></div></td><td><a href=\"{2}\">{3}</a></td><td>{4}</td></tr>",
     216                        spaces, iconPath, locTemplate.FilePath, locTemplate.Name, description));
    213217                }
    214218
Note: See TracChangeset for help on using the changeset viewer.