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

[WIP] Ecosystem registry infrastructure #68

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
56 changes: 56 additions & 0 deletions README_ecosystem_plugins.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Managing the ecosystem catalog

A subset of this website is devoted to providing a catalog of software that
makes up the broader Open Free Energy ecosystem. This is intended to be a
central clearinghouse where users can find different modular tools that can be
plugged into an Open Free Energy workflow. This page documents that part of the
website.

## Adding a new catalog entry

External contributors are most likely to want to add a new catalog entry,
representing some useful code that they have created and wish to share. Adding
new entries is intended to be as easy as possible.

Basically, all you need to do is fork and clone this repo, and add a new item
under the `_ecosystem/` directory. This will be a Markdown file with YAML
frontmatter. Copy the `_ecosystem/_defaults.md` file to get a template that
you can work from.

Add that file in a branch on your fork, and make a pull request to have your
new entry added to the catalog!

NOTE: Each ecosystem catalog entry should fit into exactly one category. If
you've created a package that involves tools from multiple categories, please
create multiple catalog entries. One pull request may contain as many catalog
entries as you would like to add.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't correct any more right? one entry can list multiple tools


## Customizing ecosystem configuration

The general idea here is that catalog entries represent different "categories"
of object, with the objects within a category being modular replacements for
each other. As an example, "protocol" is one of the categories for Open Free
Energy.

Details of the ecosystem configuration are in the `_config.yaml` for the site.
In particular, custom configuration the ecosystem tools are under the
`ecosystem_catalog` top-level heading. This allows you to change, e.g., the
allowed categories.

Some aspects of configuration are based on Jekyll's standard configuration
tools. In particular, note that `ecosystem` is one the Jekyll `collections`,
and note that we can set the default layout for ecosystem entries within the
standard `defaults` configuration heading.

## Changing the presentation of catalog entries

Catalog entries are shown in two different styles:

1. Full-page mode, where a full web page is dedicated to each entry. This is
intended to provide sufficient details for a reader to learn more about the
entry. You can customize this mode in `_layouts/ecosystem-entry.html`.
2. Summary mode, where a brief summary of each entry is provided, e.g., as part
of a list of other catalog entries. You can customize this mode in
`_includes/ecosystem-summary.html`.

You can, of course, always create a custom page that loops over the
13 changes: 13 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ collections:
projects:
jobs:
output: true
ecosystem:
output: true

ecosystem_catalog:
category_labels:
atommapper: "Atom Mappers"
networkplanner: "Network Planners"
protocol: "Protocols"

paginate: 10
paginate_path: "/news/:num/"
Expand Down Expand Up @@ -60,6 +68,11 @@ defaults:
type: "jobs"
values:
layout: "job"
- scope:
path: ""
type: "ecosystem"
values:
layout: "ecosystem-entry"
- scope:
path: ""
values:
Expand Down
19 changes: 19 additions & 0 deletions _ecosystem/_default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs updating to the new schema I think. I'd also err on the side of more descriptive prompts inside each placeholder, e.g. <CATEGORY (one of Atom Mapper, Scorer, Planner, Protocol)>

name: <NAME OF ENTRY>
category: <CATEGORY>
developers: <DEVELOPERS AS A STRING>
source: <URL FOR SOURCE CODE>
license: <STRING NAME OF LICENSE>
summary: >-
<ADD SUMMARY HERE>

### FOLLOWING ARE OPTIONAL
# docs: <URL FOR DOCUMENTATION>
# contact: <EMAIL FOR CONTACT>
# publications:
# - <LIST OF DOI>
# thumbnail:
# src: <URL FOR THUMBNAIL IMAGE>
# alt: <ALT TEXT FOR THUMBNAIL>
---
<FREE FORM LONG DESCRIPTION HERE>
11 changes: 11 additions & 0 deletions _ecosystem/example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: An example plugin
category: atommapper
developers: Those cool cats at OpenFE
source: https://github.com/openfreeenergy/openfreeenergy.github.io
license: MIT
summary: >-
An awesome OpenFE plugin
---

Now let me tell you all the awesome details about this plugin.
11 changes: 11 additions & 0 deletions _ecosystem/example2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: Another example plugin
category: protocol
developers: more cool cats at OpenFE
source: https://github.com/openfreeenergy/openfreeenergy.github.io
license: MIT
summary: >-
A protocol plugin
---


