Skip to content

Commit 6a504e3

Browse files
authored
new: Adds data for doctypes (#11)
* new: Adds doctype data * update: Add doctype exports * docs: Fix readme links * build: Add back coverage thresholds
1 parent 2b59bb6 commit 6a504e3

10 files changed

Lines changed: 85 additions & 7 deletions

File tree

jest.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
module.exports = {
22
collectCoverageFrom: ['packages/*/src/**/*.ts', 'scripts/**/*.ts'],
33
coverageDirectory: 'coverage',
4+
coverageThreshold: {
5+
global: {
6+
statements: 0,
7+
branches: 0,
8+
functions: 0,
9+
lines: 0,
10+
},
11+
},
412
coveragePathIgnorePatterns: ['/node_modules/', '/dist/', '/test/'],
513
moduleFileExtensions: ['ts', 'tsx', 'js', 'json', 'node'],
614
moduleNameMapper: {

packages/data/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
[msotype]:
2-
https://github.com/email-types/email-types/tree/master/packages/msotype
1+
[msotype]: https://github.com/email-types/email-types/msotype
32
[stylis-plugin-mso]:
4-
https://github.com/email-types/email-types/tree/master/packages/stylis-plugin-mso
3+
https://github.com/email-types/email-types/stylis-plugin-mso
54

65
# Email Types Data
76

packages/data/doctypes.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './dist/doctypes';

packages/data/doctypes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('./dist/doctypes');

packages/data/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
"types": "dist/index.d.ts",
77
"files": [
88
"dist",
9+
"doctypes.d.ts",
10+
"doctypes.js",
911
"index.d.ts",
1012
"index.js",
1113
"mso.d.ts",
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import { Doctypes, Doctype } from '../types/doctypes';
2+
3+
export { Doctypes, Doctype };
4+
5+
export const doctypes: Doctypes = {
6+
'HTML 5': {
7+
description:
8+
'A doctype declaration which is very short, due to its lack of references to a Document Type Definition (DTD) in the form of a URL or FPI. All it contains is the tag name of the root element of the document, HTML.',
9+
element: 'html',
10+
keyword: null,
11+
publicIdentifier: null,
12+
systemIdentifier: null,
13+
},
14+
'HTML 4.01 Strict': {
15+
description:
16+
'A strict doctype declaration which validates against the HTML 4.01 spec, although it doesn\'t allow any presentational markup or deprecated elements (such as `<font>` elements) or framesets to be used. It validates loose HTML style markup, such as minimized attributes and non-quoted attributes (eg required, rather than required="required")',
17+
element: 'HTML',
18+
keyword: 'PUBLIC',
19+
publicIdentifier: '-//W3C//DTD HTML 4.01//EN',
20+
systemIdentifier: 'http://www.w3.org/TR/html4/strict.dtd',
21+
},
22+
'HTML 4.01 Transitional': {
23+
description:
24+
'A transitional doctype declaration which validates against the HTML 4.01 spec. It allows some presentational markup and deprecated elements (such as <font> elements) but not framesets. It validates loose HTML style markup, such as minimized attributes and non-quoted attributes (eg required, rather than required="required")',
25+
element: 'HTML',
26+
keyword: 'PUBLIC',
27+
publicIdentifier: '-//W3C//DTD HTML 4.01 Transitional//EN',
28+
systemIdentifier: 'http://www.w3.org/TR/html4/loose.dtd',
29+
},
30+
'XHTML 1.1': {
31+
description: '',
32+
element: 'html',
33+
keyword: 'PUBLIC',
34+
publicIdentifier: '-//W3C//DTD XHTML 1.1//EN',
35+
systemIdentifier: 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd',
36+
},
37+
'XHTML 1.0 Strict': {
38+
description:
39+
"A strict doctype declaration which validates against the HTML 4.01 spec, although it doesn't allow any presentational markup or deprecated elements (such as `<font>` elements) or framesets to be used. Unlike the `HTML 4.01 Strict` doctype, it does not validate loose HTML style markup.",
40+
element: 'html',
41+
keyword: 'PUBLIC',
42+
publicIdentifier: '-//W3C//DTD XHTML 1.0 Strict//EN',
43+
systemIdentifier: 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd',
44+
},
45+
'XHTML 1.0 Transitional': {
46+
description:
47+
'A transitional doctype declaration which validates against the HTML 4.01 spec. It allows some presentational markup and deprecated elements (such as <font> elements) but not framesets. Unlike the `HTML 4.01 Transitional` doctype, it does not validate loose HTML style markup.',
48+
element: 'html',
49+
keyword: 'PUBLIC',
50+
publicIdentifier: '-//W3C//DTD XHTML 1.0 Transitional//EN',
51+
systemIdentifier: 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd',
52+
},
53+
};

packages/data/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export * from './mso';
2+
export * from './doctypes';
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Link } from './misc';
2+
3+
export type Doctype = {
4+
description?: string;
5+
element: 'html' | 'HTML';
6+
keyword: 'PUBLIC' | 'SYSTEM' | null;
7+
publicIdentifier: string | null;
8+
systemIdentifier: string | null;
9+
links?: Link[];
10+
};
11+
12+
export type Doctypes = Record<string, Doctype>;

packages/data/src/types/misc.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export type Link = {
2+
title: 'Microsoft' | 'MDN' | 'W3C' | 'Wikipedia' | (string & {});
3+
url: string;
4+
};

packages/data/src/types/mso.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
type Link = {
2-
title: 'Microsoft' | 'MDN' | (string & {});
3-
url: string;
4-
};
1+
import { Link } from './misc';
52

63
export type Property = {
74
syntax: string;

0 commit comments

Comments
 (0)