[cfe-dev] Adding title in HTML report
Ted Kremenek
kremenek at apple.com
Mon Jul 7 11:31:40 PDT 2008
Applied:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20080707/006407.html
Thanks!
On Jul 4, 2008, at 2:14 AM, Jean-Daniel Dupas wrote:
> Hello,
>
> I'm think it may be convenient to update the HTMLRewriter to support
> a <title> in the header.
>
> When I read a static report result page, I have to scroll to the top
> of the page to find the file name. If we put the filename into the
> html title field, the browser will display it in the window title.
>
> So I think we can update the HTMLRewriter,
> AddHeaderFooterInternalBuiltinCSS method to accept an optional title
> string.
>
> void html::AddHeaderFooterInternalBuiltinCSS(Rewriter& R, unsigned
> FileID, const char *title = NULL)
>
> But after, what is the recommanded way to compose the header.
>
> will something like this be fine (using a ostringstream) ? I also
> attach a patch that implements this change.
>
> ------------------------------------------------
> std::ostringstream os;
> os << "<!doctype html>\n" // Use HTML 5 doctype
> "<html>\n<head>\n";
>
> if (title)
> os << "<title>" << html::EscapeText(title) << "</title>\n";
>
> os << "<style type=\"text/css\">\n"
> .....
> "</style>\n</head>\n<body>";
>
> // Generate header
> R.InsertStrBefore(StartLoc, os.str());
> ------------------------------------------------
>
> <html_title.diff>
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
More information about the cfe-dev
mailing list