Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omit lines that use pandoc 2.0's markdown divs #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrewheiss
Copy link

Nowadays pandoc includes extra metadata to delineate divs in bibliographies. It used to use HTML like <div>, but now it uses :::. For instance, after exporting two entries with pandoc -t markdown-citations --wrap=none, this is the resulting output:

(Blackwell and Glynn 2018; Cinelli and Hazlett 2020)

::: {#refs .references .hanging-indent}
::: {#ref-BlackwellGlynn:2018}
Blackwell, Matthew, and Adam N. Glynn. 2018. "How to Make Causal Inferences with Time-Series Cross-Sectional Data Under Selection on Observables." *American Political Science Review* 112 (4): 1067--82. <https://doi.org/10.1017/s0003055418000357>.
:::

::: {#ref-CinelliHazlett:2020}
Cinelli, Carlos, and Chad Hazlett. 2020. "Making Sense of Sensitivity: Extending Omitted Variable Bias." *Journal of the Royal Statistical Society: Series B (Statistical Methodology)* 82 (1): 39--67. <https://doi.org/10.1111/rssb.12348>.
:::
:::

The tail -n+5 part of the pandoc command in exportMarkdownReferences.sh takes care of the first few lines with the parenthetical citations, but the old grep -v "</div>" part of the command doesn't do anything anymore and the resulting Markdown text includes all the lines that start with :::.

This change to the pandoc command omits all lines that start with :::, resulting in this output:

Blackwell, Matthew, and Adam N. Glynn. 2018. "How to Make Causal Inferences with Time-Series Cross-Sectional Data Under Selection on Observables." *American Political Science Review* 112 (4): 1067--82. <https://doi.org/10.1017/s0003055418000357>.

Cinelli, Carlos, and Chad Hazlett. 2020. "Making Sense of Sensitivity: Extending Omitted Variable Bias." *Journal of the Royal Statistical Society: Series B (Statistical Methodology)* 82 (1): 39--67. <https://doi.org/10.1111/rssb.12348>.

When exporting to markdown, pandoc no longer uses html like `<div>` to delineate bibliography items, but uses `:::` instead. This omits those lines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant