diff --git a/Documentation/Synergy.Documentation.Tests/Architecture/Public/Api.of.Synergy.Documentation.verified.md b/Documentation/Synergy.Documentation.Tests/Architecture/Public/Api.of.Synergy.Documentation.verified.md index 91db78d..a2a64e6 100644 --- a/Documentation/Synergy.Documentation.Tests/Architecture/Public/Api.of.Synergy.Documentation.verified.md +++ b/Documentation/Synergy.Documentation.Tests/Architecture/Public/Api.of.Synergy.Documentation.verified.md @@ -181,3 +181,13 @@ ) : void - ToString() : string +## Markup.Markdown+Image (class) : Markdown+IElement + - ctor( + filePath: CodeFile, + alternateText: string? [Nullable, Optional] + ) + - RelativeTo( + file: CodeFile + ) : Markdown+Image + - ToString() : string + diff --git a/Documentation/Synergy.Documentation/Markup/Markdown.cs b/Documentation/Synergy.Documentation/Markup/Markdown.cs index 5ddc8a5..f251573 100644 --- a/Documentation/Synergy.Documentation/Markup/Markdown.cs +++ b/Documentation/Synergy.Documentation/Markup/Markdown.cs @@ -231,5 +231,27 @@ public override string ToString() } #endregion + + #region Image + + public class Image : IElement + { + private readonly CodeFile _filePath; + private readonly string _alternateText; + + public Image(CodeFile filePath, string? alternateText = null) + { + _filePath = filePath; + _alternateText = alternateText ?? filePath.FileName; + } + + public override string ToString() + => $"![{_alternateText}]({_filePath.ToString().Replace(" ", "%20")}){Markdown.NL}"; + + public Image RelativeTo(CodeFile file) + => new(_filePath.RelativeTo(file.Folder), _alternateText); + } + + #endregion } } \ No newline at end of file