Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Oh, HAI! No markdown extra? I canz fix.

  • Loading branch information...
commit 25350fab9da993bdcebefa36d801283568b58553 1 parent a0472ef
M Butcher authored
Showing with 110 additions and 116 deletions.
  1. +21 −21 README.mdown
  2. +89 −95 doc/RecordFormat.mdown
View
42 README.mdown
@@ -9,7 +9,7 @@ the RIS format.
RIS is used to encode metadata about references. The normative
reference for the format can be found here:
-http://www.refman.com/support/risformat_intro.asp
+[http://www.refman.com/support/risformat_intro.asp](http://www.refman.com/support/risformat_intro.asp)
General usage for this class is simple:
@@ -18,32 +18,32 @@ General usage for this class is simple:
Here's an example (from test/simple_test.php):
- <?php
- require_once '../src/LibRIS.php';
+ <?php
+ require_once '../src/LibRIS.php';
- $ris = new LibRIS();
- $ris->parseFile('./test1.ris');
+ $ris = new LibRIS();
+ $ris->parseFile('./test1.ris');
- $ris->printRecords();
+ $ris->printRecords();
- $records = $ris->getRecords();
+ $records = $ris->getRecords();
- $rw = new RISWriter();
- print $rw->writeRecords($records);
- ?>
+ $rw = new RISWriter();
+ print $rw->writeRecords($records);
+ ?>
-Line-by-line:
+Here's a line-by-line explanation of the code above:
- 1.
- 2. Include the library
- 3.
- 4. Create a new LibRIS reader
- 5. Parse a file
- 6.
- 7. Pretty-print the parsed records
- 8.
- 9. Create a new writer
- 10. Turn our parsed record back into a valid RIS record.
+ 1.
+ 2. Include the library
+ 3.
+ 4. Create a new LibRIS reader
+ 5. Parse a file
+ 6.
+ 7. Pretty-print the parsed records
+ 8.
+ 9. Create a new writer
+ 10. Turn our parsed record back into a valid RIS record.
The format of the records is documented in `doc/RecordFormat.mdown`.
View
184 doc/RecordFormat.mdown
@@ -2,108 +2,102 @@ This document describes the format of parsed data returned by LibRIS->parseFile(
Consider a record like this:
-~~~
-TY - JOUR
-JF - Ethics and Information Technology
-T1 - At the foundations of information justice
-VL - 11
-IS - 1
-SP - 57
-EP - 69
-PY - 2009/03/01/
-UR - http://dx.doi.org/10.1007/s10676-009-9181-2
-M3 - 10.1007/s10676-009-9181-2
-AU - Butcher, Matthew
-N2 - Abstract goes here....
-ER -
-~~~
+ TY - JOUR
+ JF - Ethics and Information Technology
+ T1 - At the foundations of information justice
+ VL - 11
+ IS - 1
+ SP - 57
+ EP - 69
+ PY - 2009/03/01/
+ UR - http://dx.doi.org/10.1007/s10676-009-9181-2
+ M3 - 10.1007/s10676-009-9181-2
+ AU - Butcher, Matthew
+ N2 - Abstract goes here....
+ ER -
We will run this code:
-~~~
-<?php
-require_once '../src/LibRIS.php';
+ <?php
+ require_once '../src/LibRIS.php';
-$ris = new LibRIS();
-$ris->parseFile('./short.ris');
-print_r($ris->getRecords());
-?>
-~~~
+ $ris = new LibRIS();
+ $ris->parseFile('./short.ris');
+ print_r($ris->getRecords());
+ ?>
The output of the above will be this:
-~~~
- Array
- (
- [0] => Array
- (
- [TY] => Array
- (
- [0] => JOUR
- )
-
- [JF] => Array
- (
- [0] => Ethics and Information Technology
- )
-
- [T1] => Array
- (
- [0] => At the foundations of information justice
- )
-
- [VL] => Array
- (
- [0] => 11
- )
-
- [IS] => Array
- (
- [0] => 1
- )
-
- [SP] => Array
- (
- [0] => 57
- )
-
- [EP] => Array
- (
- [0] => 69
- )
-
- [PY] => Array
- (
- [0] => 2009/03/01/
- )
-
- [UR] => Array
- (
- [0] => http://dx.doi.org/10.1007/s10676-009-9181-2
- )
-
- [M3] => Array
- (
- [0] => 10.1007/s10676-009-9181-2
- )
-
- [AU] => Array
- (
- [0] => Butcher, Matthew
- )
-
- [N2] => Array
- (
- [0] => Abstract goes here....
- )
-
- )
-
- );
-~~~
+ Array
+ (
+ [0] => Array
+ (
+ [TY] => Array
+ (
+ [0] => JOUR
+ )
+
+ [JF] => Array
+ (
+ [0] => Ethics and Information Technology
+ )
+
+ [T1] => Array
+ (
+ [0] => At the foundations of information justice
+ )
+
+ [VL] => Array
+ (
+ [0] => 11
+ )
+
+ [IS] => Array
+ (
+ [0] => 1
+ )
+
+ [SP] => Array
+ (
+ [0] => 57
+ )
+
+ [EP] => Array
+ (
+ [0] => 69
+ )
+
+ [PY] => Array
+ (
+ [0] => 2009/03/01/
+ )
+
+ [UR] => Array
+ (
+ [0] => http://dx.doi.org/10.1007/s10676-009-9181-2
+ )
+
+ [M3] => Array
+ (
+ [0] => 10.1007/s10676-009-9181-2
+ )
+
+ [AU] => Array
+ (
+ [0] => Butcher, Matthew
+ )
+
+ [N2] => Array
+ (
+ [0] => Abstract goes here....
+ )
+
+ )
+
+ );
Thus, to get the title of the first record, you would use syntax like this:
-~~~
- $results[0]['T1'][0];
-~~~
+ $results[0]['T1'][0];
+
+.end
Please sign in to comment.
Something went wrong with that request. Please try again.