{"id":18908115,"url":"https://github.com/chbrown/bartleby","last_synced_at":"2025-04-15T04:32:14.579Z","repository":{"id":62431291,"uuid":"73419509","full_name":"chbrown/bartleby","owner":"chbrown","description":"BibTeX (and TeX) parsing with Clojure","archived":false,"fork":false,"pushed_at":"2018-02-26T22:07:30.000Z","size":341,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T16:43:41.406Z","etag":null,"topics":["bibliography","bibtex","clojure","latex","lexer","parser","parser-combinators","tex"],"latest_commit_sha":null,"homepage":"https://chbrown.github.io/bartleby/","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chbrown.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-10T20:45:16.000Z","updated_at":"2024-12-28T04:10:49.000Z","dependencies_parsed_at":"2022-11-01T21:00:52.777Z","dependency_job_id":null,"html_url":"https://github.com/chbrown/bartleby","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chbrown%2Fbartleby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chbrown%2Fbartleby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chbrown%2Fbartleby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chbrown%2Fbartleby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chbrown","download_url":"https://codeload.github.com/chbrown/bartleby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249006568,"owners_count":21197298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bibliography","bibtex","clojure","latex","lexer","parser","parser-combinators","tex"],"created_at":"2024-11-08T09:24:31.409Z","updated_at":"2025-04-15T04:32:14.087Z","avatar_url":"https://github.com/chbrown.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bartleby\n\n[![Latest version published to Clojars](https://img.shields.io/clojars/v/bartleby.svg)](https://clojars.org/bartleby)\n[![Travis CI Build Status](https://travis-ci.org/chbrown/bartleby.svg)](https://travis-ci.org/chbrown/bartleby)\n[![Coveralls Coverage Status](https://coveralls.io/repos/chbrown/bartleby/badge.svg)](https://coveralls.io/github/chbrown/bartleby)\n\nA very _faithful_ BibTeX parser.\n\n- Preserves comments, order, formatting, string interpolations\n- _Mostly_ idempotent at its core\n  * Whitespace outside values is always standardized\n- Implements various levels of cleaning up / standardization beyond whitespace\n\n\n## Use as jar\n\n1. Go to [releases](https://github.com/chbrown/bartleby/releases) and download the top (latest) \u003ccode\u003ebartleby-\u003cem\u003ex.y.z\u003c/em\u003e-standalone.jar\u003c/code\u003e\n2. Ensure you have `java` installed (`java -version` should print out your version)\n3. In your shell, run `java -jar bartleby-*.jar --help`, which will print out a help message describing all command line functionality.\n  * 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.\n\n\n## Compile and install as binary\n\n    lein bin\n    cp $(find target -type f -perm +111) /usr/local/bin/bart\n\n\n## Recipes\n\nReformat a single .bib file, in-place:\n\n    bart cat \u003cresearch.bib | sponge research.bib\n\nDelete .bib file entries not used in LaTeX document:\n\n    bart select {paper.aux,research.bib} | sponge research.bib\n\n\n## Alternatives\n\n* [`bibexport`](https://www.ctan.org/tex-archive/biblio/bibtex/utils/bibexport/)\n  - Cleverly uses the BibTeX compiler and a special `export.bst` style file to render BibTeX natively.\n  - But it is not very faithful:\n    + Unrecognized fields (those outside the standard 22 + 7 special names hard-coded into `export.bst`) are deleted\n    + Comments are deleted\n    + All fields are ordered alphabetically\n    + All entries are ordered by first appearance in the document / `.aux` file\n  - And the output format is not customizable (unless you modify the `export.bst` file):\n    + All case-insensitive keywords (pubtype and field keys) are lowercased\n    + All fields keys are indented with two spaces, and the field values are all aligned at column 19\n    + Lines are wrapped at 78 characters\n\n\n## References\n\n* Interesting blog post on writing parsers in Clojure with monads at \u003chttp://albert.rierol.net/clojure-monads.html\u003e, with code at \u003chttps://gist.github.com/acardona/3672948\u003e\n  - His answer to whether \"whether I could write better clojure programs by using monads\"?\n    \"The short answer is that the disadvantages outweight the advantages.\"\n* \"[Kern](https://github.com/blancas/kern) is a library of parser combinators for Clojure\"\n  - 130 stars on GitHub.\n  - It doesn't appear to be compatible with ClojureScript.\n* \"[The Parsatron](https://github.com/youngnh/parsatron) is a functional parser library\"\n  - 173 stars on GitHub.\n  - Ported to ClojureScript.\n  - [doc/guide](https://github.com/youngnh/parsatron/blob/master/doc/guide.markdown)\n\nI've also compiled my own [guide / reference / notes](Parsatron.md) for the `parsatron` library.\n\n\n## Development\n\n### Testing\n\nRun the following to exclude dev/test from [cloverage](https://github.com/cloverage/cloverage)'s report:\n\n    lein cloverage --ns-exclude-regex user\n\n\n## Release instructions\n\n### Cutting and deploying a new version\n\nUpdate the version manually in `project.clj` and `README.md`, commit those changes, and push.\n\nThen add a tag and push:\n\n    tag=v$(lein pprint :version | tr -d \\\")\n    git tag $tag\n    git push --tags\n\nFinally, deploy to [Clojars](https://clojars.org/):\n\n    # export GPG_TTY=$(tty) # uncomment if gpg fails with \"Inappropriate ioctl\"\n    lein deploy\n\n* _TODO_: customize `:release-tasks` and use `lein release :major / :minor / :patch`\n\n\n### Adding binaries to [GitHub releases](releases)\n\nThis uses [github-release](https://github.com/aktau/github-release) (`go get github.com/aktau/github-release`),\nwhich expects the environment variables `GITHUB_USER` and `GITHUB_TOKEN` to be set.\n\nBuild the normal jar and uber(standalone)jar:\n\n    lein uberjar\n\nCreate a GitHub \"release\":\n\n    # set tag if you lost it from earlier:\n    #tag=$(git tag --sort=committerdate | tail -1)\n    # or:\n    #tag=$(git describe --abbrev=0 --tags)\n    github-release release -r bartleby -t $tag\n\nUpload the built files:\n\n    ver=$(lein pprint :version | tr -d \\\")\n    github-release upload -r bartleby -t $tag -f target/bartleby-$ver.jar -n bartleby-$ver.jar\n    github-release upload -r bartleby -t $tag -f target/bartleby-$ver-standalone.jar -n bartleby-$ver-standalone.jar\n\n(You can check the current tags / releases available on GitHub at any time with: `github-release info -r bartleby`)\n\n\n### Generating and publishing documentation\n\nCreate a fresh clone from the `gh-pages` branch:\n\n    rev=$(git rev-parse --short master)\n    repo=${TMPDIR-/tmp/}bartleby-gh-pages\n    git clone git@github.com:chbrown/bartleby.git -b gh-pages $repo\n\nNow, back in this repo on the `master` branch, generate the documentation directly into that clone:\n\n    lein update-in :codox assoc :output-path \\\"$repo\\\" -- codox\n\nThen go to that repo's directory, commit the changes with a message pointing to the current commit on `master`, and push:\n\n    cd $repo\n    git add .\n    git commit -m \"Sync documentation with master @ $rev\"\n    git push\n\n\n## License\n\nCopyright © 2016-2018 Christopher Brown.\n[MIT Licensed](https://chbrown.github.io/licenses/MIT/#2016-2018).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchbrown%2Fbartleby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchbrown%2Fbartleby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchbrown%2Fbartleby/lists"}