Fixes code blocks in readme.md.
This commit is contained in:
parent
ac327d0c44
commit
41de8b5aab
84
readme.md
84
readme.md
@ -16,20 +16,23 @@ Pubs is built with the following principles in mind:
|
|||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
You can install the latest stable version of `pubs` through Pypi, with:
|
You can install the latest stable version of `pubs` through Pypi, with:
|
||||||
|
```
|
||||||
pip install pubs
|
pip install pubs
|
||||||
|
```
|
||||||
|
|
||||||
Alternatively, you can:
|
Alternatively, you can:
|
||||||
|
|
||||||
- install the latest development version with pip:
|
- install the latest development version with pip:
|
||||||
|
```
|
||||||
pip install --upgrade git+https://github.com/pubs/pubs
|
pip install --upgrade git+https://github.com/pubs/pubs
|
||||||
|
```
|
||||||
|
|
||||||
- clone the repository and install it manually:
|
- clone the repository and install it manually:
|
||||||
|
```
|
||||||
git clone https://github.com/pubs/pubs
|
git clone https://github.com/pubs/pubs
|
||||||
cd pubs
|
cd pubs
|
||||||
python setup.py install [--user]
|
python setup.py install [--user]
|
||||||
|
```
|
||||||
|
|
||||||
Arch Linux users can also use the [pubs-git](https://aur.archlinux.org/packages/pubs-git/) AUR package.
|
Arch Linux users can also use the [pubs-git](https://aur.archlinux.org/packages/pubs-git/) AUR package.
|
||||||
|
|
||||||
@ -37,28 +40,34 @@ Arch Linux users can also use the [pubs-git](https://aur.archlinux.org/packages/
|
|||||||
## Getting started
|
## Getting started
|
||||||
|
|
||||||
Create your library (by default, goes to `~/.pubs/`).
|
Create your library (by default, goes to `~/.pubs/`).
|
||||||
|
```
|
||||||
pubs init
|
pubs init
|
||||||
|
```
|
||||||
|
|
||||||
Import existing data from bibtex (pubs will try to automatically copy documents defined as 'file' in bibtex):
|
Import existing data from bibtex (pubs will try to automatically copy documents defined as 'file' in bibtex):
|
||||||
|
```
|
||||||
pubs import path/to/collection.bib
|
pubs import path/to/collection.bib
|
||||||
|
```
|
||||||
|
|
||||||
or for a .bib file containing a single reference:
|
or for a .bib file containing a single reference:
|
||||||
|
```
|
||||||
pubs add reference.bib -d article.pdf
|
pubs add reference.bib -d article.pdf
|
||||||
|
```
|
||||||
|
|
||||||
pubs can also automatically retrieve the bibtex from a doi:
|
pubs can also automatically retrieve the bibtex from a doi:
|
||||||
|
```
|
||||||
pubs add -D 10.1007/s00422-012-0514-6 -d article.pdf
|
pubs add -D 10.1007/s00422-012-0514-6 -d article.pdf
|
||||||
|
```
|
||||||
|
|
||||||
or an ISBN (dashes are ignored):
|
or an ISBN (dashes are ignored):
|
||||||
|
```
|
||||||
pubs add -I 978-0822324669 -d article.pdf
|
pubs add -I 978-0822324669 -d article.pdf
|
||||||
|
```
|
||||||
|
|
||||||
or an arXiv id (automatically downloading arXiv article is in the works):
|
or an arXiv id (automatically downloading arXiv article is in the works):
|
||||||
|
```
|
||||||
pubs add -X math/9501234 -d article.pdf
|
pubs add -X math/9501234 -d article.pdf
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## References always up-to-date
|
## References always up-to-date
|
||||||
@ -66,8 +75,9 @@ or an arXiv id (automatically downloading arXiv article is in the works):
|
|||||||
If you use latex, you can automatize references, by running `pubs export > references.bib` each time you update your library, which also fits well as a `makefile` rule.
|
If you use latex, you can automatize references, by running `pubs export > references.bib` each time you update your library, which also fits well as a `makefile` rule.
|
||||||
|
|
||||||
This ensures that your reference file is always up-to-date; you can cite a paper in your manuscript a soon as you add it in pubs. This means that if you have, for instance, a doi on a webpage, you only need to do:
|
This ensures that your reference file is always up-to-date; you can cite a paper in your manuscript a soon as you add it in pubs. This means that if you have, for instance, a doi on a webpage, you only need to do:
|
||||||
|
```
|
||||||
pubs add -D 10.1007/s00422-012-0514-6
|
pubs add -D 10.1007/s00422-012-0514-6
|
||||||
|
```
|
||||||
|
|
||||||
and then add `\cite{Loeb_2012}` in your manuscript. After exporting the bibliography, the citation will correctly appear in your compiled pdf.
|
and then add `\cite{Loeb_2012}` in your manuscript. After exporting the bibliography, the citation will correctly appear in your compiled pdf.
|
||||||
|
|
||||||
@ -75,23 +85,25 @@ and then add `\cite{Loeb_2012}` in your manuscript. After exporting the bibliogr
|
|||||||
## Document management
|
## Document management
|
||||||
|
|
||||||
You can attach a document to a reference:
|
You can attach a document to a reference:
|
||||||
|
```
|
||||||
pubs add Loeb2012_downloaded.pdf Loeb_2012
|
pubs add Loeb2012_downloaded.pdf Loeb_2012
|
||||||
|
```
|
||||||
|
|
||||||
And open your documents automatically from the command line:
|
And open your documents automatically from the command line:
|
||||||
|
```
|
||||||
pubs doc open Loeb_2012
|
pubs doc open Loeb_2012
|
||||||
pubs doc open --with lp Loeb_2012 # Opens the document with `lp` to actually print it.
|
pubs doc open --with lp Loeb_2012 # Opens the document with `lp` to actually print it.
|
||||||
|
```
|
||||||
|
|
||||||
## Customization
|
## Customization
|
||||||
|
|
||||||
Pubs is designed to interact well with your command line tool chain.
|
Pubs is designed to interact well with your command line tool chain.
|
||||||
You can add custom commands to pubs by defining aliases in your configuration file (make sure that the alias plugin is activated in your configuration by using `pubs conf`).
|
You can add custom commands to pubs by defining aliases in your configuration file (make sure that the alias plugin is activated in your configuration by using `pubs conf`).
|
||||||
|
```ini
|
||||||
[[alias]]
|
[[alias]]
|
||||||
evince = open --with evince
|
evince = open --with evince
|
||||||
count = !pubs list -k "$@" | wc -l
|
count = !pubs list -k "$@" | wc -l
|
||||||
|
```
|
||||||
|
|
||||||
The first command defines a new subcommand: `pubs open --with evince` will be executed when `pubs evince` is typed.
|
The first command defines a new subcommand: `pubs open --with evince` will be executed when `pubs evince` is typed.
|
||||||
The second starts with a bang: `!`, and is treated as a shell command. If other arguments are provided they are passed to the shell command as in a script. In the example above the `count` alias can take arguments that are be passed to the `pubs list -k` command, hence enabling filters like `pubs count year:2012`.
|
The second starts with a bang: `!`, and is treated as a shell command. If other arguments are provided they are passed to the shell command as in a script. In the example above the `count` alias can take arguments that are be passed to the `pubs list -k` command, hence enabling filters like `pubs count year:2012`.
|
||||||
@ -102,14 +114,14 @@ The second starts with a bang: `!`, and is treated as a shell command. If other
|
|||||||
For autocompletion to work, you need the [argcomplete](https://argcomplete.readthedocs.io) Python package, and Bash 4.2 or newer. For activating *bash* or *tsch* completion, consult the [argcomplete documentation](https://argcomplete.readthedocs.io/en/latest/#global-completion).
|
For autocompletion to work, you need the [argcomplete](https://argcomplete.readthedocs.io) Python package, and Bash 4.2 or newer. For activating *bash* or *tsch* completion, consult the [argcomplete documentation](https://argcomplete.readthedocs.io/en/latest/#global-completion).
|
||||||
|
|
||||||
For *zsh* completion, the global activation is not supported but bash completion compatibility can be used for pubs. For that, add the following to your `.zshrc`:
|
For *zsh* completion, the global activation is not supported but bash completion compatibility can be used for pubs. For that, add the following to your `.zshrc`:
|
||||||
|
```shell
|
||||||
# Enable and load bashcompinit
|
# Enable and load bashcompinit
|
||||||
autoload -Uz compinit bashcompinit
|
autoload -Uz compinit bashcompinit
|
||||||
compinit
|
compinit
|
||||||
bashcompinit
|
bashcompinit
|
||||||
# Argcomplete explicit registration for pubs
|
# Argcomplete explicit registration for pubs
|
||||||
eval "$(register-python-argcomplete pubs)"
|
eval "$(register-python-argcomplete pubs)"
|
||||||
|
```
|
||||||
|
|
||||||
## Need more help ?
|
## Need more help ?
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user