diff --git a/packages/guides-theme-bootstrap/resources/config/guides-theme-bootstrap.php b/packages/guides-theme-bootstrap/resources/config/guides-theme-bootstrap.php index 00105ac9a..74e1d4355 100644 --- a/packages/guides-theme-bootstrap/resources/config/guides-theme-bootstrap.php +++ b/packages/guides-theme-bootstrap/resources/config/guides-theme-bootstrap.php @@ -2,6 +2,12 @@ declare(strict_types=1); +use phpDocumentor\Guides\Bootstrap\Directives\CardDirective; +use phpDocumentor\Guides\Bootstrap\Directives\CardFooterDirective; +use phpDocumentor\Guides\Bootstrap\Directives\CardGridDirective; +use phpDocumentor\Guides\Bootstrap\Directives\CardGroupDirective; +use phpDocumentor\Guides\Bootstrap\Directives\CardHeaderDirective; +use phpDocumentor\Guides\Bootstrap\Directives\CardImageDirective; use phpDocumentor\Guides\Bootstrap\Directives\TabDirective; use phpDocumentor\Guides\Bootstrap\Directives\TabsDirective; use phpDocumentor\Guides\RestructuredText\Directives\BaseDirective; @@ -20,6 +26,12 @@ ->bind('$startingRule', service(DirectiveContentRule::class)) ->instanceof(BaseDirective::class) ->tag('phpdoc.guides.directive') + ->set(CardDirective::class) + ->set(CardFooterDirective::class) + ->set(CardHeaderDirective::class) + ->set(CardImageDirective::class) + ->set(CardGroupDirective::class) + ->set(CardGridDirective::class) ->set(TabDirective::class) ->set(TabsDirective::class); }; diff --git a/packages/guides-theme-bootstrap/resources/template/body/directive/card-grid.html.twig b/packages/guides-theme-bootstrap/resources/template/body/directive/card-grid.html.twig new file mode 100644 index 000000000..a2a47c6f1 --- /dev/null +++ b/packages/guides-theme-bootstrap/resources/template/body/directive/card-grid.html.twig @@ -0,0 +1,15 @@ +
+ {% for card in node.value -%} +
+ {{ renderNode(card) }} +
+ {%- endfor %} +
diff --git a/packages/guides-theme-bootstrap/resources/template/body/directive/card-group.html.twig b/packages/guides-theme-bootstrap/resources/template/body/directive/card-group.html.twig new file mode 100644 index 000000000..2053c656c --- /dev/null +++ b/packages/guides-theme-bootstrap/resources/template/body/directive/card-group.html.twig @@ -0,0 +1,3 @@ +
+ {{ renderNode(node.value) }} +
diff --git a/packages/guides-theme-bootstrap/resources/template/body/directive/card.html.twig b/packages/guides-theme-bootstrap/resources/template/body/directive/card.html.twig new file mode 100644 index 000000000..3f6162fe7 --- /dev/null +++ b/packages/guides-theme-bootstrap/resources/template/body/directive/card.html.twig @@ -0,0 +1,34 @@ +
+ {% if node.cardHeader %} +
+ {% if node.cardHeader.content %} + {{ renderNode(node.cardHeader.content) }} + {% endif %} + {% if node.cardHeader.value %} + {{ renderNode(node.cardHeader.value) }} + {% endif %} +
+ {% endif %} + {% if node.cardImage and node.cardImage.position != 'bottom' %} + {% include "body/directive/card/card-image.html.twig" %} + {% endif %} +
+ {{ renderNode(node.title) }} +
+ {{ renderNode(node.value) }} +
+
+ {% if node.cardImage and node.cardImage.position == 'bottom' %} + {% include "body/directive/card/card-image.html.twig" %} + {% endif %} + {% if node.cardFooter %} + + {% endif %} +
\ No newline at end of file diff --git a/packages/guides-theme-bootstrap/resources/template/body/directive/card/card-image.html.twig b/packages/guides-theme-bootstrap/resources/template/body/directive/card/card-image.html.twig new file mode 100644 index 000000000..6796a0038 --- /dev/null +++ b/packages/guides-theme-bootstrap/resources/template/body/directive/card/card-image.html.twig @@ -0,0 +1,8 @@ +{{ node.cardImage.alt }} +{% if node.cardImage.value %} +
+
+ {{ renderNode(node.cardImage.value) }} +
+
+{% endif %} \ No newline at end of file diff --git a/packages/guides-theme-bootstrap/src/Bootstrap/Directives/CardDirective.php b/packages/guides-theme-bootstrap/src/Bootstrap/Directives/CardDirective.php new file mode 100644 index 000000000..28cc8fdf6 --- /dev/null +++ b/packages/guides-theme-bootstrap/src/Bootstrap/Directives/CardDirective.php @@ -0,0 +1,97 @@ +addGenericLink(self::NAME, CardNode::LINK_TYPE, CardNode::LINK_PREFIX); + } + + public function getName(): string + { + return self::NAME; + } + + protected function processSub( + BlockContext $blockContext, + CollectionNode $collectionNode, + Directive $directive, + ): Node|null { + $title = null; + if ($directive->getDataNode() !== null) { + $title = new TitleNode($directive->getDataNode(), 3, $this->getName()); + $title->setClasses(['card-title']); + } + + $originalChildren = $collectionNode->getChildren(); + $children = []; + $header = null; + $image = null; + $footer = null; + foreach ($originalChildren as $child) { + if ($child instanceof CardHeaderNode) { + $header = $child; + } elseif ($child instanceof CardImageNode) { + $image = $child; + } elseif ($child instanceof CardFooterNode) { + $footer = $child; + } else { + $children[] = $child; + } + } + + $id = ''; + if ($directive->hasOption('name')) { + $id = $directive->getOption('name')->toString(); + } + + $id = $this->anchorReducer->reduceAnchor($id); + + return new CardNode( + $this->getName(), + $directive->getData(), + $directive->getDataNode() ?? new InlineCompoundNode(), + $title, + $children, + $header, + $image, + $footer, + $id, + ); + } +} diff --git a/packages/guides-theme-bootstrap/src/Bootstrap/Directives/CardFooterDirective.php b/packages/guides-theme-bootstrap/src/Bootstrap/Directives/CardFooterDirective.php new file mode 100644 index 000000000..98671747f --- /dev/null +++ b/packages/guides-theme-bootstrap/src/Bootstrap/Directives/CardFooterDirective.php @@ -0,0 +1,42 @@ +getName(), + $directive->getData(), + $directive->getDataNode() ?? new InlineCompoundNode(), + ); + } +} diff --git a/packages/guides-theme-bootstrap/src/Bootstrap/Directives/CardGridDirective.php b/packages/guides-theme-bootstrap/src/Bootstrap/Directives/CardGridDirective.php new file mode 100644 index 000000000..2ab6160b3 --- /dev/null +++ b/packages/guides-theme-bootstrap/src/Bootstrap/Directives/CardGridDirective.php @@ -0,0 +1,76 @@ +getChildren(); + $children = []; + $cardHeight = intval($directive->getOption('card-height')->getValue()); + foreach ($originalChildren as $child) { + if ($child instanceof CardNode) { + $children[] = $child; + if ($cardHeight > 0) { + $child->setCardHeight($cardHeight); + } + } else { + $this->logger->warning('A card-grid may only contain cards. ', $blockContext->getLoggerInformation()); + } + } + + return new CardGridNode( + $this->getName(), + $directive->getData(), + $directive->getDataNode() ?? new InlineCompoundNode(), + $children, + intval($directive->getOption('columns')->getValue() ?? 0), + intval($directive->getOption('columns-sm')->getValue() ?? 0), + intval($directive->getOption('columns-md')->getValue() ?? 0), + intval($directive->getOption('columns-lg')->getValue() ?? 0), + intval($directive->getOption('columns-xl')->getValue() ?? 0), + intval($directive->getOption('gap')->getValue() ?? 0), + ); + } +} diff --git a/packages/guides-theme-bootstrap/src/Bootstrap/Directives/CardGroupDirective.php b/packages/guides-theme-bootstrap/src/Bootstrap/Directives/CardGroupDirective.php new file mode 100644 index 000000000..4183110d8 --- /dev/null +++ b/packages/guides-theme-bootstrap/src/Bootstrap/Directives/CardGroupDirective.php @@ -0,0 +1,64 @@ +getChildren(); + $children = []; + foreach ($originalChildren as $child) { + if ($child instanceof CardNode) { + $children[] = $child; + } else { + $this->logger->warning('A card-group may only contain cards. ', $blockContext->getLoggerInformation()); + } + } + + return new CardGroupNode( + $this->getName(), + $directive->getData(), + $directive->getDataNode() ?? new InlineCompoundNode(), + $children, + ); + } +} diff --git a/packages/guides-theme-bootstrap/src/Bootstrap/Directives/CardHeaderDirective.php b/packages/guides-theme-bootstrap/src/Bootstrap/Directives/CardHeaderDirective.php new file mode 100644 index 000000000..92fbb9d17 --- /dev/null +++ b/packages/guides-theme-bootstrap/src/Bootstrap/Directives/CardHeaderDirective.php @@ -0,0 +1,42 @@ +getName(), + $directive->getData(), + $directive->getDataNode() ?? new InlineCompoundNode(), + ); + } +} diff --git a/packages/guides-theme-bootstrap/src/Bootstrap/Directives/CardImageDirective.php b/packages/guides-theme-bootstrap/src/Bootstrap/Directives/CardImageDirective.php new file mode 100644 index 000000000..b9da7fdcd --- /dev/null +++ b/packages/guides-theme-bootstrap/src/Bootstrap/Directives/CardImageDirective.php @@ -0,0 +1,57 @@ +hasOption('alt')) { + $alt = $directive->getOption('alt')->toString(); + } + + $position = 'top'; + if ($directive->hasOption('position')) { + $position = $directive->getOption('position')->toString(); + } + + $overlay = $collectionNode->getChildren(); + + return new CardImageNode( + $this->getName(), + $directive->getData(), + $directive->getDataNode() ?? new InlineCompoundNode(), + $alt, + $position, + $overlay, + ); + } +} diff --git a/packages/guides-theme-bootstrap/src/Bootstrap/Nodes/Card/CardFooterNode.php b/packages/guides-theme-bootstrap/src/Bootstrap/Nodes/Card/CardFooterNode.php new file mode 100644 index 000000000..5251e6c66 --- /dev/null +++ b/packages/guides-theme-bootstrap/src/Bootstrap/Nodes/Card/CardFooterNode.php @@ -0,0 +1,31 @@ + $value */ + public function __construct( + protected readonly string $name, + protected readonly string $plainContent, + protected readonly InlineCompoundNode $content, + array $value = [], + ) { + parent::__construct($name, $plainContent, $content, $value); + } +} diff --git a/packages/guides-theme-bootstrap/src/Bootstrap/Nodes/Card/CardHeaderNode.php b/packages/guides-theme-bootstrap/src/Bootstrap/Nodes/Card/CardHeaderNode.php new file mode 100644 index 000000000..b3c463f4b --- /dev/null +++ b/packages/guides-theme-bootstrap/src/Bootstrap/Nodes/Card/CardHeaderNode.php @@ -0,0 +1,31 @@ + $value */ + public function __construct( + protected readonly string $name, + protected readonly string $plainContent, + protected readonly InlineCompoundNode $content, + array $value = [], + ) { + parent::__construct($name, $plainContent, $content, $value); + } +} diff --git a/packages/guides-theme-bootstrap/src/Bootstrap/Nodes/Card/CardImageNode.php b/packages/guides-theme-bootstrap/src/Bootstrap/Nodes/Card/CardImageNode.php new file mode 100644 index 000000000..2e7bde909 --- /dev/null +++ b/packages/guides-theme-bootstrap/src/Bootstrap/Nodes/Card/CardImageNode.php @@ -0,0 +1,43 @@ + $value */ + public function __construct( + protected readonly string $name, + protected readonly string $plainContent, + protected readonly InlineCompoundNode $content, + protected readonly string $alt = '', + protected readonly string $position = 'top', + array $value = [], + ) { + parent::__construct($name, $plainContent, $content, $value); + } + + public function getAlt(): string + { + return $this->alt; + } + + public function getPosition(): string + { + return $this->position; + } +} diff --git a/packages/guides-theme-bootstrap/src/Bootstrap/Nodes/CardGridNode.php b/packages/guides-theme-bootstrap/src/Bootstrap/Nodes/CardGridNode.php new file mode 100644 index 000000000..ad6fb76b1 --- /dev/null +++ b/packages/guides-theme-bootstrap/src/Bootstrap/Nodes/CardGridNode.php @@ -0,0 +1,73 @@ + $value */ + public function __construct( + protected readonly string $name, + protected readonly string $plainContent, + protected readonly InlineCompoundNode $content, + array $value = [], + private readonly int $columns = 0, + private readonly int $columnsSm = 0, + private readonly int $columnsMd = 0, + private readonly int $columnsLg = 0, + private readonly int $columnsXl = 0, + private readonly int $gap = 0, + private readonly int $cardHeight = 0, + ) { + parent::__construct($name, $plainContent, $content, $value); + } + + public function getColumns(): int + { + return $this->columns; + } + + public function getColumnsSm(): int + { + return $this->columnsSm; + } + + public function getColumnsMd(): int + { + return $this->columnsMd; + } + + public function getColumnsLg(): int + { + return $this->columnsLg; + } + + public function getColumnsXl(): int + { + return $this->columnsXl; + } + + public function getGap(): int + { + return $this->gap; + } + + public function getCardHeight(): int + { + return $this->cardHeight; + } +} diff --git a/packages/guides-theme-bootstrap/src/Bootstrap/Nodes/CardGroupNode.php b/packages/guides-theme-bootstrap/src/Bootstrap/Nodes/CardGroupNode.php new file mode 100644 index 000000000..2015a6a5d --- /dev/null +++ b/packages/guides-theme-bootstrap/src/Bootstrap/Nodes/CardGroupNode.php @@ -0,0 +1,31 @@ + $value */ + public function __construct( + protected readonly string $name, + protected readonly string $plainContent, + protected readonly InlineCompoundNode $content, + array $value = [], + ) { + parent::__construct($name, $plainContent, $content, $value); + } +} diff --git a/packages/guides-theme-bootstrap/src/Bootstrap/Nodes/CardNode.php b/packages/guides-theme-bootstrap/src/Bootstrap/Nodes/CardNode.php new file mode 100644 index 000000000..850e2d291 --- /dev/null +++ b/packages/guides-theme-bootstrap/src/Bootstrap/Nodes/CardNode.php @@ -0,0 +1,132 @@ + $value */ + public function __construct( + protected readonly string $name, + protected readonly string $plainContent, + protected readonly InlineCompoundNode $content, + protected readonly TitleNode|null $title = null, + array $value = [], + private readonly CardHeaderNode|null $cardHeader = null, + private readonly CardImageNode|null $cardImage = null, + private readonly CardFooterNode|null $cardFooter = null, + private readonly string $id = '', + private int $cardHeight = 0, + ) { + parent::__construct($name, $plainContent, $content, $value); + } + + public function getTitle(): TitleNode|null + { + return $this->title; + } + + public function getName(): string + { + return $this->name; + } + + public function getPlainContent(): string + { + return $this->plainContent; + } + + public function getContent(): InlineCompoundNode + { + return $this->content; + } + + public function getCardHeader(): CardHeaderNode|null + { + return $this->cardHeader; + } + + public function getCardImage(): CardImageNode|null + { + return $this->cardImage; + } + + public function getCardFooter(): CardFooterNode|null + { + return $this->cardFooter; + } + + public function getLinkType(): string + { + return self::LINK_TYPE; + } + + public function getId(): string + { + return $this->id; + } + + public function getAnchor(): string + { + return self::LINK_PREFIX . $this->id; + } + + public function getLinkText(): string + { + if ($this->getTitle() !== null) { + return $this->getTitle()->toString(); + } + + if ($this->getCardHeader() !== null) { + return $this->getCardHeader()->getContent()->toString(); + } + + return 'card ' . $this->id; + } + + public function isNoindex(): bool + { + return $this->id === ''; + } + + public function getPrefix(): string + { + return self::LINK_PREFIX; + } + + public function getCardHeight(): int + { + return $this->cardHeight; + } + + public function setCardHeight(int $cardHeight): CardNode + { + $this->cardHeight = $cardHeight; + + return $this; + } +} diff --git a/packages/guides/resources/template/html/structure/header-title.html.twig b/packages/guides/resources/template/html/structure/header-title.html.twig index 8ca025386..a2775cb5b 100644 --- a/packages/guides/resources/template/html/structure/header-title.html.twig +++ b/packages/guides/resources/template/html/structure/header-title.html.twig @@ -1 +1 @@ -{{ renderNode(node.value) }} +{{ renderNode(node.value) }} diff --git a/tests/Integration/tests/bootstrap/bootstrap-card-grid/expected/index.html b/tests/Integration/tests/bootstrap/bootstrap-card-grid/expected/index.html new file mode 100644 index 000000000..d860668e1 --- /dev/null +++ b/tests/Integration/tests/bootstrap/bootstrap-card-grid/expected/index.html @@ -0,0 +1,170 @@ + +
+ +

