Skip to content
This repository has been archived by the owner on Dec 28, 2022. It is now read-only.

Commit

Permalink
refactor: paragraph and block attribute (#127)
Browse files Browse the repository at this point in the history
* 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
ldez authored and nicorikken committed May 21, 2016
1 parent f6e6c68 commit 64dd90f
Show file tree
Hide file tree
Showing 41 changed files with 3,387 additions and 1,809 deletions.
2,830 changes: 1,783 additions & 1,047 deletions grammars/language-asciidoc.cson

Large diffs are not rendered by default.

22 changes: 10 additions & 12 deletions grammars/repositories/asciidoc-grammar.cson
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,19 @@ patterns: [
,
include: '#attribute-entry'
,
include: '#block-title'
,
include: '#explicit-paragraph'
include: '#blocks'
,
include: '#section'
include: '#block-title'
,
include: '#tables'
,
include: '#blocks'
,
include: '#horizontal-rule'
,
include: '#list'
,
include: '#inlines'
,
include: '#block-attribute'
,
include: '#line-break'
]
Expand All @@ -37,23 +35,23 @@ repository:
patterns: [
include: '#front-matter-block'
,
include: '#admonition-block'
include: '#admonition-paragraph'
,
include: '#quote-block'
include: '#quote-paragraph'
,
include: '#code-blocks'
include: '#source-paragraphs'
,
include: '#passthrough-paragraph'
,
include: '#example-block'
,
include: '#sidebar-block'
,
include: '#literal-block'
,
include: '#passthrough-block'
,
include: '#open-block'
]
'code-blocks':
'source-paragraphs':
patterns: [
include: '#source-asciidoctor'
,
Expand Down
21 changes: 0 additions & 21 deletions grammars/repositories/blocks/admonition-grammar.cson

This file was deleted.

78 changes: 78 additions & 0 deletions grammars/repositories/blocks/admonition-paragraph-grammar.cson
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}*$'
]
19 changes: 0 additions & 19 deletions grammars/repositories/blocks/passthrough-grammar.cson

This file was deleted.

71 changes: 71 additions & 0 deletions grammars/repositories/blocks/passthrough-paragraph-grammar.cson
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'
]
52 changes: 0 additions & 52 deletions grammars/repositories/blocks/quote-grammar.cson

This file was deleted.

Loading

0 comments on commit 64dd90f

Please sign in to comment.