Skip to content

Commit

Permalink
Merge branch 'feature/import_bibtex' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
pmayer committed Jan 14, 2022
2 parents 74a6653 + ae1e274 commit 131f950
Show file tree
Hide file tree
Showing 6 changed files with 526 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## unreleased

### Added
- **EXPERIMENTAL**: Added `import_bibtex` management command for importing entries from BibTeX files

## 1.1.4

### Fixed
Expand Down
38 changes: 38 additions & 0 deletions docs/source/management_commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,41 @@ This command exports published entries for a specific year as CSV. Exported CSV
##### Optional

* `--lang` - Label language of the export. Allowed values: `de` and `en`


### `import_bibtex`

This command imports all entries from a BibTeX file and creates according Portfolio
entries for a specific user.

```{note}
This is still an experimental feature, and implementation as well as mappings of
BibTeX types to Portfolio schemas might change in the future.
```

#### Arguments

##### Positional

* `userid` - the ID of the user for whom the imported entries should be created
* `file` - the full path to the BibTeX file to import entries from


#### Usage examples

A common usage might look like

```
python manage.py import_bibtex 12345ABCD67890EF12AB3456CD7890F0 references.bib
```

This assumes the `references.bib` file resides in the projects `src` directory.
But relative paths can be used as well. So in a local dev environment you might
want to use something like `~/Documents/references.bib`.

For a containerized setup, the easiest soultion is to copy your file into the
`src` folder, and then execute the command via `docker-compose exec`:

```
docker-compose exec portfolio-django python manage.py import_bibtex 12345ABCD67890EF12AB3456CD7890F0 references.bib
```
Loading

0 comments on commit 131f950

Please sign in to comment.