public static string GetGitHubLink(Topic topic) { if (topic.Path != null) { return string.Format(GitHubTemplate, topic.Path.FullPath); } return string.Empty; }
public static void WriteLink(HtmlTextWriter writer, Topic topic) { if (string.IsNullOrWhiteSpace(topic.Body)) { writer.Write(topic.Name); } else { var path = LinkHelper.GetLink(topic); writer.AddAttribute(HtmlTextWriterAttribute.Href, path); writer.RenderBeginTag(HtmlTextWriterTag.A); writer.Write(topic.Name); writer.RenderEndTag(); } }
public static string GetLink(Topic topic) { return string.Concat("/docs/", topic.Section.Id, "/", topic.Id); }
public static string GetGitHubLink(Topic topic) { return string.Format(GitHubTemplate, topic.Path.FullPath); }
public static IHtmlString RenderLink(this HtmlHelper helper, Topic topic) { var writer = new HtmlTextWriter(new StringWriter()); WriteLink(writer, topic); return MvcHtmlString.Create(writer.InnerWriter.ToString()); }
public static string GitHubLink(this HtmlHelper helper, Topic topic) { return LinkHelper.GetGitHubLink(topic); }