OceanGlidersCommunity / Oxygen_SOP

Oxygen Standard Operating Procedure (SOP)
https://oceangliderscommunity.github.io/Oxygen_SOP/README.html
Other
6 stars 21 forks source link

Change citation style #216

Closed jbusecke closed 2 years ago

jbusecke commented 2 years ago

This implements Author year citation style for both inline and bibliography. Many thanks to @observingClouds for helping me understand this implementation in https://github.com/executablebooks/jupyter-book/issues/1090.

github-actions[bot] commented 2 years ago

This pull request is being automatically built with GitHub Actions and Netlify. To see the status of your deployment, click below.

🔍 Git commit SHA: 6bc4367f5a0080a42ce5f07a488aefa38fe6f49d ✅ Deployment Preview URL: https://6245b09a0498ef6ef7943935--oxygensop.netlify.app

jbusecke commented 2 years ago

Hmm this is frustrating. This works for me locally, but not here. Will wait if someone on that issue has some more input.

observingClouds commented 2 years ago

Not sure why it works locally but I think _config.yml has not yet been adapted. This is at least the location, where the extensions are actually called/loaded in our case.

observingClouds commented 2 years ago

You need to add something like the following to _config.yml.

sphinx:
    local_extensions:
      apastyle: _ext/  # references _ext/apastyle.py
      bracket_citation_style: _ext/  # references _ext/bracket_citation_style.py
  config:
     bibtex_default_style: myapastyle
     bibtex_reference_style: author_year_round

bibtex_reference_style      : author_year_round  # references the registered plugin author_year_round in bracket_citation_style.py 
bibtex_default_style        : myapastyle  # references the registered plugin myapastyle in apastyle.py
soerenthomsen commented 2 years ago

Thanks @jbusecke and @observingClouds for your support in trying to fix this!

jbusecke commented 2 years ago

Oh geez, that is embarassing. I totally forgot to commit that (I blame coffee. It was either too little or too much...).

jbusecke commented 2 years ago

I really appreaciate the help @observingClouds, and sorry that I did not notice this rather silly thing myself. It seems to work now. Ill roll back all the environment stuff I tried to add yesterday and then we can probably merge this.

jbusecke commented 2 years ago

Ok ready for review @soerenthomsen

soerenthomsen commented 2 years ago

@isgiddy you might also want to check this work as we will have to do the same for the other SOPs :)

soerenthomsen commented 2 years ago

The preview looks great! So I will approve! Thanks @jbusecke for this long and hard effort. We will have to implement another 3 times so after we are probably ready to write some nice docs together?! Happy to support this.

soerenthomsen commented 2 years ago

@tomhull this solution for the citation style might also interest you! :)