Skip to content

Commit

Permalink
Merge branch 'galaxyproject:main' into DASH-1211
Browse files Browse the repository at this point in the history
  • Loading branch information
kkamieniecka authored Oct 23, 2023
2 parents f58fb4e + 0d38876 commit a3fa713
Show file tree
Hide file tree
Showing 95 changed files with 482,773 additions and 206 deletions.
9 changes: 6 additions & 3 deletions CONTRIBUTORS.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,7 @@ khanteymoori:
Khaled196:
name: Khaled Jum'ah
email: [email protected]
orcid: 0000-0001-5481-8893
joined: 2022-09

kinow:
Expand Down Expand Up @@ -1753,18 +1754,20 @@ carpentries:
name: The Carpentries
joined: 2021-09

erasmusplus:
name: Erasmus+ Programme
gallantries:
name: Gallantries Project
joined: 2020-09
avatar: "https://www.erasmusplus.nl/assets/images/logo.png"
avatar: "https://gallantries.github.io/assets/images/gallantries-logo.png"
github: false
funder: true
url: "https://www.erasmusplus.nl"
funder_name: Erasmus+ Programme
funding_id: 2020-1-NL01-KA203-064717
funding_system: erasmusplus
funding_statement: |
This project ([`2020-1-NL01-KA203-064717`](https://ec.europa.eu/programmes/erasmus-plus/projects/eplus-project-details/#project/2020-1-NL01-KA203-064717)) is funded with the support of the Erasmus+ programme of the European Union. Their funding has supported a large number of tutorials within the GTN across a wide array of topics.
![eu flag with the text: with the support of the erasmus programme of the european union](https://gallantries.github.io/assets/images/logosbeneficaireserasmusright_en.jpg)
![erasmus plus logo](https://www.erasmusplus.nl/assets/images/logo.png)
avans-atgm:
name: Avans Hogeschool
Expand Down
11 changes: 8 additions & 3 deletions _layouts/contributor_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,14 @@ <h4>Favourite Formats</h4>
</div>

<div class="col-md-9">
<h1>
{{ contributors[page.contributor].name | default: page.contributor }}
</h1>
<hgroup>
<h1>
{{ contributors[page.contributor].name | default: page.contributor }}
</h1>
{% if contributors[page.contributor].funder_name %}
<p>Funded by {{ contributors[page.contributor].funder_name }}</p>
{% endif %}
</hgroup>
{% if contributors[page.contributor].funder %}
<div class="label label-default label-large" style="{{ 'GTN Funder' | colour_tag }}">GTN Funder</div>
{% endif %}
Expand Down
19 changes: 6 additions & 13 deletions _layouts/learning-pathway.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,14 @@
{% endif %}


<section>
<h3> GTN Learning Pathway </h3>
<div>
<div style="display:inline-block;vertical-align:top;width:10%">
<img src="{{site.baseurl}}/assets/images/learning-pathway.png" alt="A graphic depicting a winding path from a start symbol to a trophy, with tutorials along the way" />
</div>
<div style="display:inline-block; margin-left: 2em; width:70%">
We recommend you follow the tutorials in the order presented on this page. They have been selected to fit together and build up your knowledge step by step. If a lesson has both slides and a tutorial, we recommend you start with the slides, then proceed with the tutorial.
</div>
</div>
</section>
<section class="tutorials-list {{ page.topic_name }} topic-type-{{ topic.type }}">
<hgroup>
<h1>{{ pathway.title }}</h1>
{% icon purl %}<abbr title="Persistent URL">PURL</abbr>:</strong> <a href="https://gxy.io/GTN:{{ page.short_id }}">https://gxy.io/GTN:{{ page.short_id }}</a>
</hgroup>

{% snippet faqs/gtn/what-is-a-learning-pathway.md %}

<section class="tutorials-list {{ page.topic_name }} topic-type-{{ topic.type }}">
<h1>{{ pathway.title }}</h1>
<p>{{ pathway.description | markdownify }}</p>
<p>{{ content | markdownify }}</p>

Expand Down
40 changes: 32 additions & 8 deletions _plugins/gtn/shortlinks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
module Gtn
# This module is responsible for generating shortlinks for tutorials and FAQs
module Shortlinks
CATEGORY_TUTORIAL = 'T'
CATEGORY_SLIDES = 'S'
CATEGORY_FAQ = 'F'
CATEGORY_NEWS = 'N'
CATEGORY_PATHWAYS = 'P'

def self.mapped?(tutorial, current_mapping)
current_mapping['id'].values.include? tutorial
end
Expand All @@ -18,8 +24,8 @@ def self.update(current_mapping)
# If it's not already mapped by a key, add it.
if !mapped?(html_path, current_mapping)
# Generate a short code
short_code_number = current_mapping['id'].select { |x| x[0] == 'T' }.length.to_s.rjust(5, '0')
short_code = "T#{short_code_number}"
short_code_number = current_mapping['id'].select { |x| x[0] == CATEGORY_TUTORIAL }.length.to_s.rjust(5, '0')
short_code = CATEGORY_TUTORIAL + short_code_number
puts "Discovered tutorial #{short_code}"
# If the target of this flavour of short code isn't already in here, then add it
current_mapping['id'][short_code] = html_path
Expand All @@ -37,8 +43,8 @@ def self.update(current_mapping)
# If it's not already mapped by a key, add it.
if !mapped?(html_path, current_mapping)
# Generate a short code
short_code_number = current_mapping['id'].select { |x| x[0] == 'S' }.length.to_s.rjust(5, '0')
short_code = "S#{short_code_number}"
short_code_number = current_mapping['id'].select { |x| x[0] == CATEGORY_SLIDES }.length.to_s.rjust(5, '0')
short_code = CATEGORY_SLIDES + short_code_number
puts "Discovered slides #{short_code}"
# If the target of this flavour of short code isn't already in here, then add it
current_mapping['id'][short_code] = html_path
Expand All @@ -64,8 +70,8 @@ def self.update(current_mapping)
# If it's not already mapped by a key, add it.
if !mapped?(html_path, current_mapping)
# Generate a short code
short_code_number = current_mapping['id'].select { |x| x[0] == 'F' }.length.to_s.rjust(5, '0')
short_code = "F#{short_code_number}"
short_code_number = current_mapping['id'].select { |x| x[0] == CATEGORY_FAQ }.length.to_s.rjust(5, '0')
short_code = CATEGORY_FAQ + short_code_number
puts "Discovered FAQ #{short_code}"
# If the target of this flavour of short code isn't already in here, then add it
current_mapping['id'][short_code] = html_path
Expand All @@ -79,14 +85,32 @@ def self.update(current_mapping)
# If it's not already mapped by a key, add it.
if !mapped?(html_path, current_mapping)
# Generate a short code
short_code_number = current_mapping['id'].select { |x| x[0] == 'N' }.length.to_s.rjust(5, '0')
short_code = "N#{short_code_number}"
short_code_number = current_mapping['id'].select { |x| x[0] == CATEGORY_NEWS }.length.to_s.rjust(5, '0')
short_code = CATEGORY_NEWS + short_code_number
puts "Discovered news #{short_code}"
# If the target of this flavour of short code isn't already in here, then add it
current_mapping['id'][short_code] = html_path
end
end

# Discover learning pathways
lps = Dir.glob('learning-pathways/*.md')
lps.reject! { |t| t =~ /index.md/ }
lps.reject! { |t| t =~ /pathway-example.md/ }

lps.each do |tutorial|
html_path = "/#{tutorial.gsub(/md$/, 'html')}"
# If it's not already mapped by a key, add it.
if !mapped?(html_path, current_mapping)
# Generate a short code
short_code_number = current_mapping['id'].select { |x| x[0] == CATEGORY_PATHWAYS }.length.to_s.rjust(5, '0')
short_code = CATEGORY_PATHWAYS + short_code_number
puts "Discovered slides #{short_code}"
# If the target of this flavour of short code isn't already in here, then add it
current_mapping['id'][short_code] = html_path
end
end

current_mapping
end
end
Expand Down
2 changes: 1 addition & 1 deletion _plugins/jekyll-topic-filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ def self.list_videos(site)
#
def self.list_all_tags(site)
materials = process_pages(site, site.pages)
(materials.map { |x| x['tags'] || [] }.flatten + self.list_topics(site)).sort.uniq
(materials.map { |x| x['tags'] || [] }.flatten + list_topics(site)).sort.uniq
end

def self.filter_by_topic(site, topic_name)
Expand Down
2 changes: 1 addition & 1 deletion assets/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ body {
// boxes visible, no matter what their collapse state.
@media screen {
.box-collapsed {
display: none;
display: none !important; // important Overrides specifically one case of a learning pathway FAQ where we use some custom display already to get objects floating correctly in the snippet.
}
}

Expand Down
74 changes: 33 additions & 41 deletions bin/news.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def linkify(text, path)

def printableMaterial(path)
d = YAML.load_file(path)
{md: linkify(d['title'], path.gsub(/.md/, '.html')),
path: path}
{ md: linkify(d['title'], path.gsub(/.md/, '.html')),
path: path }
end

def fixNews(n)
Expand Down Expand Up @@ -110,34 +110,30 @@ def fixNews(n)
}

def titleize(t)
t.gsub(/-/, ' ').gsub(/\w+/) do |word|
word.capitalize
end
t.gsub('-', ' ').gsub(/\w+/, &:capitalize)
end

def format_news(news)
output = ""
output = ''
if news.length.positive?
output += "\n\n## Big News!\n\n"
output += news.join("\n").gsub(/^/, '- ')
end
output
end

def format_tutorials(added, modified, kind: "tutorials")
output =""
if added.length.positive? or modified.length.positive?
output += "\n\n## #{added.length + modified.length} #{kind}!"
end
def format_tutorials(added, modified, kind: 'tutorials')
output = ''
output += "\n\n## #{added.length + modified.length} #{kind}!" if added.length.positive? || modified.length.positive?

if added.length.positive?
output += "\n\nNew #{kind}:\n\n"
output += added.map{|n| n[:md]}.join("\n").gsub(/^/, '- ')
output += added.map { |n| n[:md] }.join("\n").gsub(/^/, '- ')
end

if modified.length.positive?
output += "\n\nUpdated #{kind}:\n\n"
output += modified.map{|n| n[:md]}.join("\n").gsub(/^/, '- ')
output += modified.map { |n| n[:md] }.join("\n").gsub(/^/, '- ')
end
output
end
Expand All @@ -148,33 +144,33 @@ def build_news(data, filter: nil)
newsworthy = false

if filter.nil?
output += format_news(data[:added][:news])
newsworthy = newsworthy | format_news(data[:added][:news]).length.positive?
output += format_news(data[:added][:news])
newsworthy |= format_news(data[:added][:news]).length.positive?
end

o = format_tutorials(
data[:added][:tutorials].select{|n| filter.nil? || n[:path] =~ /topics\/#{filter}/ },
data[:modified][:tutorials].select{|n| filter.nil? || n[:path] =~ /topics\/#{filter}/ }
data[:added][:tutorials].select { |n| filter.nil? || n[:path] =~ %r{topics/#{filter}} },
data[:modified][:tutorials].select { |n| filter.nil? || n[:path] =~ %r{topics/#{filter}} }
)

output += o
newsworthy = newsworthy | o.length.positive?
newsworthy |= o.length.positive?

o = format_tutorials(
data[:added][:slides].select{|n| filter.nil? || n[:path] =~ /topics\/#{filter}/ },
data[:modified][:slides].select{|n| filter.nil? || n[:path] =~ /topics\/#{filter}/ },
kind: "slides"
data[:added][:slides].select { |n| filter.nil? || n[:path] =~ %r{topics/#{filter}} },
data[:modified][:slides].select { |n| filter.nil? || n[:path] =~ %r{topics/#{filter}} },
kind: 'slides'
)
output += o
newsworthy = newsworthy | o.length.positive?
newsworthy |= o.length.positive?

if filter.nil? && data[:contributors].length.positive?
newsworthy = true
output += "\n\n## #{data[:contributors].length} new contributors!\n\n"
output += data[:contributors].map { |c| linkify("@#{c}", "hall-of-fame/#{c}") }.join("\n").gsub(/^/, '- ')
end

return output, newsworthy
[output, newsworthy]
end

def send_news(output, options, channel: 'default')
Expand All @@ -200,23 +196,21 @@ def send_news(output, options, channel: 'default')
resp = JSON.parse(req.body)
puts resp

if resp['errcode'] == 'M_FORBIDDEN'
if resp['error'] =~ /not in room/
puts "Not in room, attempting to join"
# Join room
# POST /_matrix/client/v3/join/{roomIdOrAlias}
uri_join = URI("#{homeserver[:server]}/_matrix/client/v3/join/#{homeserver[:room]}")
req = Net::HTTP.post(uri_join, JSON.generate({}), headers)
if resp['errcode'] == 'M_FORBIDDEN' && (resp['error'] =~ /not in room/)
puts 'Not in room, attempting to join'
# Join room
# POST /_matrix/client/v3/join/{roomIdOrAlias}
uri_join = URI("#{homeserver[:server]}/_matrix/client/v3/join/#{homeserver[:room]}")
req = Net::HTTP.post(uri_join, JSON.generate({}), headers)
# Parse response
resp = JSON.parse(req.body)

# Now we're safe to re-try
if resp.key?('room_id')
req = Net::HTTP.post(uri_send_message, JSON.generate(data), headers)
# Parse response
resp = JSON.parse(req.body)

# Now we're safe to re-try
if resp.key?('room_id')
req = Net::HTTP.post(uri_send_message, JSON.generate(data), headers)
# Parse response
resp = JSON.parse(req.body)
puts resp
end
puts resp
end
end
else
Expand All @@ -231,6 +225,4 @@ def send_news(output, options, channel: 'default')
end

output, newsworthy = build_news(data, filter: 'single-cell')
if newsworthy
send_news(output, options, channel: 'single-cell')
end
send_news(output, options, channel: 'single-cell') if newsworthy
3 changes: 3 additions & 0 deletions bin/schema-contributors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ mapping:
funder:
type: bool
description: Set this to true if this entity is a funding agency.
funder_name:
type: str
description: A human-readable name which will be the biggest name on their contributor page.
funding_id:
type: str
description: The short identifier for your grant.
Expand Down
2 changes: 1 addition & 1 deletion bin/schema-news.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ mapping:
translation:
- shiltemann
funding:
- erasmusplus
- gallantries
type: map
mapping:
authorship:
Expand Down
2 changes: 1 addition & 1 deletion bin/schema-slides.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ mapping:
translation:
- shiltemann
funding:
- erasmusplus
- gallantries
type: map
mapping:
authorship:
Expand Down
2 changes: 1 addition & 1 deletion bin/schema-tutorial.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ mapping:
translation:
- shiltemann
funding:
- erasmusplus
- gallantries
type: map
mapping:
authorship:
Expand Down
14 changes: 14 additions & 0 deletions faqs/gtn/what-is-a-learning-pathway.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: What is a Learning Pathway?
area: introduction
layout: faq
box_type: comment
contributors: [shiltemann]
---

<div style="display:inline-block;vertical-align:top;width:10%">
<img src="{{site.baseurl}}/assets/images/learning-pathway.png" alt="A graphic depicting a winding path from a start symbol to a trophy, with tutorials along the way" />
</div>
<div style="display:inline-block; margin-left: 2em; width:70%">
We recommend you follow the tutorials in the order presented on this page. They have been selected to fit together and build up your knowledge step by step. If a lesson has both slides and a tutorial, we recommend you start with the slides, then proceed with the tutorial.
</div>
2 changes: 1 addition & 1 deletion learning-pathways/genome-annotation-eukaryote.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cover-image-alt: "Galaxy Genome Annotation logo"
editorial_board:
- abretaud
funding:
- erasmusplus
- gallantries



Expand Down
2 changes: 1 addition & 1 deletion learning-pathways/genome-annotation-prokaryote.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cover-image-alt: "Galaxy Genome Annotation logo"
editorial_board:
- abretaud
funding:
- erasmusplus
- gallantries

pathway:
- section: "Module 1: Introduction"
Expand Down
2 changes: 1 addition & 1 deletion learning-pathways/intro-to-galaxy-and-ecology.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cover-image-alt: "Drawing of an Ecological System"
editorial_board:
- yvanlebras
funding:
- erasmusplus
- gallantries


pathway:
Expand Down
Loading

0 comments on commit a3fa713

Please sign in to comment.