geissler/csl
Composer 安装命令:
composer require geissler/csl
包简介
A php processor for the citation style language CSL (http://citationstyles.org)
README 文档
README
This project is still in an early alpha state, nearly the half of the tests are failing. The goal is to implement a parser which is 100% compatible with the CSL 1.0.1 standard, 100% clean OOP and follows the PSR-2 coding standard.
Installation
Via composer
Add to the composer.json the require key and run composer install.
"require" : {
"geissler/csl": "dev-master"
}
Other
Make sure you are using a PSR-2 compatible autoloader.
Usage
Render a single bibliography entry.
// include the composer autoloader require __DIR__ . '/vendor/autoload.php'; use Geissler\CSL\CSL; // the name of the style you want to use $style = 'american-journal-of-archaeology'; // the data do be displayed as a json array $input = '[ { "id": "ITEM-1", "author" : [ { "family": "Wallace-Hadrill", "given": "Andrew" } ], "issued": { "date-parts": [ [ "2011" ] ] }, "title": "The monumental centre of Herculaneum. In search of the identities of the public buildings", "container-title" : "Journal of Roman Archaeology", "volume" : "24", "page" : "121-160", "original-publisher-place" : "Ann Arbor, Mich.", "type": "article-journal" } ]'; $csl = new CSL(); echo $csl->bibliography($style, $input); // this will output the following Wallace-Hadrill, Andrew. 2011. "The monumental centre of Herculaneum. In search of the identities of the public buildings". Journal of Roman archaeology 24: 121-160.
As HTML
<div class="csl-bib-body"> <div class="csl-entry">Wallace-Hadrill, Andrew. 2011. "The monumental centre of Herculaneum. In search of the identities of the public buildings". <font style="font-style:italic">Journal of Roman archaeology</font> 24: 121-160.</div> </div>
Configuration
The following options can be configured via the configuration.ini:
- locale-group
- dir = Path to the locales files relative to the configuration.ini (standard: locale)
- file = Filename of the language files, where LANGUAGE represents de-DE, en-US (standard: locales-LANGUAGE.xml)
- dialects = A JSON array with the main dialects for languages spoken in more than one country.
- styles-group
- dir = Path to the styles dir relative to the configuration.ini (standard: styles)
Styles and Locales
The files under styles are taken from the CSL styles repository and the files under locales are taken from the CSL locales repository.
Tests and Comments
Most of the examples for the phpunit-tests under tests/src, all files in tests/citeproc-test and some comments are taken/copied from CiteProc Test, "the standard test bundle for use in CSL processor and style development" written by Frank G. Bennett, Jr. and Bruce D'Arcus.
geissler/csl 适用场景与选型建议
geissler/csl 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12 次下载、GitHub Stars 达 1, 最近一次更新时间为 2013 年 01 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「csl」 「citation」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 geissler/csl 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 geissler/csl 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 geissler/csl 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
BibTex Parser provides an API to read .bib files programmatically
A small library to convert different bibliography formats into each other. Forked from 'geissler/converter'.
A Semantic MediaWiki extension to manage citation resources.
Support laravel5.* toastr is a Javascript library for non-blocking notifications. jQuery is required. The goal is to create a simple core library that can be customized and extended.
OJS Advanced Citation Bundle
BibTex Parser provides an API to read .bib files programmatically (forked from renanbr/bibtex-parser)
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-01-24