Skip to content

Commit ad5d77d

Browse files
authored
Merge pull request #15 from 8fold/dual-syntax
Dual syntax
2 parents cf5d34a + 197c3b2 commit ad5d77d

File tree

13 files changed

+293
-100
lines changed

13 files changed

+293
-100
lines changed

.github/workflows/php.yml

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
1-
name: PHP Composer
1+
name: PHP 7.4
2+
23
on:
34
push:
4-
branches:
5-
- master
5+
branches: [main]
66
pull_request:
7-
branches:
8-
- master
9-
7+
branches: [main]
108
jobs:
119
build:
12-
1310
runs-on: ubuntu-latest
14-
1511
steps:
16-
- name: Checkout
17-
uses: actions/checkout@v2
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
15+
- name: Setup PHP Action
16+
uses: shivammathur/[email protected]
17+
with:
18+
php-version: '7.4'
19+
20+
- name: Validate composer.json and composer.lock
21+
run: composer validate
1822

19-
- name: Setup PHP Action
20-
uses: shivammathur/[email protected]
21-
with:
22-
php-version: '7.4'
23+
- name: Install dependencies
24+
run: composer install --prefer-dist --no-progress
2325

24-
- name: Validate composer.json and composer.lock
25-
run: composer validate
26+
- name: Run style check
27+
run: composer run style
2628

27-
- name: Install dependencies
28-
run: composer install --prefer-dist --no-progress --no-suggest
29+
- name: Run static analyzer
30+
run: composer run stan
2931

30-
- name: Run test suite
31-
run: vendor/bin/phpunit
32+
- name: Run tests
33+
run: composer run test

.github/workflows/php8.yml

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
1-
name: PHP Composer
1+
name: PHP 8.0
2+
23
on:
34
push:
4-
branches:
5-
- master
5+
branches: [main]
66
pull_request:
7-
branches:
8-
- master
7+
branches: [main]
98

109
jobs:
1110
build:
12-
1311
runs-on: ubuntu-latest
14-
1512
steps:
16-
- name: Checkout
17-
uses: actions/checkout@v2
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
16+
- name: Setup PHP Action
17+
uses: shivammathur/[email protected]
18+
with:
19+
php-version: '8.0'
20+
21+
- name: Validate composer.json and composer.lock
22+
run: composer validate
1823

19-
- name: Setup PHP Action
20-
uses: shivammathur/[email protected]
21-
with:
22-
php-version: '8.0'
24+
- name: Install dependencies
25+
run: composer install --prefer-dist --no-progress
2326

24-
- name: Validate composer.json and composer.lock
25-
run: composer validate
27+
- name: Run style check
28+
run: composer run style
2629

27-
- name: Install dependencies
28-
run: composer install --prefer-dist --no-progress --no-suggest
30+
- name: Run static analyzer
31+
run: composer run stan
2932

30-
- name: Run test suite
31-
run: vendor/bin/phpunit
33+
- name: Run tests
34+
run: composer run test

README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,26 @@ composer require 8fold/commonmark-abbreviations
1212

1313
## Usage
1414

15+
16+
17+
## 2.1.0 to 3.0.0
18+
19+
```markdown
20+
[.Eightfold](8fold)
21+
```
22+
23+
Becomes:
24+
25+
```html
26+
<abbr title="Eightfold">8fold</abbr>
27+
```
28+
29+
You MAY also use the syntax prior to 2.1.0.
30+
31+
## 2.0.0 and before
32+
1533
```markdown
16-
[.8fold](Eigtfold)
34+
[.8fold](Eightfold)
1735
```
1836

1937
Becomes:
@@ -38,11 +56,11 @@ We decided to go with inline, single instance over footer, replace-all.
3856

3957
Two main options exist for implementing this capability.
4058

41-
The first is to place the abbreviation and definition at the bottom of the document and render all occurences of the abbreviation with the `abbr` element and title. The drawback here is possible impact to readers using [.AT](Assistive Technology) like screen readers; potentially being read the full abbreviation each time.
59+
The first is to place the abbreviation and definition at the bottom of the document and render all occurrences of the abbreviation with the `abbr` element and title. The drawback here is possible impact to readers using [.AT](Assistive Technology) like screen readers; potentially being read the full abbreviation each time.
4260

4361
The second option is to have the abbreviation be inline with the surrounding text. The drawback here is the need to write more each time an author uses the abbreviation.
4462

45-
This library looks at Markdown as being a way of writing potentially rich-text documents first, which can be transformed into [.HTML](Hypertext Markup Language) or something else. The recomendation from the [[.US](United States) Plain Language Guidelines](https://plainlanguage.gov/resources/articles/keep-it-jargon-free/) is to avoid abbreviations and acronyms in general and specifically to:
63+
This library looks at Markdown as being a way of writing potentially rich-text documents first, which can be transformed into [.Hypertext Markup Language](HTML) or something else. The recommendation from the [[.US](United States) Plain Language Guidelines](https://plainlanguage.gov/resources/articles/keep-it-jargon-free/) is to avoid abbreviations and acronyms in general and specifically to:
4664

4765
- Try to keep them to a maximum of two a page.
4866
- Use them if spelling them out would annoy your readers.

composer.json

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
"league/commonmark": "^2.0.2"
1515
},
1616
"require-dev": {
17-
"phpunit/phpunit": "^9.1"
17+
"phpstan/phpstan": "^1.2.0",
18+
"phpunit/phpunit": "^9.5",
19+
"squizlabs/php_codesniffer": "^3.6"
1820
},
1921
"autoload": {
2022
"psr-4": {
@@ -31,6 +33,15 @@
3133
"preferred-install": "dist",
3234
"sort-packages": true
3335
},
34-
"minimum-stability": "dev",
35-
"prefer-stable": true
36+
"config": {
37+
"preferred-install": "dist"
38+
},
39+
"prefer-stable": true,
40+
"scripts": {
41+
"prod": "@production",
42+
"production": ["@style", "@stan", "@test"],
43+
"style": "./vendor/bin/phpcs --standard=phpcs.xml -p ./src",
44+
"stan": "./vendor/bin/phpstan analyze",
45+
"test": "./vendor/bin/phpunit"
46+
}
3647
}

0 commit comments

Comments
 (0)