public void GenerateHTML(TextWriter wr)
        {
            string ownerstr = HTML.GetOwnerString(this);
            string link;

            if (String.IsNullOrEmpty(this.Link))
            {
                link = String.Format("https://{0}/a/{1}/", this.site, this.Id);
            }
            else
            {
                link = this.Link;
            }

            wr.WriteLine("<h2>Answer {0}</h2>", this.Id);

            if (HTML.EnableAttribution)
            {
                wr.WriteLine("<p><a href=\"{0}\">Source</a> - by {1}</p>", link, ownerstr);
            }
            else
            {
                wr.WriteLine("<p><a href=\"{0}\">Link</a></p>", link);
            }

            wr.WriteLine("<blockquote>");
            wr.WriteLine(this.Body);
            wr.WriteLine("</blockquote>");
        }
예제 #2
0
        public void GenerateHTML(TextWriter wr)
        {
            string ownerstr = HTML.GetOwnerString(this);

            HTML.RenderHeader(this.Title, wr);

            if (HTML.EnableAttribution)
            {
                wr.WriteLine("<p><a href=\"{0}\">Source</a> - by {1}</p>", this.Link, ownerstr);
            }
            else
            {
                wr.WriteLine("<p><a href=\"{0}\">Link</a></p>", this.Link);
            }

            wr.WriteLine("<blockquote>");
            wr.WriteLine(this.Body);
            wr.WriteLine("</blockquote>");

            foreach (AnswerMarkdown a in this.Answers)
            {
                a.GenerateHTML(wr);
            }

            HTML.RenderBottom(wr);
        }
예제 #3
0
        public void GenerateHTML(TextWriter wr)
        {
            dynamic data     = this.DataDynamic;
            string  ownerstr = HTML.GetOwnerString(data);

            HTML.RenderHeader(data.title, wr);

            if (HTML.EnableAttribution)
            {
                wr.WriteLine("<p><a href=\"{0}\">Source</a> - by {1}</p>", data.link, ownerstr);
            }
            else
            {
                wr.WriteLine("<p><a href=\"{0}\">Link</a></p>", data.link);
            }

            wr.WriteLine("<blockquote>");
            wr.WriteLine(data.body);
            wr.WriteLine("</blockquote>");

            foreach (Answer a in this.Answers)
            {
                a.GenerateHTML(wr);
            }

            HTML.RenderBottom(wr);
        }
예제 #4
0
        public void GenerateHTML(TextWriter wr)
        {
            dynamic data     = this.DataDynamic;
            string  ownerstr = HTML.GetOwnerString(data);

            wr.WriteLine("<h2>Answer {0}</h2>", data.answer_id);
            if (HTML.EnableAttribution)
            {
                wr.WriteLine("<p><a href=\"https://{0}/a/{1}/\">Source</a> - by {2}</p>", this.site, data.answer_id, ownerstr);
            }
            else
            {
                wr.WriteLine("<p><a href=\"https://{0}/a/{1}/\">Link</a></p>", this.site, data.answer_id);
            }

            wr.WriteLine("<blockquote>");
            wr.WriteLine(data.body);
            wr.WriteLine("</blockquote>");
        }