summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-doc/HTMLGenerator.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clang-doc] sys::fs::F_None -> OF_None. NFCFangrui Song2019-09-091-2/+2
| | | | | | F_None, F_Text and F_Append are kept for compatibility. llvm-svn: 371394
* [clang-doc] Use llvm::createStringError and canonicalize error messagesFangrui Song2019-08-281-12/+12
| | | | | | | | | | | | | "Bad block found.\n" -> "bad block found" The lower cased form with no full stop or newline is more common in LLVM tools. Reviewed By: juliehockett Differential Revision: https://reviews.llvm.org/D66783 llvm-svn: 370155
* [clang-doc] Switch Generator::CreateResources to use llvm::ErrorJulie Hockett2019-08-261-25/+36
| | | | | | Differential Revision: https://reviews.llvm.org/D66502 llvm-svn: 369925
* [clang-doc] Fix casting not working in gcc 5.4.0Diego Astiazaran2019-08-171-4/+4
| | | | | | | | | An implicit cast of std::string to llvm::SmallString<> was breaking GCC 5.4.0 builder. A pair using llvm::SmallString<> now uses std::string. Differential Revision: https://reviews.llvm.org/D66378 llvm-svn: 369182
* [clang-doc] Redesign of generated HTML filesDiego Astiazaran2019-08-161-60/+171
| | | | | | | | | | | | | The new design includes a header (contains the project name), a main section, and a footer. The main section is divided into three subsections. Left, middle, right. The left section contains the general index, the middle contains the info's data, and the right contains the index for the info's content. The CSS has been updated. A flag --project-name is added. The Attributes attribute of the TagNode struct is now a vector of pairs because these attributes should be rendered in the insertion order. The functions (cpp and js) that converts an Index tree structure into HTML were slightly modified; the first ul tag created is now a ol tag. The inner lists are still ul. Differential Revision: https://reviews.llvm.org/D66353 llvm-svn: 369139
* [clang-tools-extra] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-141-51/+51
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368944
* [clang-doc] Generate HTML links for children namespaces/recordsDiego Astiazaran2019-08-121-34/+53
| | | | | | | | | | | | | | | | Path is now stored in the references to the child while serializing, then this path is used to generate the relative path in the HTML generator. Now some references have paths and some don't so in the reducing phase, references are now properly merged checking for empty attributes. Tests added for HTML and YAML generators, merging and serializing. computeRelativePath function had a bug when the filepath is part of the given directory; it returned a path that starts with a separator. This has been fixed. Differential Revision: https://reviews.llvm.org/D65987 llvm-svn: 368602
* [clang-doc] Generate an HTML index fileDiego Astiazaran2019-08-091-1/+19
| | | | | | | | | clang-doc now generates a file that contains only an index to all the infos that can be used as the landing page for the generated website. Differential Revision: https://reviews.llvm.org/D65918 llvm-svn: 368484
* [clang-format] Add link to source code in file definitionsDiego Astiazaran2019-08-091-31/+75
| | | | | | | | | | | | | Two command line options have been added to clang-doc. --repository=<string> - URL of repository that hosts code; used for links to definition locations. --source-root=<string> - Directory where processed files are stored. Links to definition locations will only be generated if the file is in this dir. If the file is in the source-root and a repository options is passed; a link to the source code will be rendered by the HTML generator. Differential Revision: https://reviews.llvm.org/D65483 llvm-svn: 368460
* [clang-doc] Add second index for sections within info's contentDiego Astiazaran2019-08-071-12/+88
| | | | | | | | | | | | This new index contains links to the main section of infos: Namespaces, Records, Functions, Enums, Members. Also to each child function or enum. Index is currently rendered on top of the info content, this will be fixed later with CSS. Depends on D65690. Differential Revision: https://reviews.llvm.org/D65030 llvm-svn: 368209
* [clang-doc] Fix paths of js in import tagsDiego Astiazaran2019-08-061-0/+2
| | | | | | | | HTML requires posix-style paths. Differential Revision: https://reviews.llvm.org/D65827 llvm-svn: 368087
* [clang-doc] Add index in each info html fileDiego Astiazaran2019-08-061-49/+140
| | | | | | | | | | | | An index structure is created while generating the output file for each info. This structure is parsed to JSON and written to a file in the output directory. The html for the index is not rendered by clang-doc. A Javascript file is included in the output directory, this will the JSON file and insert HTML elements into the file. Differential Revision: https://reviews.llvm.org/D65690 llvm-svn: 368070
* [clang-doc] Fix link generationDiego Astiazaran2019-08-061-1/+1
| | | | | | | | | | | | | | | | | | | Before making a link to a reference it is required to check that the reference has a path (eg. primitives won't have paths). This was done by checking if the path was empty; that worked because when generating paths the outdirectory was included, so if the path was assigned it had that outdirectory at least. The path generation was changed, it's now only the composite of the namespaces without the outdirectory. So if the info is in the global namespace the path would be empty and the old check wouldn't work as expected. A new attribute has been added to the Reference struct that indicates if the info's parent is the global namespace. Paths generation now fails if the path is empty and if the info is not in the global namespace. Differential Revision: https://reviews.llvm.org/D64958 llvm-svn: 367958
* [clang-doc] Fix failing tests on WindowsDiego Astiazaran2019-07-291-0/+2
| | | | | | | | | Tests on Windows were failing due to path separator differences. Links in HTML should use posix-style paths. Differential Revision: https://reviews.llvm.org/D65419 llvm-svn: 367264
* [clang-format] Fix style of css file pathsDiego Astiazaran2019-07-261-0/+2
| | | | | | | | | CSS files included in HTML should have a path in posix style, it should not be different for Windows. Differential Revision: https://reviews.llvm.org/D65309 llvm-svn: 367137
* [clang-doc] Add option for user provided stylesheetsDiego Astiazaran2019-07-251-24/+38
| | | | | | | | | | An option has been added to clang-doc to provide a list of css stylesheets that the user wants to use for the generated html docs. Depends on D64539. Differential Revision: https://reviews.llvm.org/D64938 llvm-svn: 367072
* [clang-doc] Add stylesheet to generated html docsDiego Astiazaran2019-07-251-0/+33
| | | | | | | | A default css stylesheet is included for docs generated in html format. Differential Revision: https://reviews.llvm.org/D64539 llvm-svn: 367056
* [clang-doc] Fix output format of htmlDiego Astiazaran2019-07-251-39/+15
| | | | | | | | | The children of a TagNode are rendered in the same line as the parent only if they are all TextNodes. When children are not inline; two text nodes that are adjacent won't have a new line between them, each tag node is rendered in its own line. Differential Revision: https://reviews.llvm.org/D65005 llvm-svn: 367050
* [clang-doc] Fix html entities in rendered textDiego Astiazaran2019-07-251-1/+2
| | | | | | | | | Replace &, <, >, ", and ' with their corresponding html entities in text rendered by HTML generator. Differential Revision: https://reviews.llvm.org/D65107 llvm-svn: 367045
* [clang-doc] Add html links to referencesJulie Hockett2019-07-121-43/+135
| | | | | | | | | | | | | | | | <a> tags are added for the parents and members of records and return type and params of functions. The link redirects to the reference's info file. The directory path where each info file will be saved is now generated in the serialization phase and stored as an attribute in each Info. Bitcode writer and reader were modified to handle the new attributes. Committed on behalf of Diego Astiazarán (diegoaat97@gmail.com). Differential Revision: https://reviews.llvm.org/D63663 llvm-svn: 365937
* [clang-doc] Silence compiler warning with gcc 7.4 [NFC]Mikael Holmen2019-07-111-0/+3
| | | | | | | | | | | | | | | | | | | | Without the fix gcc 7.4.0 complains with /data/repo/master/clang-tools-extra/clang-doc/HTMLGenerator.cpp: In member function 'llvm::SmallString<16> clang::doc::{anonymous}::HTMLTag::ToString() const': /data/repo/master/clang-tools-extra/clang-doc/HTMLGenerator.cpp:165:1: error: control reaches end of non-void function [-Werror=return-type] } ^ /data/repo/master/clang-tools-extra/clang-doc/HTMLGenerator.cpp: In member function 'bool clang::doc::{anonymous}::HTMLTag::HasInlineChildren() const': /data/repo/master/clang-tools-extra/clang-doc/HTMLGenerator.cpp:142:1: error: control reaches end of non-void function [-Werror=return-type] } ^ /data/repo/master/clang-tools-extra/clang-doc/HTMLGenerator.cpp: In member function 'bool clang::doc::{anonymous}::HTMLTag::IsSelfClosing() const': /data/repo/master/clang-tools-extra/clang-doc/HTMLGenerator.cpp:126:1: error: control reaches end of non-void function [-Werror=return-type] } ^ cc1plus: all warnings being treated as errors llvm-svn: 365736
* [clang-doc] Add a structured HTML generatorJulie Hockett2019-07-101-0/+517
Implements an HTML generator. Nodes are used to represent each part of the HTML file. There are TagNodes that represent every HTML tag (p, h1, div, ...) and they have children nodes, which can be TagNodes or TextNodes (these nodes only have text). Proper indentation is rendered within the files generated by tool. No styling (CSS) is included. Committed on behalf of Diego Astiazarán (diegoaat97@gmail.com) Differential Revision: https://reviews.llvm.org/D63857 llvm-svn: 365687
OpenPOWER on IntegriCloud