Skip to content

Commit c6568eb

Browse files
committed
improve layout for long templated functions
- template parameters can wrap to the next line when they get too long - return types can wrap on small screens when they get too long - additional spacing was added to the member declarations table - add support for class template parameters fixes #84
1 parent 5bf1d5f commit c6568eb

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

doxygen-awesome.css

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1516,6 +1516,7 @@ div.memproto div.memtemplate {
15161516
color: var(--primary-dark-color);
15171517
font-size: var(--memname-font-size);
15181518
margin-left: 2px;
1519+
text-shadow: none;
15191520
}
15201521

15211522
table.mlabels, table.mlabels > tbody {
@@ -1732,6 +1733,7 @@ table.memberdecls tr[class^='memitem'] .memTemplParams {
17321733
font-family: var(--font-family-monospace);
17331734
font-size: var(--code-font-size);
17341735
color: var(--primary-dark-color);
1736+
white-space: normal;
17351737
}
17361738

17371739
table.memberdecls .memItemLeft,
@@ -1757,7 +1759,7 @@ table.memberdecls .memTemplParams {
17571759
border-left: 1px solid var(--separator-color);
17581760
border-right: 1px solid var(--separator-color);
17591761
border-radius: var(--border-radius-small) var(--border-radius-small) 0 0;
1760-
padding-bottom: 0;
1762+
padding-bottom: var(--spacing-small);
17611763
}
17621764

17631765
table.memberdecls .memTemplItemLeft {
@@ -1794,6 +1796,11 @@ table.memberdecls .mdescLeft, table.memberdecls .mdescRight {
17941796
padding: var(--spacing-small) 0;
17951797
}
17961798

1799+
table.memberdecls .memItemLeft,
1800+
table.memberdecls .memTemplItemLeft {
1801+
padding-right: var(--spacing-medium);
1802+
}
1803+
17971804
table.memberdecls .memSeparator {
17981805
background: var(--page-background-color);
17991806
height: var(--spacing-large);
@@ -1837,6 +1844,12 @@ div.dynheader img[src="closed.png"] {
18371844

18381845
}
18391846

1847+
.compoundTemplParams {
1848+
font-family: var(--font-family-monospace);
1849+
color: var(--primary-dark-color);
1850+
font-size: var(--code-font-size);
1851+
}
1852+
18401853
@media screen and (max-width: 767px) {
18411854

18421855
table.memberdecls .memItemLeft,
@@ -1853,6 +1866,7 @@ div.dynheader img[src="closed.png"] {
18531866
border-right: none;
18541867
border-left: none;
18551868
border-radius: 0;
1869+
white-space: normal;
18561870
}
18571871

18581872
table.memberdecls .memItemLeft,

include/MyLibrary/subclass-example.hpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ namespace MyLibrary {
88
/**
99
* @brief some subclass
1010
*/
11+
template<typename TemplatedClass>
1112
class SubclassExample : public Example {
1213
public:
1314

@@ -18,13 +19,22 @@ namespace MyLibrary {
1819
int virtualfunc() override;
1920

2021
/**
21-
* @brief Extra long function with lots of parameters
22+
* @brief Template function function
23+
*/
24+
template <typename T>
25+
std::shared_ptr<std::string> function_template_test(std::shared_ptr<T>& param);
26+
27+
/**
28+
* @brief Extra long function with lots of parameters and many template types.
29+
*
30+
* Also has a long return type.
31+
*
2232
* @param param1 first parameter
2333
* @param param2 second parameter
2434
* @param parameter3 third parameter
2535
*/
26-
template <typename T>
27-
std::shared_ptr<std::string> long_function_with_many_parameters(std::shared_ptr<T>& param1, std::shared_ptr<std::string>& param2, bool parameter3) {
36+
template <typename T, typename Foo, typename Bar, typename Alice, typename Bob, typename Charlie, typename Hello, typename World>
37+
std::pair<std::string, std::string> long_function_with_many_parameters(std::shared_ptr<T>& param1, std::shared_ptr<std::string>& param2, bool parameter3, Alice paramater4 Bob parameter 5) {
2838
if(true) {
2939
std::cout << "this even has some code." << std::endl;
3040
}

0 commit comments

Comments
 (0)