Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/letsjump/yii2-anchorjs
A JavaScript utility for adding deep anchor links (like these) to existing page content. AnchorJS is lightweight, accessible, and has no dependencies.
https://github.com/letsjump/yii2-anchorjs
Last synced: about 6 hours ago
JSON representation
A JavaScript utility for adding deep anchor links (like these) to existing page content. AnchorJS is lightweight, accessible, and has no dependencies.
- Host: GitHub
- URL: https://github.com/letsjump/yii2-anchorjs
- Owner: letsjump
- License: mit
- Created: 2020-02-15T11:29:13.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-16T08:24:10.000Z (over 4 years ago)
- Last Synced: 2024-11-12T04:05:07.677Z (2 months ago)
- Language: PHP
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- License: LICENSE
Awesome Lists containing this project
README
AnchorJS
========
Yii2 wrapper for [AnchorJS](https://www.bryanbraun.com/anchorjs) that adds deep anchor links to your Yii docs.Overview
--------
AnchorJS lets you drop deep anchor links (like these) onto any webpage, and be on your way.You don't need to set up IDs or worry about urls. AnchorJS will respect your IDs if you have them, and generate them if you don't.
It uses an attractive link icon by default, but you can customize the display via options and CSS styling. The examples demonstrate a few customization ideas.
Finally, AnchorJS is lightweight, accessible, and dependency-free.
Example: [The bootstrap manual](https://getbootstrap.com/docs/3.4/javascript/):
![bootstrap](https://user-images.githubusercontent.com/284998/74590818-4544ed80-5012-11ea-9103-97be6a1fe17a.jpg)
Installation
------------The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Either run
```
php composer.phar require --prefer-dist letsjump/yii2-anchorjs "*"
```or add
```
"letsjump/yii2-anchorjs": "*"
```to the require section of your `composer.json` file.
Usage
-----Once the extension is installed, simply add this in any view that need it.
Please refer to the [plugin documentation page](https://www.bryanbraun.com/anchorjs/) for an extended usage guide```php
= \letsjump\AnchorJS\AnchorJS::widget([
'add' => 'h1, h2',
'options' => [
'placement'=>'right',
'icon'=>'',
// ... refer to https://www.bryanbraun.com/anchorjs/#options for any option available
],
]); ?>```
Application wide configuration
---------------------You can set an application wide configuration by adding its options to your /app/config/params.php
```php
'[email protected]',
'anchorjs' => [
'placement' => 'left',
'icon' => ''
// ... refer to https://www.bryanbraun.com/anchorjs/#options for any option available
],
];
```Contribution
------------