module BibTeX
BibTeX
¶ ↑
This module encompasses a parser for BibTeX
files and an API to the individual BibTeX
objects: String
, Preamble
, Comment
, and Entry
.
- Author
- Copyright
-
Copyright © 2010-2014 Sylvester Keil
- License
-
GNU GPL 3.0
Attributes
Public Class Methods
Source
Source
# File lib/bibtex/utilities.rb, line 24 def open(file, options = {}, &block) Bibliography.open(file, options, &block) end
Opens a BibTeX
file or URI and returns a corresponding Bibliography
object or, if a block is given, yields the Bibliography
to the block, ensuring that the file is saved.
Source
# File lib/bibtex/utilities.rb, line 30 def parse(string, options = {}, &block) if string.length < 260 && File.exist?(string) Bibliography.open(string, options, &block) elsif string =~ %r{\A[a-z]+://}i Bibliography.open(string, options) else Bibliography.parse(string, options) end end
Parses the given string and returns a corresponding Bibliography
object. Delegates to BibTeX.open
if the string is a filename or URI.
Source
# File lib/bibtex/compatibility.rb, line 10 def self.transliterate(str) @iconv.iconv(str) end
Source
# File lib/bibtex/utilities.rb, line 41 def valid?(file) Bibliography.open(file).valid? end
Returns true if the given file is a valid BibTeX
bibliography.