Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chbrown/bartleby
BibTeX (and TeX) parsing with Clojure
https://github.com/chbrown/bartleby
bibliography bibtex clojure latex lexer parser parser-combinators tex
Last synced: about 2 months ago
JSON representation
BibTeX (and TeX) parsing with Clojure
- Host: GitHub
- URL: https://github.com/chbrown/bartleby
- Owner: chbrown
- Created: 2016-11-10T20:45:16.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-26T22:07:30.000Z (almost 7 years ago)
- Last Synced: 2024-10-28T13:06:50.479Z (2 months ago)
- Topics: bibliography, bibtex, clojure, latex, lexer, parser, parser-combinators, tex
- Language: Clojure
- Homepage: https://chbrown.github.io/bartleby/
- Size: 333 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# bartleby
[![Latest version published to Clojars](https://img.shields.io/clojars/v/bartleby.svg)](https://clojars.org/bartleby)
[![Travis CI Build Status](https://travis-ci.org/chbrown/bartleby.svg)](https://travis-ci.org/chbrown/bartleby)
[![Coveralls Coverage Status](https://coveralls.io/repos/chbrown/bartleby/badge.svg)](https://coveralls.io/github/chbrown/bartleby)A very _faithful_ BibTeX parser.
- Preserves comments, order, formatting, string interpolations
- _Mostly_ idempotent at its core
* Whitespace outside values is always standardized
- Implements various levels of cleaning up / standardization beyond whitespace## Use as jar
1. Go to [releases](https://github.com/chbrown/bartleby/releases) and download the top (latest)
bartleby-x.y.z-standalone.jar
2. Ensure you have `java` installed (`java -version` should print out your version)
3. In your shell, run `java -jar bartleby-*.jar --help`, which will print out a help message describing all command line functionality.
* For example, `java -jar bartleby-*.jar cat my.bib their.bib` will read each of `my.bib` and `their.bib` and print the formatted BibTeX to `stdout` in that order.## Compile and install as binary
lein bin
cp $(find target -type f -perm +111) /usr/local/bin/bart## Recipes
Reformat a single .bib file, in-place:
bart cat , with code at
- His answer to whether "whether I could write better clojure programs by using monads"?
"The short answer is that the disadvantages outweight the advantages."
* "[Kern](https://github.com/blancas/kern) is a library of parser combinators for Clojure"
- 130 stars on GitHub.
- It doesn't appear to be compatible with ClojureScript.
* "[The Parsatron](https://github.com/youngnh/parsatron) is a functional parser library"
- 173 stars on GitHub.
- Ported to ClojureScript.
- [doc/guide](https://github.com/youngnh/parsatron/blob/master/doc/guide.markdown)I've also compiled my own [guide / reference / notes](Parsatron.md) for the `parsatron` library.
## Development
### Testing
Run the following to exclude dev/test from [cloverage](https://github.com/cloverage/cloverage)'s report:
lein cloverage --ns-exclude-regex user
## Release instructions
### Cutting and deploying a new version
Update the version manually in `project.clj` and `README.md`, commit those changes, and push.
Then add a tag and push:
tag=v$(lein pprint :version | tr -d \")
git tag $tag
git push --tagsFinally, deploy to [Clojars](https://clojars.org/):
# export GPG_TTY=$(tty) # uncomment if gpg fails with "Inappropriate ioctl"
lein deploy* _TODO_: customize `:release-tasks` and use `lein release :major / :minor / :patch`
### Adding binaries to [GitHub releases](releases)
This uses [github-release](https://github.com/aktau/github-release) (`go get github.com/aktau/github-release`),
which expects the environment variables `GITHUB_USER` and `GITHUB_TOKEN` to be set.Build the normal jar and uber(standalone)jar:
lein uberjar
Create a GitHub "release":
# set tag if you lost it from earlier:
#tag=$(git tag --sort=committerdate | tail -1)
# or:
#tag=$(git describe --abbrev=0 --tags)
github-release release -r bartleby -t $tagUpload the built files:
ver=$(lein pprint :version | tr -d \")
github-release upload -r bartleby -t $tag -f target/bartleby-$ver.jar -n bartleby-$ver.jar
github-release upload -r bartleby -t $tag -f target/bartleby-$ver-standalone.jar -n bartleby-$ver-standalone.jar(You can check the current tags / releases available on GitHub at any time with: `github-release info -r bartleby`)
### Generating and publishing documentation
Create a fresh clone from the `gh-pages` branch:
rev=$(git rev-parse --short master)
repo=${TMPDIR-/tmp/}bartleby-gh-pages
git clone [email protected]:chbrown/bartleby.git -b gh-pages $repoNow, back in this repo on the `master` branch, generate the documentation directly into that clone:
lein update-in :codox assoc :output-path \"$repo\" -- codox
Then go to that repo's directory, commit the changes with a message pointing to the current commit on `master`, and push:
cd $repo
git add .
git commit -m "Sync documentation with master @ $rev"
git push## License
Copyright © 2016-2018 Christopher Brown.
[MIT Licensed](https://chbrown.github.io/licenses/MIT/#2016-2018).