Skip to content

Commit 8e04e6e

Browse files
authored
feat: Add .table-responsive CSS class for reference tables (#11)
1 parent fb351d2 commit 8e04e6e

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

lib/Compiler/Method/Table.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function compile()
4949
return ($a->getName() < $b->getName()) ? -1 : 1;
5050
});
5151

52-
$contents = '<div class="table-methods">';
52+
$contents = '<div class="table-methods table-responsive">';
5353
$contents .= self::PARAGRAPH;
5454

5555
$contents .= '| Name | Return Type | Summary/Returns |' . self::NEWLINE;
@@ -84,7 +84,7 @@ public function compileMethod($method)
8484

8585
$return = sprintf(
8686
'| <span class="method-name">[%1$s](#%2$s)</span> | '
87-
. '<span class="method-type">%3$s</span> | ',
87+
. '<span class="method-type">%3$s</span> | ',
8888
$name,
8989
$this->sanitizeAnchor($method->getName()),
9090
$this->sanitizeTypeList($method->getReturnType())
@@ -93,13 +93,13 @@ public function compileMethod($method)
9393
$return .= '<span class="method-description">';
9494

9595
if (!empty($method->getSummary())) {
96-
$return .= $this->sanitizeTextForTable($method->getSummary());
96+
$return .= $this->sanitizeTextForTable($method->getSummary());
9797
}
9898

9999
if (!empty($method->getReturnDescription())) {
100-
$return .= '<br><br><span class="method-return"><span class="method-return-label">Returns:</span> '
101-
. $this->sanitizeTextForTable($method->getReturnDescription())
102-
. '</span>';
100+
$return .= '<br><br><span class="method-return"><span class="method-return-label">Returns:</span> '
101+
. $this->sanitizeTextForTable($method->getReturnDescription())
102+
. '</span>';
103103
}
104104

105105
$return .= '</span> |';

lib/Compiler/Param/Table.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function compile()
4141
if (!is_array($this->params) || empty($this->params)) {
4242
return $contents;
4343
}
44-
44+
$contents = '<div class="table-responsive">';
4545
$contents .= '| Name | Type | Description |' . self::NEWLINE;
4646
$contents .= '| --- | --- | --- |' . self::NEWLINE;
4747

@@ -70,6 +70,7 @@ public function compile()
7070
}
7171

7272
$contents .= self::NEWLINE;
73+
$contents .= '</div>';
7374

7475
return $contents;
7576
}

lib/Compiler/Property/Table.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function compile()
4343
return $contents;
4444
}
4545

46-
$contents .= '<div class="table-properties">';
46+
$contents .= '<div class="table-properties table-responsive">';
4747
$contents .= self::PARAGRAPH;
4848

4949
$contents .= '| Name | Type | Description |' . self::NEWLINE;
@@ -52,8 +52,8 @@ public function compile()
5252
foreach ($this->properties as $param) {
5353
$contents .= sprintf(
5454
'| <span class="property-name">$%1$s</span> | '
55-
. '<span class="property-type">%2$s</span> | '
56-
. '<span class="property-description">%3$s</span> |' . self::NEWLINE,
55+
. '<span class="property-type">%2$s</span> | '
56+
. '<span class="property-description">%3$s</span> |' . self::NEWLINE,
5757
$param->getName(),
5858
$this->sanitizeTypeList($param->getDocBlockType()),
5959
$this->sanitizeTextForTable($param->getDescription())

0 commit comments

Comments
 (0)