-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This defines a subset of the HTML spec as annotations. In the future, we'd like these to be automatically generated from the HTML spec.
- Loading branch information
Showing
33 changed files
with
411 additions
and
222 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { InlineAnnotation } from '@atjson/document'; | ||
|
||
export default class Anchor extends InlineAnnotation { | ||
static vendorPrefix = 'html'; | ||
static type = 'a'; | ||
attributes!: { | ||
href: string; | ||
target: string; | ||
rel: string; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { BlockAnnotation } from '@atjson/document'; | ||
|
||
export default class Blockquote extends BlockAnnotation { | ||
static vendorPrefix = 'html'; | ||
static type = 'blockquote'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { InlineAnnotation } from '@atjson/document'; | ||
|
||
export default class Bold extends InlineAnnotation { | ||
static vendorPrefix = 'html'; | ||
static type = 'b'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { ObjectAnnotation } from '@atjson/document'; | ||
|
||
export default class Break extends ObjectAnnotation { | ||
static vendorPrefix = 'html'; | ||
static type = 'br'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { InlineAnnotation } from '@atjson/document'; | ||
|
||
export default class Code extends InlineAnnotation { | ||
static vendorPrefix = 'html'; | ||
static type = 'code'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { InlineAnnotation } from '@atjson/document'; | ||
|
||
export default class DeletedText extends InlineAnnotation { | ||
static vendorPrefix = 'html'; | ||
static type = 'del'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { InlineAnnotation } from '@atjson/document'; | ||
|
||
export default class Emphasis extends InlineAnnotation { | ||
static vendorPrefix = 'html'; | ||
static type = 'em'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { BlockAnnotation } from '@atjson/document'; | ||
|
||
export default class Heading1 extends BlockAnnotation { | ||
static vendorPrefix = 'html'; | ||
static type = 'h1'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { BlockAnnotation } from '@atjson/document'; | ||
|
||
export default class Heading2 extends BlockAnnotation { | ||
static vendorPrefix = 'html'; | ||
static type = 'h2'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { BlockAnnotation } from '@atjson/document'; | ||
|
||
export default class Heading3 extends BlockAnnotation { | ||
static vendorPrefix = 'html'; | ||
static type = 'h3'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { BlockAnnotation } from '@atjson/document'; | ||
|
||
export default class Heading4 extends BlockAnnotation { | ||
static vendorPrefix = 'html'; | ||
static type = 'h4'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { BlockAnnotation } from '@atjson/document'; | ||
|
||
export default class Heading5 extends BlockAnnotation { | ||
static vendorPrefix = 'html'; | ||
static type = 'h5'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { BlockAnnotation } from '@atjson/document'; | ||
|
||
export default class Heading6 extends BlockAnnotation { | ||
static vendorPrefix = 'html'; | ||
static type = 'h6'; | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/@atjson/source-html/src/annotations/horizontal-rule.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { ObjectAnnotation } from '@atjson/document'; | ||
|
||
export default class HorizontalRule extends ObjectAnnotation { | ||
static vendorPrefix = 'html'; | ||
static type = 'hr'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { ObjectAnnotation } from '@atjson/document'; | ||
|
||
export default class Image extends ObjectAnnotation { | ||
static vendorPrefix = 'html'; | ||
static type = 'img'; | ||
attributes!: { | ||
alt?: string; | ||
src: string; | ||
title?: string; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
export { default as Anchor } from './anchor'; | ||
export { default as Bold } from './bold'; | ||
export { default as Blockquote } from './blockquote'; | ||
export { default as Break } from './break'; | ||
export { default as Code } from './code'; | ||
export { default as DeletedText } from './deleted-text'; | ||
export { default as Emphasis } from './emphasis'; | ||
export { default as Heading1 } from './heading-1'; | ||
export { default as Heading2 } from './heading-2'; | ||
export { default as Heading3 } from './heading-3'; | ||
export { default as Heading4 } from './heading-4'; | ||
export { default as Heading5 } from './heading-5'; | ||
export { default as Heading6 } from './heading-6'; | ||
export { default as HorizontalRule } from './horizontal-rule'; | ||
export { default as Image } from './image'; | ||
export { default as Italic } from './italic'; | ||
export { default as ListItem } from './list-item'; | ||
export { default as OrderedList } from './ordered-list'; | ||
export { default as Paragraph } from './paragraph'; | ||
export { default as PreformattedText } from './preformatted-text'; | ||
export { default as Strikethrough } from './strikethrough'; | ||
export { default as Strong } from './strong'; | ||
export { default as Subscript } from './subscript'; | ||
export { default as Superscript } from './superscript'; | ||
export { default as UnorderedList } from './unordered-list'; | ||
export { default as Underline } from './underline'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { InlineAnnotation } from '@atjson/document'; | ||
|
||
export default class Italic extends InlineAnnotation { | ||
static vendorPrefix = 'html'; | ||
static type = 'i'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { BlockAnnotation } from '@atjson/document'; | ||
|
||
export default class ListItem extends BlockAnnotation { | ||
static vendorPrefix = 'html'; | ||
static type = 'li'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { BlockAnnotation } from '@atjson/document'; | ||
|
||
export default class OrderedList extends BlockAnnotation { | ||
static vendorPrefix = 'html'; | ||
static type = 'ol'; | ||
attributes!: { | ||
starts: string; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { BlockAnnotation } from '@atjson/document'; | ||
|
||
export default class Paragraph extends BlockAnnotation { | ||
static vendorPrefix = 'html'; | ||
static type = 'p'; | ||
|
||
get rank() { | ||
return super.rank * 3 / 2; | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/@atjson/source-html/src/annotations/preformatted-text.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { InlineAnnotation } from '@atjson/document'; | ||
|
||
export default class PreformattedText extends InlineAnnotation { | ||
static vendorPrefix = 'html'; | ||
static type = 'pre'; | ||
} |
6 changes: 6 additions & 0 deletions
6
packages/@atjson/source-html/src/annotations/strikethrough.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { InlineAnnotation } from '@atjson/document'; | ||
|
||
export default class Strikethrough extends InlineAnnotation { | ||
static vendorPrefix = 'html'; | ||
static type = 's'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { InlineAnnotation } from '@atjson/document'; | ||
|
||
export default class Strong extends InlineAnnotation { | ||
static vendorPrefix = 'html'; | ||
static type = 'strong'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { InlineAnnotation } from '@atjson/document'; | ||
|
||
export default class Subscript extends InlineAnnotation { | ||
static vendorPrefix = 'html'; | ||
static type = 'sub'; | ||
} |
Oops, something went wrong.