Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -633,10 +633,6 @@ and writes the following XML to standard out (shortened):
</bibtex:file>
```

Look at the 'examples' directory for more elaborate examples of a BibTeX to
YAML and a BibTeX to HTML converter using **#to_citeproc** to format a
bibliography using [CSL](https://citationstyles.org/).

BibTeX-Ruby offers an API which lets you manipulate BibTeX objects (string
replacement, name parsing etc.); however, sometimes you just want quick access
to your bibliography's contents. In these cases the **to_hash** method is
Expand Down
43 changes: 0 additions & 43 deletions examples/bib2html.rb

This file was deleted.

13 changes: 0 additions & 13 deletions examples/bib2yaml.rb

This file was deleted.

39 changes: 0 additions & 39 deletions examples/markdown.bib

This file was deleted.

30 changes: 30 additions & 0 deletions features/meta_content.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Feature: Text between BibTeX objects
As a hacker who works with bibliographies
I want to keep the text between BibTeX objects
So that a bibliography can also be a document, like written in Markdown

Scenario: A Markdown document with strings and entries
When I parse the following file keeping the text between objects:
"""
Bibliography
============
Here we define a string:

@string{ thoreau = "Thoreau, Henry David" }

And here we add a book:

@book{walden,
author = thoreau,
title = {Walden; or Life in the Woods},
year = 1995
}

Neat, huh?
"""
And I replace all strings in my bibliography
And I search for "@entry, @meta_content"
Then there should be exactly 4 matches
And my bibliography should contain these books:
| key | author | title |
| walden | Thoreau, Henry David | Walden; or Life in the Woods |
4 changes: 4 additions & 0 deletions features/step_definitions/bibtex_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
@bibliography = BibTeX.parse(string, options)
end

When(/^I parse the following file keeping the text between objects:$/) do |string|
@bibliography = BibTeX.parse(string, include: [:meta_content])
end

When(/^I search for "([^"]*)"$/) do |query|
@result = @bibliography.query(query)
end
Expand Down
Loading