Exemple #1
0
 public static string GetGitHubLink(Topic topic)
 {
     if (topic.Path != null)
     {
         return string.Format(GitHubTemplate, topic.Path.FullPath);
     }
     return string.Empty;
 }
Exemple #2
0
 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();
     }
 }
Exemple #3
0
 public static string GetLink(Topic topic)
 {
     return string.Concat("/docs/", topic.Section.Id, "/", topic.Id);
 }
Exemple #4
0
 public static string GetGitHubLink(Topic topic)
 {
     return string.Format(GitHubTemplate, topic.Path.FullPath);
 }
Exemple #5
0
 public static IHtmlString RenderLink(this HtmlHelper helper, Topic topic)
 {
     var writer = new HtmlTextWriter(new StringWriter());
     WriteLink(writer, topic);
     return MvcHtmlString.Create(writer.InnerWriter.ToString());
 }
Exemple #6
0
 public static string GitHubLink(this HtmlHelper helper, Topic topic)
 {
     return LinkHelper.GetGitHubLink(topic);
 }