public string GetTableOfContents(IEnumerable <HeaderSet> headers)
        {
            var strBuilder = new StringBuilder();

            foreach (var header in headers)
            {
                if (header.Heading > 1)
                {
                    strBuilder.Append(new String(' ', (header.Heading - 1) * 2));
                }

                strBuilder.Append("*");
                strBuilder.Append(" " + MarkdownHelper.GetLinkFromAnchor(header.Text, header.GetAnchorLink()));
                if (header != headers.LastOrDefault())
                {
                    strBuilder.AppendLine();
                }
            }
            return(strBuilder.ToString());
        }
        public override string ToString()
        {
            // recupera apenas as versoes da mesma lingua em outras páginas
            var allPageVersion = Version.Page.Documentation.GetVersionsFromLanguage(Version.Language);
            var anchors        = allPageVersion.SelectMany(f => f.Nodes).OfType <IAnchor>();

            var anchor = anchors.FirstOrDefault(f => f.Name == Name);

            if (anchor != null)
            {
                var text = string.IsNullOrWhiteSpace(CustomText) ? anchor.Text : CustomText;
                return(MarkdownHelper.GetLinkFromAnchor(text, anchor.GetAnchorLink()));
            }
            else
            {
                var exceptionDesc = $"The anchor '{Name}' doesn't exist for language version {Version.Language.Name}: {Node.ToString()}";
                return("<error>" + exceptionDesc + "</error>");

                throw new Exception(exceptionDesc);
            }
        }