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

Reworked team page look and building process #2855

Merged
merged 12 commits into from Jan 24, 2022
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 38 additions & 0 deletions web/_static/css/team.css
@@ -0,0 +1,38 @@
.member-card {
background-color: #E6E6E6;
margin-bottom: 2.5rem;
}

.member-header {
background-color: #2D2D2D;
color: #EBEBEB;
padding: 0.5em;
font-weight: 500;
}

.member-header:hover .headerlink {
display: inline-block;
}

.member-body {
display: flex;
/* Padding on all sides except the bottom,
as the right-panel takes care of this padding */
padding: 1em 1em 0em 1em;
}

.member-left-panel {
/* This panel only exists if there is an image to fill it. */
padding-right: 1em;
}

.member-right-panel {
/* This panel extends as far as it can */
flex: 1;
/* padding-left: 1em; */
}

.github-link {
font-weight: 200;
float: right;
}
File renamed without changes
Binary file added web/_static/images/tomaarsen.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
54 changes: 54 additions & 0 deletions web/_templates/team.html
@@ -0,0 +1,54 @@
<link rel="stylesheet" href="_static/css/team.css">
tomaarsen marked this conversation as resolved.
Show resolved Hide resolved

{% for member in members -%}
<div class="member-card" id="{{ member.github_username }}">
<div class="member-header">
{%- if member.personal_website_url %}
<a href="{{ member.personal_website_url }}">
{{ member.full_name }}
</a>
{%- else %}
{{ member.full_name }}
{%- endif %}
<a class="headerlink" href="#{{ member.github_username }}" title="Permalink to {{ member.full_name }}">&para;</a>
<a class="reference internal github-link" href="https://www.github.com/{{ member.github_username}}">
@{{ member.github_username }}
</a>
</div>

<div class="member-body">
{%- if member.photo_path %}
<div class="member-left-panel">
<a class="reference internal" href="https://www.github.com/{{ member.github_username }}">
<img src="{{ member.photo_path }}" alt="{{ member.full_name }}" width="200" height="200">
</a>
</div>
{%- endif %}

<div class="member-right-panel">
<dl class="field-list">
{%- if member.location %}
<dt>Location</dt>
<dd>
<p>{{ member.location }}</p>
</dd>
{%- endif %}

{%- if member.role %}
<dt>Role</dt>
<dd>
<p>{{ member.role }}</p>
</dd>
{%- endif %}

{%- if member.active_range %}
<dt>Active Range</dt>
<dd>
<p>{{ member.active_range }}</p>
</dd>
{%- endif %}
</dl>
</div>
</div>
</div>
{% endfor %}
29 changes: 24 additions & 5 deletions web/conf.py
Expand Up @@ -54,11 +54,14 @@ def run_apidoc(app):
)