13 changes: 13 additions & 0 deletions _ecosystem/kartograf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: Kartograf
category: atommapper
developers: Ben Ries and other OpenFE people
source: https://github.com/openfreeenergy/kartograf
license: MIT
summary: >-
Kartograf is a 3D-first atom mapper. This allows it to avoid some problems,
particularly those around chirality, that can occur with 2D mappers (e.g.,
those focused on common substructure.) Ben can expand this a little if he wants.
---

This is where Ben should write a lot more detail about Kartograf.
36 changes: 36 additions & 0 deletions _ecosystem/lomap-mapper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: LOMAP Atom Mapper
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where e.g. the Lomap2 package is providing, LomapAtomMapper, lomap_default_score and lomap_network_planner. This should be all visible on one page, but also in the categorised list too

category: atommapper
developers: Mobley Lab and Open Free Energy
source: https://github.com/openfreeenergy/Lomap
license: MIT
summary: >-
The LOMAP atom mapper is based on a maximum common substructure approach to
detemine the mapping between two ligands.
---

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Elit duis tristique sollicitudin
nibh sit amet. Vitae auctor eu augue ut lectus. Sit amet dictum sit amet justo
donec enim diam. Id venenatis a condimentum vitae sapien pellentesque habitant
morbi. Ut eu sem integer vitae justo eget magna fermentum iaculis. Vel orci
porta non pulvinar neque laoreet suspendisse interdum. Curabitur vitae nunc sed
velit. Id aliquet risus feugiat in ante metus dictum at. Venenatis cras sed
felis eget velit aliquet sagittis id. Nibh sed pulvinar proin gravida
hendrerit. Eget nullam non nisi est. Viverra maecenas accumsan lacus vel
facilisis volutpat est velit egestas. Lectus vestibulum mattis ullamcorper
velit sed. Pellentesque elit ullamcorper dignissim cras tincidunt lobortis
feugiat. Dolor sed viverra ipsum nunc aliquet bibendum enim.

