Skip to content
Snippets Groups Projects
Commit dae96f7c authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Add abstract of papers to the publications' webpage

parent 55dce53d
No related branches found
No related tags found
No related merge requests found
...@@ -4,13 +4,15 @@ import sys ...@@ -4,13 +4,15 @@ import sys
# Query papers citing the two SWIFT ADS entries # Query papers citing the two SWIFT ADS entries
query = ADSQueryWrapper(sys.argv[1]) query = ADSQueryWrapper(sys.argv[1])
query_data = query.get("citations(2016pasc.conf....2S) or citations(2018ascl.soft05020S)", fl="title,bibcode,first_author_norm,date,year,doi,author_count,pub_raw,bibstem", rows=1000) query_data = query.get("citations(2016pasc.conf....2S) or citations(2018ascl.soft05020S)", fl="title,bibcode,first_author_norm,date,year,author_count,bibstem,abstract", rows=1000)
paper_list = query_data.papers paper_list = query_data.papers
# Process the data to make the title a string and not an array of strings # Process the data to make the title a string and not an array of strings
for paper in paper_list: for paper in paper_list:
paper.title = paper.title[0] paper.title = paper.title[0]
paper.bibstem = paper.bibstem[0] paper.bibstem = paper.bibstem[0]
if hasattr(paper, "abstract"):
paper.abstract = paper.abstract.replace("<P />", "")
# Create a dictionary of cards # Create a dictionary of cards
my_list = dict({"num_papers": query_data.num_found, my_list = dict({"num_papers": query_data.num_found,
......
...@@ -14,18 +14,25 @@ ...@@ -14,18 +14,25 @@
<h2>Publications using SWIFT</h2> <h2>Publications using SWIFT</h2>
</div> </div>
<div> The following {{ num_papers }} have made use of SWIFT for their results:</div> <div> The following {{ num_papers }} publications have made use of SWIFT obtain their results:</div>
{% set count = num_papers %} {% set count = num_papers %}
{% for card in cards|sort_cards %} {% for card in cards|sort_cards %}
<div class="card-text"> <div class="card-text">
<h4>{{ count + 1 - loop.index }}) <a href="https://ui.adsabs.harvard.edu/abs/{{ card.bibcode }}/abstract">{{ card.title }}</h4></a> <h4>{{ count + 1 - loop.index }}) <a href="https://ui.adsabs.harvard.edu/abs/{{ card.bibcode }}/abstract">{{ card.title }}</h4></a>
<p>
{% if card.author_count > 1 %} {% if card.author_count > 1 %}
<p>{{ card.first_author_norm }} et al., {{ card.bibstem }}, {{ card.year }}</p> {{ card.first_author_norm }} et al.,
{% else %} {% else %}
<p>{{ card.first_author_norm }}, {{ card.bibstem }}, {{ card.year }}</p> {{ card.first_author_norm }},
{% endif %} {% endif %}
<i>{{ card.bibstem }}</i>, {{ card.year }}
{% if card.abstract %}
<p class="hideshow">Abstract <i class="fa fa-chevron-right" aria-hidden="true"></i></p>
<p class="abstract card">{{ card.abstract }}</p>
{% endif %}
</p>
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment