Skip to content

Commit 998840c

Browse files
committed
Run prettier
1 parent 3a7e080 commit 998840c

File tree

3 files changed

+221
-90
lines changed

3 files changed

+221
-90
lines changed

src/components/DisplayFormats.astro

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
---
2-
import { type formats as formatsType, type Format, supportsDirection,type Direction } from '@lib/formats';
2+
import {
3+
type formats as formatsType,
4+
type Format,
5+
supportsDirection,
6+
type Direction,
7+
} from "@lib/formats";
38
49
interface Props {
510
formats: typeof formatsType;
@@ -8,6 +13,7 @@ interface Props {
813
914
const { formats, direction } = Astro.props;
1015
---
16+
1117
<table class="w-full table-auto border-separate">
1218
<thead>
1319
<tr>
@@ -17,18 +23,22 @@ const { formats, direction } = Astro.props;
1723
</thead>
1824
<tbody>
1925
{
20-
(Object.keys(formats) as (keyof typeof formats)[]).map((key) => {
21-
22-
// Specify the styling of each format
23-
const format: Format = formats[key];
24-
return supportsDirection(format, direction) && (
25-
<tr>
26-
<td><code>{format.name}</code></td>
27-
<td><span set:html={format.description}></span></td>
28-
</tr>
29-
);
30-
})}
26+
(Object.keys(formats) as (keyof typeof formats)[]).map((key) => {
27+
// Specify the styling of each format
28+
const format: Format = formats[key];
29+
return (
30+
supportsDirection(format, direction) && (
31+
<tr>
32+
<td>
33+
<code>{format.name}</code>
34+
</td>
35+
<td>
36+
<span set:html={format.description} />
37+
</td>
38+
</tr>
39+
)
40+
);
41+
})
42+
}
3143
</tbody>
3244
</table>
33-
34-

src/components/SiteTitle.astro

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
11
---
2-
import { Image } from 'astro:assets';
2+
import { Image } from "astro:assets";
33
const { siteTitleHref } = (Astro.locals as any).starlightRoute;
44
5-
import dark from '@assets/nemo-logo-rusty-bright-nomargin.svg';
6-
import light from '@assets/nemo-logo-rusty-nomargin.svg';
5+
import dark from "@assets/nemo-logo-rusty-bright-nomargin.svg";
6+
import light from "@assets/nemo-logo-rusty-nomargin.svg";
77
---
88

9-
<a href={siteTitleHref} class="flex gap-0 content-center no-underline site-title-link">
10-
<Image
11-
format="svg"
12-
class="light:sl-hidden mr-2"
13-
alt=""
14-
src={dark}
15-
/>
16-
<Image
17-
format="svg"
18-
class="dark:sl-hidden mr-2"
19-
alt=""
20-
src={light}
21-
/>
9+
<a
10+
href={siteTitleHref}
11+
class="flex gap-0 content-center no-underline site-title-link"
12+
>
13+
<Image format="svg" class="light:sl-hidden mr-2" alt="" src={dark} />
14+
<Image format="svg" class="dark:sl-hidden mr-2" alt="" src={light} />
2215
<span class="comfortaa content-center">
2316
<span class="font-semibold text-2xl site-title mx-1">Nemo</span>
24-
<span class="font-normal text-base mx-1 max-[500px]:hidden min-[500px]:visible">Graph Rule Engine</div>
17+
<span
18+
class="font-normal text-base mx-1 max-[500px]:hidden min-[500px]:visible"
19+
>Graph Rule Engine</span
20+
>
2521
</span>
2622
</a>
2723

@@ -43,8 +39,3 @@ import light from '@assets/nemo-logo-rusty-nomargin.svg';
4339
object-position: 0 50%;
4440
}
4541
</style>
46-
47-
48-
49-
50-

src/lib/formats.tsx

