Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Commit

Permalink
fix(ELife Theme): Render citations in eLife theme by default
Browse files Browse the repository at this point in the history
- Tweaks to citations markup + CSS. Simplify `Person` (in `authors`) markup.
  • Loading branch information
jwijay committed Aug 13, 2019
1 parent 806a1f3 commit fed4c61
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 57 deletions.
4 changes: 2 additions & 2 deletions src/demo/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -6629,8 +6629,8 @@ <h2>
itemtype="https://stencila.github.io/schema/PublicationIssue"
>
<em itemprop="title">Cell</em>
<strong itemprop="issueNumber">142</strong>
<span itemprop="pagination">:773–786.</span>
<strong itemprop="issueNumber">142</strong
><span itemprop="pagination">773–786.</span>
</ul>

<a href="https://doi.org/10.1016/j.cell.2010.07.042" itemprop="url"
Expand Down
58 changes: 22 additions & 36 deletions src/demo/references.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h2>
</h2>

<ol itemprop="citations">
<li data-citation-style="eLife">
<li>
<div itemscope itemtype="https://schema.org/CreativeWork">
<a
href="https://doi.org/10.1016/j.cell.2010.07.042"
Expand Down Expand Up @@ -173,59 +173,45 @@ <h2>
<div itemscope itemtype="https://schema.org/CreativeWork">
<ol itemprop="authors">
<li itemscope itemtype="https://schema.org/Person">
<span
><a
href="https://scholar.google.com/scholar?q=%22author:B+Aigouy%22"
>Aigouy, B.</a
></span
<a
href="https://scholar.google.com/scholar?q=%22author:B+Aigouy%22"
>Aigouy, B.</a
>
</li>
<li itemscope itemtype="https://schema.org/Person">
<span
><a
href="https://scholar.google.com/scholar?q=%22author:R+Farhadifar%22"
>Farhadifar, R.</a
></span
<a
href="https://scholar.google.com/scholar?q=%22author:R+Farhadifar%22"
>Farhadifar, R.</a
>
</li>
<li itemscope itemtype="https://schema.org/Person">
<span
><a
href="https://scholar.google.com/scholar?q=%22author:DB+Staple%22"
>Staple, DB.</a
></span
<a
href="https://scholar.google.com/scholar?q=%22author:DB+Staple%22"
>Staple, D.B.</a
>
</li>
<li itemscope itemtype="https://schema.org/Person">
<span
><a
href="https://scholar.google.com/scholar?q=%22author:A+Sagner%22"
>Sagner, A.</a
></span
<a
href="https://scholar.google.com/scholar?q=%22author:A+Sagner%22"
>Sagner, A.</a
>
</li>
<li itemscope itemtype="https://schema.org/Person">
<span
><a
href="https://scholar.google.com/scholar?q=%22author:JC+R%C3%B6per%22"
>Röper, JC.</a
></span
<a
href="https://scholar.google.com/scholar?q=%22author:JC+R%C3%B6per%22"
>Röper, J.C.</a
>
</li>
<li itemscope itemtype="https://schema.org/Person">
<span
><a
href="https://scholar.google.com/scholar?q=%22author:F+J%C3%BClicher%22"
>Jülicher, F.</a
></span
<a
href="https://scholar.google.com/scholar?q=%22author:F+J%C3%BClicher%22"
>Jülicher, F.</a
>
</li>
<li itemscope itemtype="https://schema.org/Person">
<span
><a
href="https://scholar.google.com/scholar?q=%22author:S+Eaton%22"
>Eaton, S.</a
></span
<a
href="https://scholar.google.com/scholar?q=%22author:S+Eaton%22"
>Eaton, S.</a
>
</li>
</ol>
Expand Down
52 changes: 33 additions & 19 deletions src/themes/eLife/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
--bg-color: #fff;
}

@custom-selector :--CiteGroup [itemtype='https://stencila.github.io/schema/CiteGroup'];
@custom-selector :--Cite [itemtype='https://stencila.github.io/schema/Cite'];
@custom-selector :--CreativeWork [itemtype='https://schema.org/CreativeWork'];
@custom-selector [itemtype='https://stencila.github.io/schema/CiteGroup'];
@custom-selector [itemtype='https://stencila.github.io/schema/Cite'];
@custom-selector [itemtype='https://schema.org/CreativeWork'];
@custom-selector :--title [itemprop='title'];
@custom-selector :--authors [itemprop='authors'];
@custom-selector :--Person [itemtype='https://schema.org/Person'];
@custom-selector [itemtype='https://schema.org/Person'];
@custom-selector :--citations [itemprop='citations'];
@custom-selector :--PublicationIssue [itemtype='https://stencila.github.io/schema/PublicationIssue'];
@custom-selector [itemtype='https://stencila.github.io/schema/PublicationIssue'];
@custom-selector :--datePublished [itemprop='datePublished'];
@custom-selector :--issueNumber [itemprop='issueNumber'];
@custom-selector :--pagination [itemprop='pagination'];
Expand Down Expand Up @@ -351,14 +351,24 @@ blockquote {
padding-left: 0;
list-style: none;
}

:--CreativeWork > :--title {
display: inline-block;
font-size: 1rem;
line-height: 1.5;
font-weight: 600;
border-bottom: none;
}

:--citation-style-eLife {
/* eLife theme specific styles for citation titles */
:--citation-style-MLA,
:--citation-style-APA {
:--CreativeWork > :--title {
display: inline-block;
font-size: 1rem;
line-height: 1.5;
font-weight: 600;
border-bottom: none;
display: inline;
font-size: 0.875rem;
line-height: 1.71429;
font-weight: normal;
border-bottom: 1px dotted var(--text-color);
}
}

Expand All @@ -368,15 +378,16 @@ blockquote {
:--Person {
display: inline;

span::after {
a {
border-bottom: none;
}

&::after {
content: ', ';

a {
border-bottom: none;
}
}

&:last-child span::after {
&:last-child::after {
content: normal;
}
}
Expand Down Expand Up @@ -419,10 +430,13 @@ blockquote {

:--citation-style-MLA {
:--CreativeWork > :--title {
&::before,
&::after {
&::before {
content: '"';
}

&::after {
content: '."';
}
}

:--PublicationIssue {
Expand All @@ -445,7 +459,7 @@ blockquote {

:--authors {
:--Person {
&:last-child span::before {
&:last-child::before {
content: '& ';
}
}
Expand Down

0 comments on commit fed4c61

Please sign in to comment.