This repository has been archived by the owner on Dec 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: paragraph and block attribute (#127)
* refactor: paragraph and block attribute refactor: limits refactor: prepare source block refactor: source paragraphs generator refactor: source for open block refactor: fix all tests feat: air quotes refactor: review refactor: add diagram keywords feat: passthrough paragraph feat: more tests * refactor: remove dead CSS
- Loading branch information
1 parent
f6e6c68
commit 64dd90f
Showing
41 changed files
with
3,387 additions
and
1,809 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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 was deleted.
Oops, something went wrong.
78 changes: 78 additions & 0 deletions
78
grammars/repositories/blocks/admonition-paragraph-grammar.cson
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,78 @@ | ||
key: 'admonition-paragraph' | ||
|
||
patterns: [ | ||
|
||
# Matches admonition blocks | ||
# | ||
# Examples: | ||
# | ||
# [TIP] | ||
# Most features | ||
# | ||
# or | ||
# | ||
# [IMPORTANT, attrs1, attrs2] | ||
# .foo bar foo | ||
# ==== | ||
# foobar | ||
# ==== | ||
# | ||
# or | ||
# | ||
# [IMPORTANT, attrs1, attrs2] | ||
# .foo bar foo | ||
# -- | ||
# foobar | ||
# -- | ||
# | ||
name: 'markup.admonition.asciidoc' | ||
begin: '(?=(?>(?:^\\[(NOTE|TIP|IMPORTANT|WARNING|CAUTION)((?:,|#)[^\\]]+)*\\]$)))' | ||
patterns: [ | ||
match: '^\\[(NOTE|TIP|IMPORTANT|WARNING|CAUTION)((?:,|#)([^,\\]]+))*\\]$' | ||
captures: | ||
0: | ||
patterns: [ | ||
include: '#block-attribute-inner' | ||
] | ||
, | ||
include: '#inlines' | ||
, | ||
include: '#block-title' | ||
, | ||
comment: 'example block' | ||
begin: '^(={4,})\\s*$' | ||
patterns: [ | ||
include: '#inlines' | ||
, | ||
include: '#list' | ||
] | ||
end: '(?<=\\1)' | ||
, | ||
comment: 'open block' | ||
begin: '^(-{2})\\s*$' | ||
patterns: [ | ||
include: '#inlines' | ||
, | ||
include: '#list' | ||
] | ||
end: '(?<=\\1)' | ||
] | ||
end: '((?<=--|====)[\\r\\n]+$|^\\p{Blank}*$)' | ||
, | ||
# Matches admonition blocks | ||
# | ||
# Examples | ||
# | ||
# TIP: Pro tip... | ||
# | ||
# IMPORTANT: Don't forget... | ||
# | ||
name: 'markup.admonition.asciidoc' | ||
begin: '^(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\\:\\p{Blank}+' | ||
captures: | ||
1: name: 'entity.name.function.asciidoc' | ||
patterns: [ | ||
include: '#inlines' | ||
] | ||
end: '^\\p{Blank}*$' | ||
] |
This file was deleted.
Oops, something went wrong.
71 changes: 71 additions & 0 deletions
71
grammars/repositories/blocks/passthrough-paragraph-grammar.cson
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,71 @@ | ||
key: 'passthrough-paragraph' | ||
|
||
patterns: [ | ||
|
||
# Matches passthrough paragraph. | ||
# | ||
# Examples: | ||
# | ||
# [pass] | ||
# <s>Could be struck through</s> | ||
# | ||
# or | ||
# | ||
# [pass, attrs1, attrs2] | ||
# .foo bar foo | ||
# -- | ||
# <s>Could be struck through</s> | ||
# -- | ||
# | ||
# or | ||
# | ||
# [pass, attrs1, attrs2] | ||
# .foo bar foo | ||
# ++++ | ||
# <s>Could be struck through</s> | ||
# ++++ | ||
# | ||
name: 'markup.block.passthrough.asciidoc' | ||
begin: '(?=(?>(?:^\\[(pass)((?:,|#)[^\\]]+)*\\]$)))' | ||
patterns: [ | ||
match: '^\\[(pass)((?:,|#)([^,\\]]+))*\\]$' | ||
captures: | ||
0: | ||
name: 'markup.heading.asciidoc' | ||
patterns: [ | ||
include: '#block-attribute-inner' | ||
] | ||
, | ||
include: '#block-title' | ||
, | ||
comment: 'passthrough block' | ||
begin: '^(\\+{4,})\\s*$' | ||
patterns: [ | ||
include: 'text.html.basic' | ||
] | ||
end: '(?<=\\1)' | ||
, | ||
comment: 'open block' | ||
begin: '^(-{2})\\s*$' | ||
patterns: [ | ||
include: 'text.html.basic' | ||
] | ||
end: '(?<=\\1)' | ||
] | ||
end: '((?<=--|\\+\\+)[\\r\\n]+$|^\\p{Blank}*$)' | ||
, | ||
# Matches passthrough block | ||
# | ||
# Examples | ||
# | ||
# ++++ | ||
# <s>Could be struck through</s> | ||
# ++++ | ||
# | ||
name: 'markup.block.passthrough.asciidoc' | ||
begin: '(^\\+{4,}$)' | ||
patterns: [ | ||
include: 'text.html.basic' | ||
] | ||
end: '\\1' | ||
] |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.