diff --git a/README.md b/README.md index 3b12f673..b0900fba 100644 --- a/README.md +++ b/README.md @@ -554,7 +554,7 @@ models: ``` Usage: datacontract export [OPTIONS] [LOCATION] - Convert data contract to a specific format. console.prints to stdout. + Convert data contract to a specific format. Prints to stdout or to the specified output file. ╭─ Arguments ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ location [LOCATION] The location (url or path) of the data contract yaml. [default: datacontract.yaml] │ @@ -732,7 +732,7 @@ Available import options: Usage: datacontract catalog [OPTIONS] - Create a html catalog of data contracts. + Create an html catalog of data contracts. ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ --files TEXT Glob pattern for the data contract files to include in the catalog. [default: *.yaml] │ diff --git a/datacontract/cli.py b/datacontract/cli.py index 6233508f..09716f46 100644 --- a/datacontract/cli.py +++ b/datacontract/cli.py @@ -3,17 +3,16 @@ from pathlib import Path from typing import Iterable, Optional - import typer from click import Context - from rich import box from rich.console import Console from rich.table import Table from typer.core import TyperGroup from typing_extensions import Annotated -from datacontract.catalog.catalog import create_index_html, create_data_contract_html +from datacontract.catalog.catalog import create_index_html, \ + create_data_contract_html from datacontract.data_contract import DataContract from datacontract.init.download_datacontract_file import \ download_datacontract_file, FileExistsException @@ -225,7 +224,7 @@ def catalog( output: Annotated[Optional[str], typer.Option(help="Output directory for the catalog html files.")] = "catalog/", ): """ - Create a html catalog of data contracts. + Create an html catalog of data contracts. """ path = Path(output) path.mkdir(parents=True, exist_ok=True) diff --git a/datacontract/templates/datacontract.html b/datacontract/templates/datacontract.html index 120f7780..3cc86384 100644 --- a/datacontract/templates/datacontract.html +++ b/datacontract/templates/datacontract.html @@ -19,7 +19,7 @@
- Data Contract + Data Contracts
@@ -54,15 +54,10 @@

- -

Info

diff --git a/datacontract/templates/index.html b/datacontract/templates/index.html index b4b89fff..ed2fb0eb 100644 --- a/datacontract/templates/index.html +++ b/datacontract/templates/index.html @@ -19,7 +19,7 @@ @@ -37,10 +37,7 @@

- Data Contracts

-
- There are {{ contracts_size }} contracts in the catalog -
+ Data Contract Catalog

@@ -53,43 +50,53 @@

+ {# TODO search and filter form #} + + + + {% if contracts_size == 0 %} +

The data contract catalog is empty.

+

+ Learn more on data contracts on http://datacontract.com. +

+ {% endif %} -
-
-
- - - - - - - - - - - - {% for contract in contracts %} - - - - - - - {% endfor %} - -
TitleIDVersionOwner
- {{contract.spec.info.title}} - - {{contract.spec.id}} - - {{contract.spec.info.version}} - - {{contract.spec.info.owner}} -
- -
-
-
diff --git a/datacontract/templates/style/output.css b/datacontract/templates/style/output.css index d468b2dd..4074fadf 100644 --- a/datacontract/templates/style/output.css +++ b/datacontract/templates/style/output.css @@ -594,6 +594,10 @@ video { z-index: 10; } +.col-span-1 { + grid-column: span 1 / span 1; +} + .-mx-4 { margin-left: -1rem; margin-right: -1rem; @@ -661,6 +665,13 @@ video { margin-top: auto; } +.line-clamp-3 { + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 3; +} + .inline-block { display: inline-block; } @@ -689,10 +700,18 @@ video { display: none; } +.h-10 { + height: 2.5rem; +} + .h-16 { height: 4rem; } +.h-4 { + height: 1rem; +} + .h-5 { height: 1.25rem; } @@ -713,6 +732,10 @@ video { width: 8.333333%; } +.w-10 { + width: 2.5rem; +} + .w-16 { width: 4rem; } @@ -721,6 +744,10 @@ video { width: 25%; } +.w-4 { + width: 1rem; +} + .w-5 { width: 1.25rem; } @@ -773,6 +800,10 @@ video { flex-direction: column; } +.flex-wrap { + flex-wrap: wrap; +} + .items-end { align-items: flex-end; } @@ -789,10 +820,18 @@ video { justify-content: space-between; } +.gap-1 { + gap: 0.25rem; +} + .gap-3 { gap: 0.75rem; } +.gap-6 { + gap: 1.5rem; +} + .gap-x-4 { -moz-column-gap: 1rem; column-gap: 1rem; @@ -807,6 +846,18 @@ video { row-gap: 1.5rem; } +.space-x-1 > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(0.25rem * var(--tw-space-x-reverse)); + margin-left: calc(0.25rem * calc(1 - var(--tw-space-x-reverse))); +} + +.space-x-3 > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(0.75rem * var(--tw-space-x-reverse)); + margin-left: calc(0.75rem * calc(1 - var(--tw-space-x-reverse))); +} + .space-x-6 > :not([hidden]) ~ :not([hidden]) { --tw-space-x-reverse: 0; margin-right: calc(1.5rem * var(--tw-space-x-reverse)); @@ -852,6 +903,12 @@ video { overflow-y: auto; } +.truncate { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + .whitespace-nowrap { white-space: nowrap; } @@ -860,6 +917,10 @@ video { white-space: pre-wrap; } +.rounded-full { + border-radius: 9999px; +} + .rounded-lg { border-radius: 0.5rem; } @@ -901,6 +962,10 @@ video { padding: 1rem; } +.p-6 { + padding: 1.5rem; +} + .px-1 { padding-left: 0.25rem; padding-right: 0.25rem; @@ -936,21 +1001,6 @@ video { padding-bottom: 0.5rem; } -.py-3 { - padding-top: 0.75rem; - padding-bottom: 0.75rem; -} - -.py-3\.5 { - padding-top: 0.875rem; - padding-bottom: 0.875rem; -} - -.py-4 { - padding-top: 1rem; - padding-bottom: 1rem; -} - .py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; @@ -960,6 +1010,10 @@ video { padding-bottom: 1rem; } +.pb-6 { + padding-bottom: 1.5rem; +} + .pb-7 { padding-bottom: 1.75rem; } @@ -1069,11 +1123,6 @@ video { color: rgb(17 24 39 / var(--tw-text-opacity)); } -.text-indigo-600 { - --tw-text-opacity: 1; - color: rgb(79 70 229 / var(--tw-text-opacity)); -} - .text-sky-500 { --tw-text-opacity: 1; color: rgb(14 165 233 / var(--tw-text-opacity)); @@ -1134,6 +1183,10 @@ video { --tw-ring-opacity: 0.05; } +.filter { + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); +} + .transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); @@ -1166,11 +1219,6 @@ video { color: rgb(55 65 81 / var(--tw-text-opacity)); } -.hover\:text-indigo-900:hover { - --tw-text-opacity: 1; - color: rgb(49 46 129 / var(--tw-text-opacity)); -} - .focus-visible\:outline:focus-visible { outline-style: solid; } @@ -1342,6 +1390,10 @@ video { display: flex; } + .lg\:grid-cols-3 { + grid-template-columns: repeat(3, minmax(0, 1fr)); + } + .lg\:items-center { align-items: center; }