Lines changed: 184 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,227 @@
1-
import {resource, delimiter,format,compression,limit,ignore_headers, http_headers,http_get_parameters,http_post_parameters,iri_fragment, base, endpoint,query ,type Parameter} from './parameters.tsx';
1+
import {
2+
resource,
3+
delimiter,
4+
format,
5+
compression,
6+
limit,
7+
ignore_headers,
8+
quoting,
9+
http_headers,
10+
http_get_parameters,
11+
http_post_parameters,
12+
iri_fragment,
13+
base,
14+
endpoint,
15+
query,
16+
type Parameter,
17+
} from "./parameters.tsx";
218

319
function createFormats<T extends Record<K, Format>, K extends string>(o: T) {
4-
return o
20+
return o;
521
}
622

7-
export type Direction = 'import' | 'export' | 'both';
23+
export type Direction = "import" | "export" | "both";
824

925
export interface Format {
10-
name: string,
11-
io: Direction,
12-
description: string,
13-
parameters: Parameter[],
26+
name: string;
27+
io: Direction;
28+
description: string;
29+
parameters: Parameter[];
1430
}
1531

1632
export const formats = createFormats({
17-
csv : {
33+
csv: {
1834
name: `csv`,
19-
io: 'both',
20-
description: 'Comma-separated values.',
21-
parameters: [resource,format,compression,limit,ignore_headers,http_headers,http_get_parameters,http_post_parameters,iri_fragment],
35+
io: "both",
36+
description: "Comma-separated values.",
37+
parameters: [
38+
resource,
39+
format,
40+
compression,
41+
limit,
42+
ignore_headers,
43+
quoting,
44+
http_headers,
45+
http_get_parameters,
46+
http_post_parameters,
47+
iri_fragment,
48+
],
2249
},
2350

24-
dsv : {
51+
dsv: {
2552
name: `dsv`,
26-
io: 'both',
27-
description: 'Delimited separated values. (Like <code>csv</code>, but allows specifying different delimiters e.g. <code>delimiter=";"</code>)',
28-
parameters: [delimiter,resource,format,compression,limit,ignore_headers,http_headers,http_get_parameters,http_post_parameters,iri_fragment],
53+
io: "both",
54+
description:
55+
'Delimited separated values. (Like <code>csv</code>, but allows specifying different delimiters e.g. <code>delimiter=";"</code>)',
56+
parameters: [
57+
delimiter,
58+
resource,
59+
format,
60+
compression,
61+
limit,
62+
ignore_headers,
63+
quoting,
64+
http_headers,
65+
http_get_parameters,
66+
http_post_parameters,
67+
iri_fragment,
68+
],
2969
},
3070

31-
tsv : {
71+
tsv: {
3272
name: `tsv`,
33-
io: 'both',
34-
description: 'Tab-separated values.',
35-
parameters: [resource,format,compression,limit,ignore_headers,http_headers,http_get_parameters,http_post_parameters,iri_fragment],
73+
io: "both",
74+
description: "Tab-separated values.",
75+
parameters: [
76+
resource,
77+
format,
78+
compression,
79+
limit,
80+
ignore_headers,
81+
quoting,
82+
http_headers,
83+
http_get_parameters,
84+
http_post_parameters,
85+
iri_fragment,
86+
],
3687
},
3788

38-
rdf : {
89+
rdf: {
3990
name: `rdf`,
40-
io: 'both',
41-
description: 'Generic RDF format. The actual format will be guessed using the file name.',
42-
parameters: [base, resource,format,compression,limit,http_headers,http_get_parameters,http_post_parameters,iri_fragment],
91+
io: "both",
92+
description:
93+
"Generic RDF format. The actual format will be guessed using the file name.",
94+
parameters: [
95+
base,
96+
resource,
97+
format,
98+
compression,
99+
limit,
100+
http_headers,
101+
http_get_parameters,
102+
http_post_parameters,
103+
iri_fragment,
104+
],
43105
},
44106

45-
nquads : {
107+
nquads: {
46108
name: `nquads`,
47-
io: 'both',
48-
description: 'RDF NQuads format.',
49-
parameters: [resource,format,compression,limit,base,http_headers,http_get_parameters,http_post_parameters,iri_fragment],
109+
io: "both",
110+
description: "RDF NQuads format.",
111+
parameters: [
112+
resource,
113+
format,
114+
compression,
115+
limit,
116+
base,
117+
http_headers,
118+
http_get_parameters,
119+
http_post_parameters,
120+
iri_fragment,
121+
],
50122
},
51123

52-
trig : {
124+
trig: {
53125
name: `trig`,
54-
io: 'both',
55-
description: 'RDF TriG format.',
56-
parameters: [resource,format,compression,limit,base,http_headers,http_get_parameters,http_post_parameters,iri_fragment],
126+
io: "both",
127+
description: "RDF TriG format.",
128+
parameters: [
129+
resource,
130+
format,
131+
compression,
132+
limit,
133+
base,
134+
http_headers,
135+
http_get_parameters,
136+
http_post_parameters,
137+
iri_fragment,
138+
],
57139
},
58140

59-
ntriples : {
141+
ntriples: {
60142
name: `ntriples`,
61-
io: 'both',
62-
description: 'RDF Ntriples format',
63-
parameters: [resource,format,compression,limit,base,http_headers,http_get_parameters,http_post_parameters,iri_fragment],
143+
io: "both",
144+
description: "RDF Ntriples format",
145+
parameters: [
146+
resource,
147+
format,
148+
compression,
149+
limit,
150+
base,
151+
http_headers,
152+
http_get_parameters,
153+
http_post_parameters,
154+
iri_fragment,
155+
],
64156
},
65157

66-
rdfxml : {
158+
rdfxml: {
67159
name: `rdfxml`,
68-
io: 'both',
69-
description: 'RDF/XML format.',
70-
parameters: [resource,format,compression,limit,base,http_headers,http_get_parameters,http_post_parameters,iri_fragment],
160+
io: "both",
161+
description: "RDF/XML format.",
162+
parameters: [
163+
resource,
164+
format,
165+
compression,
166+
limit,
167+
base,
168+
http_headers,
169+
http_get_parameters,
170+
http_post_parameters,
171+
iri_fragment,
172+
],
71173
},
72174

73-
turtle : {
175+
turtle: {
74176
name: `turtle`,
75-
io: 'both',
76-
description: 'RDF Turtle format.',
77-
parameters: [resource,format,compression,limit,base,http_headers,http_get_parameters,http_post_parameters,iri_fragment],
177+
io: "both",
178+
description: "RDF Turtle format.",
179+
parameters: [
180+
resource,
181+
format,
182+
compression,
183+
limit,
184+
base,
185+
http_headers,
186+
http_get_parameters,
187+
http_post_parameters,
188+
iri_fragment,
189+
],
78190
},
79191

80-
sparql : {
192+
sparql: {
81193
name: `sparql`,
82-
io: 'import',
83-
description: 'SPARQL query format.',
84-
parameters: [endpoint,query,http_headers,http_get_parameters,http_post_parameters,iri_fragment],
194+
io: "import",
195+
description: "SPARQL query format.",
196+
parameters: [
197+
endpoint,
198+
query,
199+
http_headers,
200+
http_get_parameters,
201+
http_post_parameters,
202+
iri_fragment,
203+
],
85204
},
86205

87-
json : {
206+
json: {
88207
name: `json`,
89-
io: 'import',
90-
description: 'JSON triples.',
91-
parameters: [resource,format,compression,http_headers,http_get_parameters,http_post_parameters,iri_fragment],
208+
io: "import",
209+
description: "JSON triples.",
210+
parameters: [
211+
resource,
212+
format,
213+
compression,
214+
http_headers,
215+
http_get_parameters,
216+
http_post_parameters,
217+
iri_fragment,
218+
],
92219
},
93220
});
94221

95-
export function supportsDirection(format: Format, direction: Direction): boolean{
96-
return format.io === direction || format.io === 'both';
97-
}
222+
export function supportsDirection(
223+
format: Format,
224+
direction: Direction,
225+
): boolean {
226+
return format.io === direction || format.io === "both";
227+
}

0 commit comments

Comments
 (0)