📘
Lab Website Template docs
  • Introduction
    • Overview
    • Is this right for me?
    • Gallery
    • Support
  • Getting Started
    • Set up your site
    • Set up your URL
    • Tidy up your repo
    • Change your site
    • Preview your site
  • Basics
    • Repo structure
    • Configure your site
    • Edit pages
    • Write basic content
    • Use your logo
    • Customize your theme
    • Team members
    • Blog posts
    • Citations
    • Components
      • Section
      • Figure
      • Button
      • Icon
      • Feature
      • List
      • Citation
      • Card
      • Portrait
      • Post Excerpt
      • Alert
      • Tags
      • Float
      • Grid
      • Cols
      • Search
      • Site Search
  • Advanced
    • Update your template
    • Embeds
    • Math, diagrams, videos, etc.
    • Analytics
    • Data and collections
    • Jekyll plugins
    • Custom components
    • Background knowledge
Powered by GitBook
On this page
  • How it works
  • Examples
  • Basic id
  • Rich details
  • Manual override
  • ORCID
  • PubMed
  • Google Scholar
  • Periodic updates
  • Cache
  1. Basics

Citations

PreviousBlog postsNextComponents

Last updated 4 months ago

Arguably the most important feature of this template is its ability to automatically generate citations from simple identifiers. This makes it easy to cite and maintain large lists of publications.

The template is able to do this thanks to , a suite of tools that (among many other things) lets you automatically generate a citation with full details from just a short identifier, like doi, url, isbn, pmc, pmcid, pubmed, arxiv, and .

How it works

First let's define some consistent terminology to make things easier to explain:

  • source - A paper, book, article, web page, film, or any other published item you want to cite.

  • citation - Full, detailed information about a source, like title, author(s), publisher, publish date, URL, etc.

For most content on your site, you just need change the contents of the appropriate file. Citations have a special additional step. When you add new sources or metasources to be cited, the template has to run a special "cite process" to generate your full citations.

At a high level, here's how it all works:

  1. Input your sources and metasources in /_data files, e.g. sources-2020.yaml, orcid-students.yaml, etc.

  2. The cite process outputs a single citations.yaml file in /_data.

Do not edit citations.yaml! It will get overwritten each time the cite process runs. If you need to manually input or correct things, see below.

The cite process in detail...
  1. Each source/metasource file gets processed by the appropriate cite plugin (see /_cite/plugins) based on filename prefix.

  2. In metasource files, each list entry gets expanded into a list of regular sources. Any fields you put in the original entry get copied to each source in the expanded list.

  3. In source files, each list entry stays as-is.

  4. Metadata about the cite process is attached to each source, like which input file it originated from and which cite plugin it ran with.

  5. A full list of regular sources is compiled, with duplicates merged together by id.

  6. When merging two entries, if the same field is present in both, the one that comes later in the full list overwrites the one that comes earlier (because there cannot be two keys with the same name on an dict/object).

  7. Manubot generates full citation details for each source that has an id.

  8. Any field originally on each source is preserved.

Examples

Basic id

Filename must start with sources.

/_data/sources.yaml
- id: doi:10.1098/rsif.2017.0387
- id: pubmed:29424689
- id: pmc:PMC5640425
- id: arxiv:1806.05726
# ...more sources
Parameter
Description

id

Rich details

Optionally, you can manually pass extra "rich" details that the template can display nicely. Manubot can't automatically determine these.

/_data/sources.yaml
- id: arxiv:1806.05726
  type: paper
  description: Lorem ipsum _dolor sit amet_.
  image: https://publisher.com/striking-image-for-your-paper.jpg
  buttons:
    - type: source
      link: https://github.com/your-lab/some-repo
    - type: website
      text: My Personal Website
      link: http://some-website.com/
  tags:
    - biology
    - big data
    - medicine
  repo: your-lab/some-repo

# ...another source
Parameter
Description

type

The type of the source. Determines the icon to show. See /_data/types.yaml for what types are built-in or to add your own.

description

Brief description of the source. Can contain Markdown.

image

URL to a striking image for the source. Highly recommended. Displays as a thumbnail next to the citation details.

buttons

tags

repo

Manual override

All fields you attach to a source (or metasource, see below) get passed through to the generated citation untouched. This allows you to manually input or correct details of a citation.

/_data/sources.yaml
# manually correct specific citation detail
- id: pmc:PMC5640425
  publisher: Cold Spring Harbor

# manually provide all citation details
- title: Some Publication Title
  authors:
    - "**Steve McQueen**"
    - Lightning McQueen
  publisher: bioRxiv
  date: 2021-01-01
  link: biorxiv.org/1234

# attach an arbitrary field
- id: pmc:PMC5640425
  some-field: 123
Parameter
Description

title / authors / publisher / date / link

