Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/vendor/
composer.lock
composer.lock
composer.phar
.vscode/
11 changes: 2 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
language: php

php:
- 5.3
- 5.4
- 5.5

matrix:
allow_failures:
- php: 5.5
- 7.0

before_script:
- composer install

script:
- pyrus install http://phptal.org/latest.tar.gz
- pear install pear/PHP_CodeSniffer
- phpenv rehash
- phpcs --standard=PSR2 src
- phpunit --coverage-text --bootstrap tests/bootstrap.php tests/

notifications:
email:
- [email protected]
- [email protected]

20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Converter
[![Build Status](https://travis-ci.org/geissler/converter.png?branch=master)](https://travis-ci.org/geissler/converter)
[![Build Status](https://travis-ci.org/ShadyChars/converter.png?branch=master)](https://travis-ci.org/ShadyChars/converter)

A small library to convert the input data for different literature standards like BibTeX, CSL etc. into each other.
At the moment are supported [BibTeX](http://en.wikipedia.org/wiki/BibTeX "BibTeX"),
Expand Down Expand Up @@ -46,7 +46,7 @@ To convert form one standard to an other:
$bibTeX = $converter->convert(new RIS($data), new BibTeX());

/**
* $bibTeX has know the following value:
* $bibTeX now has the following value:
*
* @article{article,
* author = {Einstein, Albert},
Expand All @@ -61,7 +61,7 @@ To convert form one standard to an other:
$csl = $converter->convert(new BibTeX($bibTeX), new CSL());

/**
* $csl has know the following value (a UTF-8 encoded json string):
* $csl now has the following value (a UTF-8 encoded json string):
*
* [
* {
Expand All @@ -83,6 +83,13 @@ To convert form one standard to an other:

```

## Limitations
The built-in BibTeX converter has the following limitations:

* Non-UTF-8 strings are converted to UTF-8
* LaTeX escape sequences are converted to UTF-8 characters
* Enclosing braces are discarded. (Neither CSL nor RIS support explicit capitalisation.)

## Adding a standard
To implement a new standard is quite simple:

Expand All @@ -94,5 +101,8 @@ To implement a new standard is quite simple:
5. Implement the methods **create** and **retrieve** in **Creator.php**
6. Implement the methods **parse** and **retrieve** in **Parser.php**
7. Don't forget to write your PHPUnit tests and follow the
[PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md "PSR-2") coding
standard
[PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md "PSR-2") coding standard

## Tests

Converter depends on PHPUnit. Ensure that your dependencies are up to date by running `composer update` then call `vendor\bin\phpunit tests` to run all the tests.
24 changes: 16 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,29 @@
{
"name":"Benjamin Geißler",
"email":"[email protected]"
},
{
"name":"Keith Houston",
"email":"[email protected]"
}
],
"require":{
"php":">=5.3.0",
"technosophos/LibRIS": "dev-master"
"php":">=7.2.34",
"technosophos/libris": ">=2.0.2"
},
"autoload":{
"psr-0":{
"Geissler":"src/"
"psr-4":{
"Geissler\\": "src/Geissler/"
},
"files": [
"library/bibtexParse/PARSEENTRIES.php",
"library/bibtexParse/PARSECREATORS.php",
"library/bibtexParse/PARSEMONTH.php",
"library/bibtexParse/PARSEPAGE.php"
"library/format/bibtexParse/PARSEENTRIES.php",
"library/format/bibtexParse/PARSECREATORS.php",
"library/format/bibtexParse/PARSEMONTH.php",
"library/format/bibtexParse/PARSEPAGE.php",
"library/format/BIBFORMAT.php"
]
},
"require-dev": {
"phpunit/phpunit": "^9.5"
}
}
Loading