Example #1
0
 private string GetPageTitle(ApiReferenceDocument doc, Dictionary <string, ApiReferenceEntity> entityCache)
 {
     return(ApiRenderingHelper.GetTitle(doc.Entity.Id,
                                        doc.Entity.Titles,
                                        doc.Entity.Comment,
                                        doc.Entity.Parameters,
                                        doc.Entity.Attributes,
                                        entityCache,
                                        false));
 }
Example #2
0
        private void WriteAttachedAttributeDetails(RenderingState state)
        {
            var attachedInfo = ApiRenderingHelper.GetAttachedAttributeInfo(state.Document.Entity.Id,
                                                                           state.Document.Entity.Titles,
                                                                           state.Document.Entity.Parameters,
                                                                           state.Document.Entity.Attributes,
                                                                           state.EntityCache);

            if (attachedInfo == null)
            {
                return;
            }

            state.AppendString($"<p><em>");
            state.AppendString($"Attached by <a href=\"{EscapeHtml(RelativePathHelper.GetRelativePath(state.Document.Entity.Uri.Href, attachedInfo.AttachedByHref, "html"))}\">{EscapeHtml(attachedInfo.AttachedByType)}</a>.");
            state.AppendString($"Use full name <code>{EscapeHtml(attachedInfo.FullName)}</code> in UX markup if ambiguous.");
            state.AppendString("</em></p>");
        }
Example #3
0
        private void WriteLink(RenderingState state)
        {
            var title = ApiRenderingHelper.GetTitle(state.Id, state.Title, state.Comment, null, null, new Dictionary <string, ApiReferenceEntity>(), true);

            if (string.IsNullOrWhiteSpace(title))
            {
                throw new ArgumentException($"No title could be generated for {state.Id.Id} in {state.CurrentPath} (type {state.Id.Type})");
            }

            state.AppendString($"<h5>");
            state.AppendString($"<a href=\"{EscapeHtml(RelativePathHelper.GetRelativePath(state.CurrentPath, state.Uri.Href, "html"))}\">");
            state.AppendString(EscapeHtml(title));
            state.AppendString($"</a>");
            WriteAttachedBy(state);
            WriteReturns(state);
            WriteLanguage(state);
            state.AppendString($"</h5>");
        }