urbanmonastics/sourcetextlibrary
Composer 安装命令:
composer require urbanmonastics/sourcetextlibrary
包简介
A simple way to load, read, and present texts from various source text libraries.
README 文档
README
A simple way to load, read, and present texts from various Source Text libraries.
This is a companion library to the Source Text Parser library.
Features
- Quickly load one or many source text libraries
- Navigate to desired texts or segments and render them for display.
Adding to your Project
Install the composer package:
composer require UrbanMonastics/SourceTextLibrary
Example Usage
In the most simple approach you can pass text to be parsed.
$SourceTextLibrary = new /UrbanMonastics/SourceTextLibrary(); echo $SourceTextLibrary->text("Hello *Source Parser*!"); # prints: <p>Hello <em>Source Parser</em>!</p>
You can also take advantage of the structure of the source texts.
$SourceTextLibrary = new SourceTextLibrary(); // Load the source data into the parser $Source = json_decode( file_get_contents('path/to/source.json'), true ); $SourceTextLibrary->loadSource( $Source ); $SourceTextLibrary->loadText(); echo $SourceTextLibrary->text("Hello *Source Parser*!"); # prints: <p>Hello <em>Source Parser</em>!</p> // Clear the loaded Source and Texts - without altering other options $SourceTextLibrary->clearSource();
统计信息
- 总下载量: 501
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-25