def generate_howto():
"""Custom function for generating contents in the ``howto`` folder,
based on the ``ntlk/test/*.doctest`` files.
def generate_custom_files():
"""Generating contents in the ``howto`` folder,
based on the ``ntlk/test/*.doctest`` files, as well
as contents in the ``team`` folder, based on
``team.json``.
"""
import glob
import json
import re

from jinja2 import Template
Expand Down Expand Up @@ -91,8 +94,24 @@ def generate_howto():

print(f"Generated {len(modules)} HOWTO pages.")

# Load the team JSON data
with open(os.path.join(web_folder, "team", "team.json")) as f:
full_data = json.load(f)
print("Team data loaded!")

generate_howto()
# Load the team jinja template
with open(os.path.join(web_folder, "_templates", "team.html")) as f:
team_template = Template(f.read())

for members_type, members_data in full_data.items():
team_template.stream(members=members_data).dump(
os.path.join(web_folder, "team", f"{members_type}_team.html")
)
print(f"{members_type.title()} team HTML page written!")


# Build the Team & HOWTO page before creating the Sphinx build
generate_custom_files()

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
Expand Down Expand Up @@ -194,7 +213,7 @@ def setup(app):
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ["_static"]
html_static_path = ["_static"]

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
Expand Down
2 changes: 1 addition & 1 deletion web/index.rst
Expand Up @@ -56,7 +56,7 @@ Display a parse tree:
>>> t = treebank.parsed_sents('wsj_0001.mrg')[0]
>>> t.draw()

.. image:: images/tree.gif
.. image:: _static/images/tree.gif

NB. If you publish work that uses NLTK, please cite the NLTK book as
follows:
Expand Down
15 changes: 7 additions & 8 deletions web/team.rst
@@ -1,12 +1,11 @@
NLTK Team
=========

The NLTK project is led by `Steven Bird and Liling Tan <mailto:stevenbird1@gmail.com,alvations@gmail.com>`_.
Individual packages are maintained by the following people:
.. raw:: html
:file: team/current_team.html

:Semantics: `Dan Garrette <http://www.cs.utexas.edu/~dhg/>`_, Austin, USA (``nltk.sem, nltk.inference``)
:Parsing: `Peter Ljunglöf <https://www.cse.chalmers.se/~peb/>`_, Gothenburg, Sweden (``nltk.parse, nltk.featstruct``)
:Metrics: `Joel Nothman <http://joelnothman.com/>`_, Sydney, Australia (``nltk.metrics, nltk.tokenize.punkt``)
:Python 3: `Mikhail Korobov <http://kmike.ru/>`_, Ekaterinburg, Russia
:Releases: `Steven Bird <http://stevenbird.net>`_, Melbourne, Australia
:NLTK-Users: `Alexis Dimitriadis <A.Dimitriadis@uu.nl>`_, Utrecht, Netherlands
Former NLTK Team Members
------------------------

.. raw:: html
:file: team/former_team.html
69 changes: 69 additions & 0 deletions web/team/current_team.html
@@ -0,0 +1,69 @@
<link rel="stylesheet" href="_static/css/team.css">

<div class="member-card" id="tomaarsen">
<div class="member-header">
<a href="https://www.tomaarsen.com">
Tom Aarsen
</a>
<a class="headerlink" href="#tomaarsen" title="Permalink to Tom Aarsen">&para;</a>
<a class="reference internal github-link" href="https://www.github.com/tomaarsen">
@tomaarsen
</a>
</div>

<div class="member-body">
<div class="member-left-panel">
<a class="reference internal" href="https://www.github.com/tomaarsen">
<img src="_static/images/tomaarsen.png" alt="Tom Aarsen" width="200" height="200">
</a>
</div>

<div class="member-right-panel">
<dl class="field-list">
<dt>Location</dt>
<dd>
<p>Nijmegen, Netherlands</p>
</dd>
<dt>Role</dt>
<dd>
<p>Core Maintainer. Issue triaging, bug fixing, documentation, website.</p>
</dd>
<dt>Active Range</dt>
<dd>
<p>Since 2020</p>
</dd>
</dl>
</div>
</div>
</div>
<div class="member-card" id="this-user-hopefully-does-not-exist">
<div class="member-header">
<a href="https://www.google.com">
Arbitrary Human
</a>
<a class="headerlink" href="#this-user-hopefully-does-not-exist" title="Permalink to Arbitrary Human">&para;</a>
<a class="reference internal github-link" href="https://www.github.com/this-user-hopefully-does-not-exist">
@this-user-hopefully-does-not-exist
</a>
</div>

<div class="member-body">

<div class="member-right-panel">
<dl class="field-list">
<dt>Location</dt>
<dd>
<p>Within the Milky Way, hypothetically</p>
</dd>
<dt>Role</dt>
<dd>
<p>Introducing bugs</p>
</dd>
<dt>Active Range</dt>
<dd>
<p>For far too long</p>
</dd>
</dl>
</div>
</div>
</div>
31 changes: 31 additions & 0 deletions web/team/former_team.html
@@ -0,0 +1,31 @@
<link rel="stylesheet" href="_static/css/team.css">

<div class="member-card" id="presumably-this-user-doesnt-exist-either">
<div class="member-header">
Someone else
<a class="headerlink" href="#presumably-this-user-doesnt-exist-either" title="Permalink to Someone else">&para;</a>
<a class="reference internal github-link" href="https://www.github.com/presumably-this-user-doesnt-exist-either">
@presumably-this-user-doesnt-exist-either
</a>
</div>

<div class="member-body">

<div class="member-right-panel">
<dl class="field-list">
<dt>Location</dt>
<dd>
<p>Earth</p>
</dd>
<dt>Role</dt>
<dd>
<p>Absolutely nothing</p>
</dd>
<dt>Active Range</dt>
<dd>
<p>Who knows?</p>
</dd>
</dl>
</div>
</div>
</div>
30 changes: 30 additions & 0 deletions web/team/team.json
@@ -0,0 +1,30 @@
{
"current": [
{
"full_name": "Tom Aarsen",
"github_username": "tomaarsen",
"personal_website_url": "https://www.tomaarsen.com",
"photo_path": "_static/images/tomaarsen.png",
"location": "Nijmegen, Netherlands",
"role": "Core Maintainer. Issue triaging, bug fixing, documentation, website.",
"active_range": "Since 2020"
},
{
"full_name": "Arbitrary Human",
"github_username": "this-user-hopefully-does-not-exist",
"personal_website_url": "https://www.google.com",
"location": "Within the Milky Way, hypothetically",
"role": "Introducing bugs",
"active_range": "For far too long"
}
],
"former": [
{
"full_name": "Someone else",
"github_username": "presumably-this-user-doesnt-exist-either",
"location": "Earth",
"role": "Absolutely nothing",
"active_range": "Who knows?"
}
]
}