Document Title

+
+
+
+ + Hero Illustration +
+ +
+ +

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy +eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua.

+ +
+
+ +
+
+
+ + Hero Illustration +
+ +
+ +

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy +eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua.

+ +
+
+ +
+
+
+ + Hero Illustration +
+ +
+ +

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy +eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua.

+ +
+
+ +
+
+
+ + Hero Illustration +
+ +
+ +

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy +eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua.

+ +
+
+ +
+
+
+
+
+ + Hero Illustration +
+ +
+ +

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy +eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua.

+ +
+
+ +
+
+
+ + Hero Illustration +
+ +
+ +

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy +eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua.

+ +
+
+ +
+
+
+ + Hero Illustration +
+ +
+ +

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy +eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua.

+ +
+
+ +
+
+
+ + Hero Illustration +
+ +
+ +

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy +eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua.

+ +
+
+ +
+
+
+ diff --git a/tests/Integration/tests/bootstrap/bootstrap-card-grid/input/guides.xml b/tests/Integration/tests/bootstrap/bootstrap-card-grid/input/guides.xml new file mode 100644 index 000000000..ca011cd3c --- /dev/null +++ b/tests/Integration/tests/bootstrap/bootstrap-card-grid/input/guides.xml @@ -0,0 +1,9 @@ + + + + diff --git a/tests/Integration/tests/bootstrap/bootstrap-card-grid/input/hero-illustration.svg b/tests/Integration/tests/bootstrap/bootstrap-card-grid/input/hero-illustration.svg new file mode 100644 index 000000000..002f8feff --- /dev/null +++ b/tests/Integration/tests/bootstrap/bootstrap-card-grid/input/hero-illustration.svg @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/Integration/tests/bootstrap/bootstrap-card-grid/input/index.rst b/tests/Integration/tests/bootstrap/bootstrap-card-grid/input/index.rst new file mode 100644 index 000000000..d173522c8 --- /dev/null +++ b/tests/Integration/tests/bootstrap/bootstrap-card-grid/input/index.rst @@ -0,0 +1,126 @@ +.. _start: + +============== +Document Title +============== + +.. card-grid:: + :columns: 1 + :columns-md: 3 + :gap: 4 + :card-height: 100 + + .. card:: + + .. card-image:: hero-illustration.svg + :alt: Hero Illustration + + .. card-header:: :ref:`Linked Card Header ` + + **Lorem ipsum dolor sit amet,** consetetur sadipscing elitr, sed diam nonumy + eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. + + .. card-footer:: :ref:`Read more ` + + .. card:: + + .. card-image:: hero-illustration.svg + :alt: Hero Illustration + + .. card-header:: :ref:`Linked Card Header ` + + **Lorem ipsum dolor sit amet,** consetetur sadipscing elitr, sed diam nonumy + eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. + + .. card-footer:: :ref:`Read more ` + + .. card:: + + .. card-image:: hero-illustration.svg + :alt: Hero Illustration + + .. card-header:: :ref:`Linked Card Header ` + + **Lorem ipsum dolor sit amet,** consetetur sadipscing elitr, sed diam nonumy + eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. + + .. card-footer:: :ref:`Read more ` + + .. card:: + + .. card-image:: hero-illustration.svg + :alt: Hero Illustration + + .. card-header:: :ref:`Linked Card Header ` + + **Lorem ipsum dolor sit amet,** consetetur sadipscing elitr, sed diam nonumy + eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. + + .. card-footer:: :ref:`Read more ` + + +.. card-grid:: + :columns: 1 + :columns-sm: 2 + :columns-md: 3 + :columns-lg: 4 + :columns-xl: 5 + :gap: 2 + :card-height: 100 + :class: pt-4 + + .. card:: + + .. card-image:: hero-illustration.svg + :alt: Hero Illustration + + .. card-header:: :ref:`Linked Card Header ` + + **Lorem ipsum dolor sit amet,** consetetur sadipscing elitr, sed diam nonumy + eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. + + .. card-footer:: :ref:`Read more ` + + .. card:: + + .. card-image:: hero-illustration.svg + :alt: Hero Illustration + + .. card-header:: :ref:`Linked Card Header ` + + **Lorem ipsum dolor sit amet,** consetetur sadipscing elitr, sed diam nonumy + eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. + + .. card-footer:: :ref:`Read more ` + + .. card:: + + .. card-image:: hero-illustration.svg + :alt: Hero Illustration + + .. card-header:: :ref:`Linked Card Header ` + + **Lorem ipsum dolor sit amet,** consetetur sadipscing elitr, sed diam nonumy + eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. + + .. card-footer:: :ref:`Read more ` + + .. card:: + + .. card-image:: hero-illustration.svg + :alt: Hero Illustration + + .. card-header:: :ref:`Linked Card Header ` + + **Lorem ipsum dolor sit amet,** consetetur sadipscing elitr, sed diam nonumy + eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. + + .. card-footer:: :ref:`Read more ` diff --git a/tests/Integration/tests/bootstrap/bootstrap-card-group/expected/index.html b/tests/Integration/tests/bootstrap/bootstrap-card-group/expected/index.html new file mode 100644 index 000000000..255f5009d --- /dev/null +++ b/tests/Integration/tests/bootstrap/bootstrap-card-group/expected/index.html @@ -0,0 +1,81 @@ + +
+ +