If you don't provide an id, Manubot has nothing to cite and so doesn't run. You'd only want to do this if manually providing all the citation details manually. This defeats the main benefit of the template, but is sometimes necessary.

ORCID

Filename must start with orcid.

/_data/orcid.yaml
- orcid: 0000-0002-4655-3773
  jane-doe: true

# ...another author

Each ORCID gets expanded into a full list of regular sources with ids. Any fields you put in the original entry get copied to each source in the expanded list. This applies to the other types of metasources below as well.

{% include list.html data="citations" component="citation" filters="jane-doe: true" %}

Why do the filter like that?

Why have the unique author be the key (e.g. jane-doe: true) instead of the value (e.g. member: jane-doe)? If you do the latter, and two people are authors on the same source, only one of the authors will be kept (whichever is listed last). This is a result of behavior described elsewhere on this page (duplicate sources merged into one, cannot have duplicate keys on dict/object).

/_data/sources.yaml
# some paper returned by an ORCID with a wrong title
- id: doi:123/456
  title: Correct Title

# some paper returned by an ORCID that you don't want to keep at all
- id: pubmed:123456
  remove: true

If a metasource returns a source with a type of identifier that Manubot doesn't know how to cite, that source will be ignored. When this happens, the cite process prints a warning, not a critical error, so you'll have to check your CLI output or GitHub Actions logs.

PubMed

See ORCID above for general metasource functionality.

Filename must start with pubmed.

/_data/pubmed.yaml
- term: "Greene, C[Author] NOT Greene CE[Author]"

Google Scholar

See ORCID above for general metasource functionality.

Filename must start with google-scholar.

/_data/google-scholar.yaml
- gsid: ETJoidYAAAAJ

Periodic updates

Metasources like ORCID update over time as you publish new sources. To accommodate this, the template tries to automatically re-run the cite process periodically. In your repo's "▶️ Actions", see the "on schedule" workflow.

When the workflow runs, it will get the latest sources associated with your metasources, generate citations like normal, and open a pull request to let you review the changes before publishing them.

Cache

If you have many sources, generating the citations for all of them can take a while. To save time, the cite process keeps a time-to-live cache for Manubot/ORCID/etc. network requests. If a cached response hasn't expired, it is used instead of making a new request. To clear this, simply delete the cache directory _cite/.cache. You can also customize the default expire times in the Python code in _cite.

metasource - A single item that lists multiple sources, like how an author's can be used to get a list of their published works.

The cite process runs – either or – to convert your sources and metasources to full citations.

Display and filter citations on your site with the and components.

You can mix and match as many sources and metasources as you want, and display them however and wherever you'd like! For example, you may want to have a "CV" page that lists all of the papers under your 's ORCID, then reserve your "Research" page for just a few special papers by various members in your lab that you want to highlight.

Identifier for the source that . If Manubot is unable to generate a citation for this ID, the template will log an error message and exit with an error code.

List of to show underneath the citation details.

List of to show underneath the citation details.

GitHub repository to automatically fetch additional from.

Always provide a good thumbnail for your publications. Use a figure from the source, or if there are none, a journal logo or issue cover. .

Basic citation information normally returned from Manubot and displayed by the component. Date should be in YYYY-MM-DD format. Authors can contain Markdown.

You can also attach arbitrary fields. The template won't explicitly use them, but you could use them to filter citations with the component.

is the recommended way to retrieve a complete set of published works for an author.

To conveniently and explicitly associate an ORCID with a person for filtering with the , you can add a unique field for that person like in the example above and use a filter like this:

Because the cite process merges duplicate sources by id, you can also use the above to manually correct sources returned from metasources. You can also use the special remove field to ignore a source returned from a metasource, discarding it from the citations output. Example:

Uses to search for terms. This is a brittle way to select an author's papers, very vulnerable to false positives. ORCID is recommended.

Unfortunately, Google does not provide APIs for many of its services, and that includes Scholar. Luckily there is a 3rd-party API to access it, . First you'll have to sign up and get an API key. Then, if , make a named GOOGLE_SCHOLAR_API_KEY with your API key as its value, or if , put the same name/value in a .env file.

. You may have to manually enable the workflow, or re-enable it after a while.

Due to another , if you want to see a for this pull request, you'll have to close (not merge) and reopen it. That should trigger the "build preview" workflow.

ORCID number
list
citation
PI
Here are some best practices for making a good thumbnail image
list
ORCID
list component
NCBI eutils
PubMed
GitHub imposes certain limitations on scheduled workflows
manual override method
Manubot can understand and cite
buttons
tags
tags
citation
Manubot
many many more
SerpAPI
new repository secret
GitHub limitation
LogoManubot - Manuscripts, open and automated
on GitHub
locally
running the cite process on GitHub
running locally
live preview link