GithubHelp home page GithubHelp logo

schneiderfelipe / doi Goto Github PK

View Code? Open in Web Editor NEW
34.0 3.0 5.0 85 KB

πŸ“ Easily convert Digital Object Identifier (DOI) and Uniform Resource Locator (URL) to BibTeX and DOI to plain text.

Home Page: https://github.com/schneiderfelipe/doi2bib

License: MIT License

Shell 97.67% Makefile 2.33%
doi2bib bibtex url plaintext command-line-tool

doi's Introduction

doi's People

Contributors

schneiderfelipe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

doi's Issues

sed issues with linebreak on macOS

Hi,

Nice tool!

I found some issues with the sed commands in lines 76--78 of the script.

    sed -e 's/^ *//' \
        -e 's/, /,\n /g' \
        -e 's/}}$/}\n}\n/'

I'm running a macOS High Sierra, so it's probably caused by the subtle differences between the macOS (BSD) sed and GNU sed. I found a simple fix to itβ€”using $'string' and replace \n with \\\n.

Then I found that the script would insert a linebreak at every comma, and this would also apply to the author field, which I suppose is not an intended feature. So I changed it to match ',' only for the first occurrence (basically, the one after the BiBTeX Key field). And '}, ' is then used for inserting a linebreak after each field.

With these changes, I think it will work under both macOS and GNU/Linux (I tested it with gnu-sed).

    sed -e $'s/^ *//' \
        -e $'s/}, /},\\\n  /g' \
        -e $'s/, /,\\\n  /1' \
        -e $'s/}}$/}\\\n}\\\n/'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.