Document Title

+
+
+ + Hero Illustration +
+ +
+ +

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy +eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua.

+ +
+
+ +
+ + Hero Illustration +
+ +
+ +

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy +eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua.

+ +
+
+ +
+ + Hero Illustration +
+ +
+ +

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy +eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua.

+ +
+
+ +
+ + Hero Illustration +
+ +
+ +

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy +eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua.

+ +
+
+ +
+
+
+ diff --git a/tests/Integration/tests/bootstrap/bootstrap-card-group/input/guides.xml b/tests/Integration/tests/bootstrap/bootstrap-card-group/input/guides.xml new file mode 100644 index 000000000..ca011cd3c --- /dev/null +++ b/tests/Integration/tests/bootstrap/bootstrap-card-group/input/guides.xml @@ -0,0 +1,9 @@ + + + + diff --git a/tests/Integration/tests/bootstrap/bootstrap-card-group/input/hero-illustration.svg b/tests/Integration/tests/bootstrap/bootstrap-card-group/input/hero-illustration.svg new file mode 100644 index 000000000..002f8feff --- /dev/null +++ b/tests/Integration/tests/bootstrap/bootstrap-card-group/input/hero-illustration.svg @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/Integration/tests/bootstrap/bootstrap-card-group/input/index.rst b/tests/Integration/tests/bootstrap/bootstrap-card-group/input/index.rst new file mode 100644 index 000000000..2562b0fe8 --- /dev/null +++ b/tests/Integration/tests/bootstrap/bootstrap-card-group/input/index.rst @@ -0,0 +1,59 @@ +.. _start: + +============== +Document Title +============== + +.. card-group:: + + .. card:: + + .. card-image:: hero-illustration.svg + :alt: Hero Illustration + + .. card-header:: :ref:`Linked Card Header ` + + **Lorem ipsum dolor sit amet,** consetetur sadipscing elitr, sed diam nonumy + eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. + + .. card-footer:: :ref:`Read more ` + + .. card:: + + .. card-image:: hero-illustration.svg + :alt: Hero Illustration + + .. card-header:: :ref:`Linked Card Header ` + + **Lorem ipsum dolor sit amet,** consetetur sadipscing elitr, sed diam nonumy + eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. + + .. card-footer:: :ref:`Read more ` + + .. card:: + + .. card-image:: hero-illustration.svg + :alt: Hero Illustration + + .. card-header:: :ref:`Linked Card Header ` + + **Lorem ipsum dolor sit amet,** consetetur sadipscing elitr, sed diam nonumy + eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. + + .. card-footer:: :ref:`Read more ` + + .. card:: + + .. card-image:: hero-illustration.svg + :alt: Hero Illustration + + .. card-header:: :ref:`Linked Card Header ` + + **Lorem ipsum dolor sit amet,** consetetur sadipscing elitr, sed diam nonumy + eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. + + .. card-footer:: :ref:`Read more ` diff --git a/tests/Integration/tests/bootstrap/bootstrap-cards/expected/index.html b/tests/Integration/tests/bootstrap/bootstrap-cards/expected/index.html new file mode 100644 index 000000000..9e69f4ac8 --- /dev/null +++ b/tests/Integration/tests/bootstrap/bootstrap-cards/expected/index.html @@ -0,0 +1,116 @@ + +
+ +

