mirror of
https://github.com/LamGC/wp-asciiplayer.git
synced 2025-04-29 14:17:32 +00:00
docs: Add a Readme document for the adapter.
This commit is contained in:
parent
fba2455772
commit
bd1895f79b
4
.gitignore
vendored
4
.gitignore
vendored
@ -47,6 +47,4 @@ wp-config.php
|
||||
# uncomment the next line
|
||||
#/wp-content/themes
|
||||
|
||||
.idea/
|
||||
node_modules/
|
||||
dist/
|
||||
.idea/
|
2
asciiplayer/.gitignore
vendored
Normal file
2
asciiplayer/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
dist/
|
||||
node_modules/
|
16
asciiplayer/README.md
Normal file
16
asciiplayer/README.md
Normal file
@ -0,0 +1,16 @@
|
||||
# wp-asciiplayer-adapter
|
||||
|
||||
This library needs to be used with the WordPress Ascicast Player plugin.
|
||||
|
||||
## How to work
|
||||
|
||||
The Asciicast Player plugin will generate a div element containing the parameters required for asciicast playback for the asciiplayer short code in the post:
|
||||
|
||||
```html
|
||||
<div class="asciiplayer-container"
|
||||
data-ap-src="https://asciinema.org/a/28307.cast"
|
||||
data-ap-opts="%7B%22fit%22%3A%22width%22%2C%22preload%22%3Atrue%7D">
|
||||
</div>
|
||||
```
|
||||
|
||||
Then, the adapter will search for these div elements and use [asciinema-player](https://www.npmjs.com/package/asciinema-player) to create an Asciicast player within the div elements.
|
52
readme.txt
Normal file
52
readme.txt
Normal file
@ -0,0 +1,52 @@
|
||||
=== Asciicast Player ===
|
||||
Contributors: lamgc
|
||||
Tags: asciicast, asciiplayer, asciinema
|
||||
Requires at least: 5.2
|
||||
Tested up to: 6.2
|
||||
Stable tag: 0.1.0
|
||||
Requires PHP: 7.4
|
||||
License: GPLv3
|
||||
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
Asciinema-Player for WordPress.
|
||||
|
||||
== Description ==
|
||||
|
||||
This plugin helps you insert Asciicast files into the post, better presenting terminal operations to readers.
|
||||
|
||||
## Quick start
|
||||
|
||||
Add a shortcode to the post and enter the following:
|
||||
|
||||
```
|
||||
[asciiplayer]https://asciinema.org/a/28307.cast[/asciiplayer]
|
||||
```
|
||||
|
||||
The content of the shortcode is the URL of the ascicast file.
|
||||
|
||||
### Options
|
||||
|
||||
The AsciiPlayer shortcode supports the options supported by Asciinema-player, such as setting `fit` to `height` and closing the control bar:
|
||||
|
||||
```
|
||||
[asciiplayer fit="height" controls="false"]https://asciinema.org/a/28307.cast[/asciiplayer]
|
||||
```
|
||||
|
||||
You can find all available options [here](https://www.npmjs.com/package/asciinema-player#options).
|
||||
|
||||
> Currently, only the `logger` option is not supported because it requires an object to be passed in.
|
||||
|
||||
#### Style options
|
||||
|
||||
For the convenience of customizing player elements,
|
||||
the plugin has added an additional `style` **option**,
|
||||
which corresponds to the `style` **attribute** of the player container element:
|
||||
|
||||
```
|
||||
[asciiplayer style="width: 80%;"]https://asciinema.org/a/28307.cast[/asciiplayer]
|
||||
```
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 0.1.0 =
|
||||
* The first available version.
|
Loading…
Reference in New Issue
Block a user