Morbi non arcu risus quis varius quam quisque id. Dui sapien eget mi proin sed.
Nunc vel risus commodo viverra maecenas accumsan lacus. Condimentum mattis
pellentesque id nibh tortor id aliquet lectus. In metus vulputate eu
scelerisque felis imperdiet proin. Id velit ut tortor pretium viverra
suspendisse potenti. Ut pharetra sit amet aliquam id. In fermentum et
sollicitudin ac orci phasellus egestas tellus. Ultricies mi eget mauris
pharetra. Nunc id cursus metus aliquam. Nunc non blandit massa enim nec dui
nunc mattis. Mattis aliquam faucibus purus in massa tempor nec feugiat nisl.
Lacus sed turpis tincidunt id aliquet risus feugiat in ante. Nisl purus in
mollis nunc sed. In hac habitasse platea dictumst quisque sagittis. Neque
ornare aenean euismod elementum nisi quis eleifend. Vel quam elementum pulvinar
etiam non quam lacus suspendisse.
24 changes: 24 additions & 0 deletions _includes/ecosystem-summary.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% comment %}
This is the include file for a catalog entry summary card. Style can be done
in SASS/CSS. In this implementation, there's a paragraph for the entry
name (which links to the entry's full page), a paragraph for the developers,
a paramgraph for the entry's summary, and a list of bullet points for the
license and anything else we might want to add to the summary.
{% endcomment %}

<div class="ecosystemSummary" id="ecosystem-{{ include.entry.name }}">
<p class="ecosystemSummaryTitle">
<a href="{{ include.entry.url }}">{{ include.entry.name }}</a>
</p>
<p class="ecosystemSummaryAuthor">
{{ include.entry.developers }}
</p>
<p class="ecosystemSummarySummary">
{{ include.entry.summary }}
</p>
<!-- TODO: add this in later, once there are more things to include
<ul class="ecosystemSummaryExtras">
<li>{{ include.entry.license }}</li>
</ul>
-->
</div>
32 changes: 32 additions & 0 deletions _layouts/ecosystem-entry.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
layout: page
---

<div class="ecosystemEntry">

<!-- TODO: this should probably be converted to an HTML5 <aside> -->
<div class="ecosystemDetailsBox">
<dl>
<dt>Developers</dt>
<dd class="ecosystemEntryDevelopers">{{ page.developers }}</dd>
<dt>Source code</dt>
<!-- TODO: extract GitHub links to make prettier -->
<dd class="ecosystemEntrySourceCode">
<a href="{{ page.source }}">{{ page.source }}</a>
</dd>
<dt>License</dt>
<dd class="ecosystemEntryLicense">
{{ page.license }}
</dd> <!-- TODO: link known licenses -->
</dl>
{{ page.summary | markdownify }}
</div>

<p><span class="ecosystemCategoryLabel">
{% assign label = site.ecosystem_catalog.category_labels[page.category] %}
{{ label | upcase }}
</span></p>

{{ page.content | markdownify }}

</div>
94 changes: 94 additions & 0 deletions _sass/customizations.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,97 @@ code {
}


// for the ecosystem summary entries (e.g., ecosystem.html)
ul.ecosystemSummaryList {
display: flex;
flex-flow: row wrap;
gap: 10px;
}

li.ecosystemSummaryItem {
display: inline-block;
flex: 0 0 45%;
vertical-align: top;
border: 1px solid var(--other-blue);
padding: 1ex;
box-shadow: 2px 2px 2px var(--beastly-grey);
}

div.ecosystemSummary {
float: left;
margin-bottom: 0px;
margin-block-start: 0px;
height: 100%;
}

.ecosystemSummary p {
margin-bottom: 10px;
line-height: normal;
}

p.ecosystemSummaryTitle {
font-size: 1.0em;
font-weight: 600;
margin-top: 5px;
}

p.ecosystemSummaryAuthor {
font-size: 0.5em;
font-weight: 300;
}

p.ecosystemSummarySummary {
font-size: 0.8em;
font-weight: 300;
line-height: 1.1em;
}

ul.ecosystemSummaryExtras {
font-size: 0.5em;
font-weight: 300;
}

ul.ecosystemSummaryExtras li {
display: inline-block;
}

// switch to 1-column layout for mobile
@media screen and (max-width: 639px) {
ul.ecosystemSummaryList {
flex-flow: column nowrap;
}
}


// for the ecosystem entries (individual pages)
.ecosystemEntry {
overflow: auto;
}

div.ecosystemDetailsBox {
width: 45%;
float: right;
color: var(--beastly-grey);
border: 1px solid var(--other-blue);
padding: 1ex;
margin: 1ex;
}

div.ecosystemDetailsBox dd.ecosystemEntrySourceCode {
// if URL for source is too long, use ellipsis
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

div.ecosystemDetailsBox p {
font-size: 1.0em;
}

@media screen and (max-width: 639px) {
div.ecosystemDetailsBox {
width: 90%;
float: left;
}

}
22 changes: 22 additions & 0 deletions ecosystem.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this page creates the grouped-by-category listing of all plugins right?

could we also have a page that is the grouped-by-project list of all projects and their contents?

So in my non-jinja code:

Here's all the different projects that provide plugins within the OpenFE ecosystem:

{% for project in site.ecosystem %}
<h3> project.title </h3> // links to the full page for this project?  i.e. the full rendering of the .md page?

project.short_description

{% for plugin in project %}
  emit some basic info on this tool
{% endfor %}
{% endfor %}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had thought about this, and yes, it would be straightforward to add such a page. But I had a couple doubts about the usefulness of that:

  1. I suspect that "all plugins organized by project on one page" won't be a super common view people want (at least compared to "all plugins organized by type" and "everything about a specific project", which are already implemented).
  2. The project page gives a quick overview (currently in the summary box) of all plugins in that project. I'm still working on how to make that maximally useful, but that's just a matter of tweaking the page we already have. So this is the easy way to answer the question "what are all the plugins for a given project"
  3. There's a question of where in the website to present this information. If there's only one page for all plugins, it's clear that this is linked from an "Ecosystem" tab in the main nav. If there are two pages, then do we add a secondary nav tab bar within the page to switch between them? That may start to get a little cluttered.

So yes, make that page would be easy. But I'm not entirely sure what we'd do with it once we have it. My thought is to leave it out of this PR and see if we find it needed later.

The one point this brings up is that I currently don't have a per-project short description. Each plugin needs a short description, but I don't require that for each project. This is something that can be added to the schema if we want, though.

title: Ecosystem
permalink: /ecosystem/
description: >-
Other tools in the OpenFE ecosystem.
---

{% assign grouped = site.ecosystem | group_by:"category" %}
{% for category in site.ecosystem_catalog.category_labels %}
<h3>{{ category[1] }}</h3>
{% assign cat_plugins = grouped | where: "name", category[0] %}
{% comment %}
There can only be one object in grouped with the appropriate name, so we
take cat_plugins[0]. We loop over them as li (as opposed to creating a
structure of divs) because that's better for screenreaders.
{% endcomment %}
<ul class="ecosystemSummaryList">
{% for plugin in cat_plugins[0].items %}
<li class="ecosystemSummaryItem">{% include ecosystem-summary.html entry=plugin %}</li>
{% endfor %}
</ul>
{% endfor %}