Skip to content

Commit

Permalink
Merge pull request #104 from shyamd/update-python-compat
Browse files Browse the repository at this point in the history
Refactor plugin for more modularity
  • Loading branch information
shyamd authored Jan 20, 2022
2 parents 7bf655e + 9943d36 commit 8f73346
Show file tree
Hide file tree
Showing 14 changed files with 589 additions and 363 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/post-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: ridedott/merge-me-action@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

auto-gen-release:
runs-on: ubuntu-latest
env:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,21 @@ jobs:
- name: Lint with pycodestyle
run: |
pip install pycodestyle
pycodestyle mkdocs_bibtex
pycodestyle src
- name: Lint with mypy
run: |
pip install mypy
mypy mkdocs_bibtex
mypy src
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 --count --show-source --statistics mkdocs_bibtex
flake8 --count --show-source --statistics src
# exit-zero treats all errors as warnings.
flake8 --count --exit-zero --max-complexity=20 --statistics mkdocs_bibtex
flake8 --count --exit-zero --max-complexity=20 --statistics src
test:
strategy:
max-parallel: 6
Expand Down
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ plugins:
- search
- bibtex:
bib_file: "refs.bib"
cite_style: "pandoc"
markdown_extensions:
- footnotes
```
Expand All @@ -36,17 +35,15 @@ The footnotes extension is how citations are linked for now.

- `bib_file` - Name of your bibtex file. Either the absolute path or the path relative to `mkdocs.yml`
- `bib_dir` - Directory for bibtex files to load, same as above for path resolution
- `cite_style` - The way you place citations into text: "pandoc" for `[@myRef]` and "plain" for `@myRef`
- `bib_command` - The command for your bibliography, defaults to `\bibliography`
- `full_bib_command` - The command for your bibliography, defaults to `\full_bibliography`
- `full_bib_command` - The command for your full bibliography, defaults to `\full_bibliography`
- `csl_file` - Bibtex CSL file to format the citation with, defaults to None, using a built in plain format instead
- `unescape_for_arithmatex` - Optional; set to `True` to avoid the `\(` `\)` [issue](https://github.com/shyamd/mkdocs-bibtex/issues/3) with [pymdownx.arithmatex](https://facelessuser.github.io/pymdown-extensions/extensions/arithmatex/)

## Usage

In your markdown files:

1. Add your citations as you would normally using either "plain" or "pandoc" style
1. Add your citations as you would if you used pandoc, IE: `[@first_cite;@second_cite]`
2. Add in `\bibliography` or whatever you set your `bib_command` to where you want your references.
3. Add in `\full_bibliography` or whatever you set your `full_bib_command` to where you want the full set of references. *Note*: This is not guaranteed to work yet since one issue is the order in which markdown files are processed. Might need to do something using the `on_files()` event first.
3. Add in `\full_bibliography` or whatever you set your `full_bib_command` to where you want the full set of references. *Note*: This is not work just right since this plugin can't dictate the orer in which files are processed. The best way to ensure the file with the full bibliography gets processed last is to use numbers in front of file/folder names to enforce an order of processing, IE: `01_my_first_file.md`
4. (Optional) Setup `csl_file` to control the citation text formatting.
231 changes: 0 additions & 231 deletions mkdocs_bibtex/plugin.py

This file was deleted.

103 changes: 0 additions & 103 deletions mkdocs_bibtex/test_plugin.py

This file was deleted.

Loading

0 comments on commit 8f73346

Please sign in to comment.