Document Title

+ +

See card some-card and Linked Card Header.

+ +
+
+

Card Header

+
+ +

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy +eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. +Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. +Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam +nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua. At vero eos et accusam et justo duo dolores et +ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est +Lorem ipsum dolor sit amet.

+ +
+
+
+
+
+

Linked Card Header

+
+ +

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy +eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua.

+ +
+
+ +
+
+ +
+ +
+ +

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy +eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua.

+ +
+
+ +
+
+ + Hero Illustration +
+ +
+ +

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy +eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua.

+ +
+
+ +
+
+ Hero Illustration +
+
+
Overlay
+

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy +eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua.

+ +
+
+
+ +
+ +
+
+ +
+
+
+

Linked Card Header

+
+ +

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy +eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua.

+ +
+
+ Hero Illustration + +
+
+ diff --git a/tests/Integration/tests/bootstrap/bootstrap-cards/input/guides.xml b/tests/Integration/tests/bootstrap/bootstrap-cards/input/guides.xml new file mode 100644 index 000000000..ca011cd3c --- /dev/null +++ b/tests/Integration/tests/bootstrap/bootstrap-cards/input/guides.xml @@ -0,0 +1,9 @@ + + + + diff --git a/tests/Integration/tests/bootstrap/bootstrap-cards/input/hero-illustration.svg b/tests/Integration/tests/bootstrap/bootstrap-cards/input/hero-illustration.svg new file mode 100644 index 000000000..002f8feff --- /dev/null +++ b/tests/Integration/tests/bootstrap/bootstrap-cards/input/hero-illustration.svg @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/Integration/tests/bootstrap/bootstrap-cards/input/index.rst b/tests/Integration/tests/bootstrap/bootstrap-cards/input/index.rst new file mode 100644 index 000000000..571229765 --- /dev/null +++ b/tests/Integration/tests/bootstrap/bootstrap-cards/input/index.rst @@ -0,0 +1,89 @@ +.. _start: + +============== +Document Title +============== + +See :card:`some-card` and :card:`another-card`. + +.. card:: Card Header + :class: w-50 + + Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy + eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. + Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. + Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam + nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. At vero eos et accusam et justo duo dolores et + ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est + Lorem ipsum dolor sit amet. + +.. card:: :ref:`Linked Card Header ` + :class: w-50 text-center + + **Lorem ipsum dolor sit amet,** consetetur sadipscing elitr, sed diam nonumy + eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. + + .. card-footer:: + + * `12-dev `__ + * `11.5 `__ + * `10.4 `__ + +.. card:: + :class: w-50 + + .. card-header:: :ref:`Linked Card Header ` + + **Lorem ipsum dolor sit amet,** consetetur sadipscing elitr, sed diam nonumy + eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. + + .. card-footer:: :ref:`Read more ` + +.. card:: + :class: w-50 + + .. card-image:: hero-illustration.svg + :alt: Hero Illustration + + .. card-header:: :ref:`Linked Card Header ` + + **Lorem ipsum dolor sit amet,** consetetur sadipscing elitr, sed diam nonumy + eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. + + .. card-footer:: :ref:`Read more ` + + +.. card:: + :class: w-50 + :name: some-card + + .. card-image:: hero-illustration.svg + :alt: Hero Illustration + + .. rubric:: Overlay + :class: h3 + + **Lorem ipsum dolor sit amet,** consetetur sadipscing elitr, sed diam nonumy + eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. + + .. card-footer:: :ref:`Read more ` + +.. card:: :ref:`Linked Card Header ` + :class: w-50 + :name: another-card + + .. card-image:: hero-illustration.svg + :alt: Hero Illustration + :position: bottom + + **Lorem ipsum dolor sit amet,** consetetur sadipscing elitr, sed diam nonumy + eirmod tempor invidunt ut labore et dolore magna aliquyam erat, + sed diam voluptua. + + .. card-footer:: :ref:`Read more `