PHPackages                             8fold/commonmark-abbreviations - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. 8fold/commonmark-abbreviations

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

8fold/commonmark-abbreviations
==============================

An extension of PHP League's CommonMark library to enable abbreviation usage.

2.1.0(4y ago)111.3k1[5 issues](https://github.com/8fold/commonmark-abbreviations/issues)[2 PRs](https://github.com/8fold/commonmark-abbreviations/pulls)1MITPHPPHP ^7.2|^8.0CI failing

Since Jul 7Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/8fold/commonmark-abbreviations)[ Packagist](https://packagist.org/packages/8fold/commonmark-abbreviations)[ GitHub Sponsors](https://github.com/8fold)[ GitHub Sponsors](https://github.com/joshbruce)[ RSS](/packages/8fold-commonmark-abbreviations/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (10)Dependencies (4)Versions (14)Used By (1)

8fold Abbreviations for CommonMark
==================================

[](#8fold-abbreviations-for-commonmark)

This library is an extension for the [CommonMark parser](https://github.com/thephpleague/commonmark) from the PHP League adding abbreviation syntax and rendering to Markdown.

> Warning: This text is written using that syntax enabling extension testing; therefore, it will most likely not render as intended without a rendering extension using this syntax.

Installation
------------

[](#installation)

```
composer require 8fold/commonmark-abbreviations
```

Usage
-----

[](#usage)

2.1.0 to 3.0.0
--------------

[](#210-to-300)

```
[.Eightfold](8fold)
```

Becomes:

```
8fold
```

You MAY also use the syntax prior to 2.1.0.

2.0.0 and before
----------------

[](#200-and-before)

```
[.8fold](Eightfold)
```

Becomes:

```
8fold
```

The syntax
----------

[](#the-syntax)

Inspired by the link syntax - `[]()` - and the footnote syntax in the extension from MultiMarkdown - `[^]`.

The syntax is a square bracket followed by a period or dot: `[.]()`.

Just like the footnote indicates superscript, the abbreviation syntax was found to indicate shortening to more people than previously proposed options. Placing the dot inside the opening square bracket allows the abbreviation to exist next to other glyphs as opposed to forcing empty space. (A conversation in the \[CommonMark [.Spec](Specification) board\]() was also referenced, and informative.)

Given the traditional use of the `abbr` tag commonly combined with the `title` attribute, the link syntax makes sense as the `a` tag combines inner text with `href` and the `img` tag uses two attributes, `src` and `alt` to be valid and accessible.

Replace-all [.vs.](versus) inline
---------------------------------

[](#replace-all-vs-inline)

We decided to go with inline, single instance over footer, replace-all.

Two main options exist for implementing this capability.

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.

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.

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:

- Try to keep them to a maximum of two a page.
- Use them if spelling them out would annoy your readers.
- If you must use an abbreviation or acronym, spell it out the first time you use it. For example: \[.CBT\](Computer-based training).

As a document editor and author, I tend to recommend defining "first use" as "first use per section," where "section" is further defined as beginning with a header; so, if writing a 20 page document and an abbreviation is defined on page one, it's poor \[.UX\](user experience) to require a reader on page 20 to turn back to page one to jog their memory of the abbreviation's definition. This also speaks to the definitions being at the end of the document, similar to a glossary.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance40

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 93.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~53 days

Recently: every ~61 days

Total

11

Last Release

1654d ago

Major Versions

0.1.1 → 1.0.02020-07-30

1.2.0 → 2.0.02021-08-15

PHP version history (2 changes)0.1.0PHP ^7.2

1.0.3PHP ^7.2|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3ff7aa36dc04c5b535cd71eadbf66038401edde0c9dfaa688bec4fc16c6d7e8b?d=identicon)[eightfold](/maintainers/eightfold)

---

Top Contributors

[![joshbruce](https://avatars.githubusercontent.com/u/15252830?v=4)](https://github.com/joshbruce "joshbruce (27 commits)")[![Ambient-Impact](https://avatars.githubusercontent.com/u/2289006?v=4)](https://github.com/Ambient-Impact "Ambient-Impact (2 commits)")

---

Tags

abbreviationshtml

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/8fold-commonmark-abbreviations/health.svg)

```
[![Health](https://phpackages.com/badges/8fold-commonmark-abbreviations/health.svg)](https://phpackages.com/packages/8fold-commonmark-abbreviations)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.5k10](/packages/helsingborg-stad-municipio)[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

23.9k69.5k](/packages/grumpydictator-firefly-iii)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[roundcube/roundcubemail

The Roundcube Webmail suite

7.1k2.4k3](/packages/roundcube-roundcubemail)[phlak/directory-lister

PHP directory lister

2.5k1.4k](/packages/phlak-directory-lister)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
