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

Commit

Permalink
feat(Microdata): Use microdata-based CSS selectors for references.
Browse files Browse the repository at this point in the history
- Update citations in eLife example article.html to use itemtypes/itemprops, and apply eLife styles.
  • Loading branch information
jwijay committed Aug 6, 2019
1 parent 26f5396 commit a7b690d
Show file tree
Hide file tree
Showing 2 changed files with 184 additions and 67 deletions.
151 changes: 84 additions & 67 deletions src/demo/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -6553,9 +6553,91 @@ <h2>
References
</h2>

<ol>
<ol itemtype="https://stencila.github.io/schema/CiteGroup">
<li>
1
<ul itemtype="https://stencila.github.io/schema/Cite">
<div itemtype="https://schema.org/CreativeWork">
<a
href="https://doi.org/10.1016/j.cell.2010.07.042"
itemprop="title"
>Cell flow reorients the axis of planar polarity in the wing
epithelium of Drosophila</a
>

<ol itemprop="authors">
<li itemtype="https://schema.org/Person">
<a
href="https://scholar.google.com/scholar?q=%22author:B+Aigouy%22"
>B Aigouy</a
>
</li>
<li itemtype="https://schema.org/Person">
<a
href="https://scholar.google.com/scholar?q=%22author:R+Farhadifar%22"
>R Farhadifar</a
>
</li>
<li itemtype="https://schema.org/Person">
<a
href="https://scholar.google.com/scholar?q=%22author:DB+Staple%22"
>DB Staple</a
>
</li>
<li itemtype="https://schema.org/Person">
<a
href="https://scholar.google.com/scholar?q=%22author:A+Sagner%22"
>A Sagner</a
>
</li>
<li itemtype="https://schema.org/Person">
<a
href="https://scholar.google.com/scholar?q=%22author:JC+R%C3%B6per%22"
>JC Röper</a
>
</li>
<li itemtype="https://schema.org/Person">
<a
href="https://scholar.google.com/scholar?q=%22author:F+J%C3%BClicher%22"
>F Jülicher</a
>
</li>
<li itemtype="https://schema.org/Person">
<a
href="https://scholar.google.com/scholar?q=%22author:S+Eaton%22"
>S Eaton</a
>
</li>
</ol>

<span itemprop="datePublished">(2010)</span>

<ul itemtype="https://stencila.github.io/schema/PublicationIssue">
<em itemprop="title">Cell</em>
<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"
>https://doi.org/10.1016/j.cell.2010.07.042</a
>

<ul itemprop="abstracts">
<li itemtype="https://stencila.github.io/schema/Abstract">
<a href="https://www.ncbi.nlm.nih.gov/pubmed/20813263"
>PubMed</a
>
</li>
<li itemtype="https://stencila.github.io/schema/Abstract">
<a
href="https://scholar.google.com/scholar_lookup?title=Cell+flow+reorients+the+axis+of+planar+polarity+in+the+wing+epithelium+of+Drosophila&amp;author=B+Aigouy&amp;author=R+Farhadifar&amp;author%5B2%5D=DB+Staple&amp;author%5B3%5D=A+Sagner&amp;author%5B4%5D=JC+R%C3%B6per&amp;author%5B5%5D=F+J%C3%BClicher&amp;author%5B6%5D=S+Eaton&amp;publication_year=2010&amp;journal=Cell&amp;volume=142&amp;pages=pp.+773%E2%80%93786&amp;pmid=20813263"
>Google Scholar</a
>
</li>
</ul>
</div>
</ul>
</li>
<li>
2
Expand Down Expand Up @@ -6661,71 +6743,6 @@ <h2>
</li>
<li>
36

<p>
A mutational analysis of
<em>
dishevelled
</em>
in
<em>
Drosophila
</em>
defines novel domains in the dishevelled protein as well as novel
suppressing alleles of
<em>
axin
</em>
</p>
<ol>
<li>
<a
href="https://scholar.google.com/scholar?q=%22author:A+Penton%22"
>
A Penton
</a>
</li>
<li>
<a
href="https://scholar.google.com/scholar?q=%22author:A+Wodarz%22"
>
A Wodarz
</a>
</li>
<li>
<a
href="https://scholar.google.com/scholar?q=%22author:R+Nusse%22"
>
R Nusse
</a>
</li>
</ol>
<p>
(2002)
</p>
<p>
<em>
Genetics
</em>
<strong>
161
</strong>
:747–762.
</p>
<ul>
<li>
<a href="https://www.ncbi.nlm.nih.gov/pubmed/12072470">
PubMed
</a>
</li>
<li>
<a
href="https://scholar.google.com/scholar_lookup?title=A+mutational+analysis+of+dishevelled+in+Drosophila+defines+novel+domains+in+the+dishevelled+protein+as+well+as+novel+suppressing+alleles+of+axin&amp;author=A+Penton&amp;author=A+Wodarz&amp;author%5B2%5D=R+Nusse&amp;publication_year=2002&amp;journal=Genetics&amp;volume=161&amp;pages=pp.+747%E2%80%93762&amp;pmid=12072470"
>
Google Scholar
</a>
</li>
</ul>
</li>
<li>
37
Expand Down
100 changes: 100 additions & 0 deletions src/themes/eLife/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@
--bg-color: #fff;
}

@custom-selector :--cite-group [itemtype='https://stencila.github.io/schema/CiteGroup'];
@custom-selector :--cite [itemtype='https://stencila.github.io/schema/Cite'];
@custom-selector :--creative-work [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 :--publication-issue [itemtype='https://stencila.github.io/schema/PublicationIssue'];
@custom-selector :--url [itemprop='url'];
@custom-selector :--abstracts [itemprop='abstracts'];

html,
body {
background-color: var(--bg-color);
Expand Down Expand Up @@ -300,3 +310,93 @@ blockquote {
line-height: 1.56522;
}
}

:--cite-group {
list-style: none;
counter-reset: cite-counter;
margin: 0;
padding: 0;
font-family: var(--heading-font);

ol,
ul {
padding-left: 0;
list-style: none;
}

> li {
counter-increment: cite-counter;
font-size: 0.875rem;
line-height: 1.71429;
position: relative;
margin-bottom: 0.75rem;
padding-left: 3rem;

&::before {
content: counter(cite-counter);
display: inline-block;
text-align: right;
font-size: 1rem;
font-weight: 600;
position: absolute;
margin: 0 -2rem;
}
}

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

:--authors {
display: inline;

:--person {
display: inline;

a {
border-bottom: none;

&::after {
content: ', ';
}
}

&:last-child a::after {
content: normal;
}
}
}

:--publication-issue,
:--abstracts {
font-family: var(--body-font);
}

:--url {
font-size: 0.6875rem;
line-height: 2.18182;
border-bottom: none;
}

:--abstracts {
li {
display: inline;

a {
border-bottom: none;
}

&::after {
content: ' | ';
}

&:last-child::after {
content: normal;
}
}
}
}

0 comments on commit a7b690d

Please sign in to comment.