website with jinja
This commit is contained in:
@ -252,6 +252,7 @@ https://github.com/enginmanap/limonEngine
|
||||
https://github.com/ErikLetson/torso-ninja
|
||||
https://github.com/ErikLetson/torso-ninja-2
|
||||
https://github.com/ezEngine/ezEngine
|
||||
https://github.com/fallahn/tmxlite
|
||||
https://github.com/fallahn/xygine
|
||||
https://github.com/FaronBracy/RogueSharp
|
||||
https://github.com/fegennari/3DWorld
|
||||
@ -282,6 +283,7 @@ https://github.com/Illation/ETEngine
|
||||
https://github.com/Im-dex/xray-162
|
||||
https://github.com/jasonrohrer (add gits to his games)
|
||||
https://github.com/jatinmandav/Gaming-in-Python
|
||||
https://github.com/Jaxe-Dev/RimHUD
|
||||
https://github.com/JohanLi/uncharted-waters-2
|
||||
https://github.com/JohnLamontagne/Lunar-Engine
|
||||
https://github.com/junkdog/artemis-odb
|
||||
@ -354,6 +356,7 @@ https://github.com/rotators/Fo1in2
|
||||
https://github.com/RoxasShadow/Sottaceto
|
||||
https://github.com/roy-t/MiniRTS
|
||||
https://github.com/rramsden/ymir
|
||||
https://github.com/Ruin0x11/OpenNefia
|
||||
https://github.com/sabresaurus/SabreCSG
|
||||
https://github.com/SadConsole/SadConsole
|
||||
https://github.com/SanderMertens/flecs
|
||||
@ -397,6 +400,7 @@ https://github.com/vocollapse/Blockinger
|
||||
https://github.com/WagicProject/wagic
|
||||
https://github.com/wesnoth/haldric
|
||||
https://github.com/WohlSoft/PGE-Project
|
||||
https://github.com/wojtekpil/Godot-Octahedral-Impostors
|
||||
https://github.com/xrOxygen/xray-oxygen
|
||||
https://github.com/YuriiSalimov/15-puzzle
|
||||
https://github.com/Zal0/ZGB
|
||||
|
80
code/design/static_website_design.md
Normal file
80
code/design/static_website_design.md
Normal file
@ -0,0 +1,80 @@
|
||||
# Design of the static website
|
||||
|
||||
The website is built with the parsed entries, developers and inspirations read in Python, then a script uses Jinja templates
|
||||
to generate html pages which use a CSS framework and Javascript data tables. The finished site is pushed to a suitable
|
||||
location, only changed content would need to be copied though.
|
||||
|
||||
## Pages
|
||||
|
||||
index.html - overview of all pages
|
||||
contribute.html - information how to edit and contribute
|
||||
|
||||
games/index.html - overview of all games (with recommended keywords) sorted alphabetically
|
||||
games/table.html - overview of all games as table
|
||||
games/[A-Z].html - entries sorted by title and categorized alphabetically
|
||||
games/genres.html - all games in a certain genre
|
||||
games/languages.html - all games with a certain language
|
||||
games/platform.html - all games with a certain platform
|
||||
games/dependencies.html - all games with a certain dependency
|
||||
|
||||
inspirations/index.html - overview of all inspirations (with number of games inspired) sorted alphabetically
|
||||
inspirations/table.html - overview of all inspirations as table
|
||||
inspirations/[A-Z].html - inspirations sorted by title and categorized alphabetically
|
||||
|
||||
developers/index.html - overview of all developers (with number of games created) sorted alphabetically
|
||||
developers/table.html - overview of all developers as table
|
||||
developers/[A-Z].html - developers sorted by name and categorized alphabetically
|
||||
|
||||
statistics/index.html - overview of statistics
|
||||
statistics/keywords.html - statistics of keywords (links to genres/xx)
|
||||
statistics/state.html - statistics of inactive games
|
||||
statistics/languages.html - statistics of languages (links to languages/xx)
|
||||
statistics/licenses.html - statistics of licenses
|
||||
statistics/dependencies.html - statistics of code dependencies (links to dependencies/xx)
|
||||
statistics/build-systems.html - statistics of build systems
|
||||
|
||||
## Header/Footer
|
||||
|
||||
Header: link to overview, link to contribute, link to Github
|
||||
Footer: link to Blog, link to overviews, link to Github
|
||||
|
||||
## Pages structure
|
||||
|
||||
### Game entry
|
||||
|
||||
- Title (anchor) -- [edit] (aligned right, forwards to contribute)
|
||||
- Genre, Platform (say "unknown" if unknown), State
|
||||
- Home (main website)
|
||||
- Secondary homes: (includes code repository)
|
||||
- Inspirations: (optional)
|
||||
- Media: (optional)
|
||||
- Download: (optional)
|
||||
- Play: (optional)
|
||||
- Other keywords: (optional)
|
||||
- Developer: (optional)
|
||||
- Note: (optional)
|
||||
|
||||
Technical info (hidden initially, can be toggled on/off)
|
||||
|
||||
- Code language
|
||||
- Code repository
|
||||
- Code license
|
||||
- Code dependencies (optional)
|
||||
- Build system/information (optional)
|
||||
- Assets (optional)
|
||||
|
||||
### Inspiration entry
|
||||
|
||||
- Title (anchor) -- [edit]
|
||||
- Media: (optional)
|
||||
- Inspired entries: (with links)
|
||||
|
||||
### Developer entry
|
||||
|
||||
- Name (anchor) -- [edit]
|
||||
- Games: (with links)
|
||||
- Contact: links to profiles on SourceForge, GitHub, .. converted to links
|
||||
|
||||
## Overviews
|
||||
|
||||
Simple paragraphs with headers and columns (for example game names in three columns)
|
233
code/generate_static_website.py
Normal file
233
code/generate_static_website.py
Normal file
@ -0,0 +1,233 @@
|
||||
"""
|
||||
Generates the static website
|
||||
|
||||
Uses Jinja2 (see https://jinja.palletsprojects.com/en/2.11.x/)
|
||||
"""
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import math
|
||||
import datetime
|
||||
from utils import osg, constants as c, utils
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
|
||||
alphabet = 'abcdefghijklmnopqrstuvwxyz'
|
||||
extended_alphabet = '0' + alphabet
|
||||
|
||||
def write(text, file):
|
||||
"""
|
||||
|
||||
:param text:
|
||||
:param file:
|
||||
"""
|
||||
file = os.path.join(c.web_path, file)
|
||||
containing_dir = os.path.dirname(file)
|
||||
if not os.path.isdir(containing_dir):
|
||||
os.mkdir(containing_dir)
|
||||
utils.write_text(file, text)
|
||||
|
||||
|
||||
def sort_into_categories(list, categories, fit, unknown_category_name):
|
||||
"""
|
||||
|
||||
:param list:
|
||||
:param categories:
|
||||
:param fit:
|
||||
:param unknown_category_name:
|
||||
:return:
|
||||
"""
|
||||
categorized_sublists = {}
|
||||
for category in categories:
|
||||
sublist = [item for item in list if fit(item, category)]
|
||||
categorized_sublists[category] = sublist
|
||||
if unknown_category_name:
|
||||
# now those that do not fit
|
||||
sublist = [item for item in list if not any(fit(item, category) for category in categories)]
|
||||
categorized_sublists[unknown_category_name] = sublist
|
||||
return categorized_sublists
|
||||
|
||||
def sort_by_alphabet(list, key):
|
||||
"""
|
||||
|
||||
:param list:
|
||||
:param key:
|
||||
:return:
|
||||
"""
|
||||
return sort_into_categories(list, alphabet, lambda item, category: item[key].lower().startswith(category), '0')
|
||||
|
||||
def divide_in_columns(categorized_lists, key):
|
||||
"""
|
||||
|
||||
:param categorized_lists:
|
||||
:param key:
|
||||
:return:
|
||||
"""
|
||||
number_entries = {category: len(categorized_lists[category]) for category in categorized_lists.keys()}
|
||||
entries = {}
|
||||
for category in categorized_lists.keys():
|
||||
e = categorized_lists[category]
|
||||
e = [e[key] for e in e]
|
||||
# divide in three equal lists
|
||||
n = len(e)
|
||||
n1 = math.ceil(n/3)
|
||||
n2 = math.ceil(2*n/3)
|
||||
e = [e[:n1], e[n1:n2], e[n2:]]
|
||||
entries[category] = e
|
||||
return {'number_entries': number_entries, 'entries': entries}
|
||||
|
||||
|
||||
def generate(entries, inspirations, developers):
|
||||
"""
|
||||
|
||||
:param entries:
|
||||
:param inspirations:
|
||||
:param developers:
|
||||
"""
|
||||
|
||||
# add anchor ref () to every entry
|
||||
for entry in entries:
|
||||
entry['title-anchor'] = osg.canonical_entry_name(entry['Title'])
|
||||
|
||||
# base dictionary
|
||||
base = {
|
||||
'title': 'OSGL',
|
||||
'paths': {
|
||||
'css': 'css/bulma.min.css',
|
||||
'index': 'index.html',
|
||||
'index-games': 'games/index.html',
|
||||
'index-developers': 'developers/index.html',
|
||||
'index-inspirations': 'inspirations/index.html',
|
||||
'index-statistics': 'index-statistics'
|
||||
},
|
||||
'creation-date': datetime.datetime.utcnow()
|
||||
}
|
||||
|
||||
# copy bulma css
|
||||
os.mkdir(c.web_css_path)
|
||||
shutil.copy2(os.path.join(c.web_template_path, 'bulma.min.css'), c.web_css_path)
|
||||
|
||||
# create Jinja Environment
|
||||
environment = Environment(loader=FileSystemLoader(c.web_template_path), autoescape=True)
|
||||
environment.globals['base'] = base
|
||||
|
||||
# multiple times used templates
|
||||
template_categorical_index = environment.get_template('categorical_index.jinja')
|
||||
template_list = environment.get_template('list.jinja')
|
||||
|
||||
# index.html
|
||||
index = {'number_games': len(entries)} # TODO only count games
|
||||
template = environment.get_template('index.jinja')
|
||||
write(template.render(index=index), 'index.html')
|
||||
|
||||
# generate games pages
|
||||
games_by_alphabet = sort_by_alphabet(entries, 'Title')
|
||||
template = environment.get_template('games_for_letter.jinja')
|
||||
for letter in extended_alphabet:
|
||||
write(template.render(letter=letter, games=games_by_alphabet[letter]), os.path.join('games', '{}.html'.format(letter.capitalize())))
|
||||
|
||||
# generate games index
|
||||
index = divide_in_columns(games_by_alphabet, 'Title')
|
||||
index['title'] = 'Games index'
|
||||
index['categories'] = extended_alphabet
|
||||
write(template_categorical_index.render(index=index), os.path.join('games', 'index.html'))
|
||||
|
||||
## inspirations
|
||||
inspirations_by_alphabet = sort_by_alphabet(inspirations, 'Name')
|
||||
|
||||
# inspirations index
|
||||
index = divide_in_columns(inspirations_by_alphabet, 'Name')
|
||||
index['title'] = 'Inspirations index'
|
||||
index['categories'] = extended_alphabet
|
||||
write(template_categorical_index.render(index=index), os.path.join('inspirations', 'index.html'))
|
||||
|
||||
# inspirations single pages
|
||||
template = environment.get_template('inspirations_for_letter.jinja')
|
||||
for letter in extended_alphabet:
|
||||
write(template.render(letter=letter, inspirations=inspirations_by_alphabet[letter]), os.path.join('inspirations', '{}.html'.format(letter.capitalize())))
|
||||
|
||||
## developers
|
||||
|
||||
# developers single pages
|
||||
developers_by_alphabet = sort_by_alphabet(developers, 'Name')
|
||||
template = environment.get_template('developers_for_letter.jinja')
|
||||
for letter in extended_alphabet:
|
||||
write(template.render(letter=letter, developers=developers_by_alphabet[letter]), os.path.join('developers', '{}.html'.format(letter.capitalize())))
|
||||
|
||||
# developers index
|
||||
index = divide_in_columns(developers_by_alphabet, 'Name')
|
||||
index['title'] = 'Developers index'
|
||||
index['categories'] = extended_alphabet
|
||||
write(template_categorical_index.render(index=index), os.path.join('developers', 'index.html'))
|
||||
|
||||
## genres
|
||||
genres = c.recommended_keywords
|
||||
games_by_genre = sort_into_categories(entries, genres, lambda item, category: category in item['Keywords'], None)
|
||||
index = divide_in_columns(games_by_genre, 'Title')
|
||||
index['title'] = 'Games by genre'
|
||||
index['categories'] = genres
|
||||
write(template_categorical_index.render(index=index), os.path.join('games', 'genres.html'))
|
||||
|
||||
## games by language TODO make categories bold that have a certain amount of entries!
|
||||
languages = c.known_languages
|
||||
games_by_language = sort_into_categories(entries, languages, lambda item, category: category in item['Code language'], None)
|
||||
index = divide_in_columns(games_by_language, 'Title')
|
||||
index['title'] = 'Games by language'
|
||||
index['categories'] = languages # it's fine if they get capitalized, because they are already capitalized
|
||||
write(template_categorical_index.render(index=index), os.path.join('games', 'languages.html'))
|
||||
|
||||
## games by platform
|
||||
platforms = c.valid_platforms
|
||||
games_by_platform = sort_into_categories(entries, platforms, lambda item, category: category in item.get('Platform', []), 'Unspecified')
|
||||
index = divide_in_columns(games_by_platform, 'Title')
|
||||
index['title'] = 'Games by platform'
|
||||
index['categories'] = platforms # TODO (do not capitalize automatically)
|
||||
write(template_categorical_index.render(index=index), os.path.join('games', 'platforms.html'))
|
||||
|
||||
## statistics
|
||||
|
||||
# index
|
||||
template = environment.get_template('statistics_index.jinja')
|
||||
write(template.render(), os.path.join('statistics', 'index.html'))
|
||||
|
||||
# build-systems
|
||||
build_systems = []
|
||||
field = 'Build system'
|
||||
for entry in entries:
|
||||
if field in entry['Building']:
|
||||
build_systems.extend(entry['Building'][field])
|
||||
build_systems = [x.value for x in build_systems]
|
||||
|
||||
unique_build_systems = set(build_systems)
|
||||
unique_build_systems = [(l, build_systems.count(l)) for l in unique_build_systems]
|
||||
unique_build_systems.sort(key=lambda x: str.casefold(x[0])) # first sort by name
|
||||
unique_build_systems.sort(key=lambda x: -x[1]) # then sort by occurrence (highest occurrence first)
|
||||
data = {
|
||||
'title': 'Build system',
|
||||
'items': ['{} ({})'.format(*item) for item in unique_build_systems]
|
||||
}
|
||||
write(template_list.render(data=data), os.path.join('statistics', 'build-systems.html'))
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
# clean the output directory
|
||||
print('clean current static website')
|
||||
utils.recreate_directory(c.web_path)
|
||||
|
||||
# load entries, inspirations and developers and sort them
|
||||
print('load entries, inspirations and developers')
|
||||
entries = osg.read_entries()
|
||||
entries.sort(key=lambda x: str.casefold(x['Title']))
|
||||
|
||||
inspirations = osg.read_inspirations()
|
||||
inspirations = list(inspirations.values())
|
||||
inspirations.sort(key=lambda x: str.casefold(x['Name']))
|
||||
|
||||
developers = osg.read_developers()
|
||||
developers = list(developers.values())
|
||||
developers.sort(key=lambda x: str.casefold(x['Name']))
|
||||
|
||||
# re-generate static website
|
||||
print('re-generate static website')
|
||||
generate(entries, inspirations, developers)
|
68
code/html/base.jinja
Normal file
68
code/html/base.jinja
Normal file
@ -0,0 +1,68 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{{ base['title'] }}</title>
|
||||
<link rel="stylesheet" href="{{ base['paths']['css'] }}">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<nav class="container navbar" role="navigation" aria-label="main navigation">
|
||||
<div class="navbar-menu">
|
||||
<div class="navbar-start">
|
||||
<a class="navbar-item" href="{{ base['paths']['index'] }}">
|
||||
Home
|
||||
</a>
|
||||
|
||||
<a class="navbar-item" href="{{ base['paths']['index-games'] }}">
|
||||
Games
|
||||
</a>
|
||||
|
||||
<a class="navbar-item" href="{{ base['paths']['index-developers'] }}">
|
||||
Developers
|
||||
</a>
|
||||
|
||||
<div class="navbar-item has-dropdown is-hoverable">
|
||||
<a class="navbar-link">
|
||||
Filter
|
||||
</a>
|
||||
|
||||
<div class="navbar-dropdown">
|
||||
<a class="navbar-item" href="{{ base['paths']['index-inspirations'] }}">
|
||||
By inspiration
|
||||
</a>
|
||||
<a class="navbar-item" href="{{ base['paths']['index-developers'] }}">
|
||||
By category
|
||||
</a>
|
||||
<a class="navbar-item" href="{{ base['paths']['index-developers'] }}">
|
||||
By code language
|
||||
</a>
|
||||
<a class="navbar-item" href="{{ base['paths']['index-developers'] }}">
|
||||
By OS support
|
||||
</a>
|
||||
<a class="navbar-item" href="{{ base['paths']['index-developers'] }}">
|
||||
By dependency
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a class="navbar-item" href="{{ base['paths']['index-statistics'] }}">
|
||||
Statistics
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
{% block content %}{% endblock %}
|
||||
|
||||
<footer class="footer">
|
||||
<div class="content has-text-centered">
|
||||
<p>
|
||||
Footer content {{ base['creation-date'] }}
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
1
code/html/bulma.min.css
vendored
Normal file
1
code/html/bulma.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
29
code/html/categorical_index.jinja
Normal file
29
code/html/categorical_index.jinja
Normal file
@ -0,0 +1,29 @@
|
||||
{% extends "base.jinja" %}
|
||||
|
||||
{% block content %}
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<h1>{{ index['title'] }}</h1>
|
||||
<p>
|
||||
{% set comma = joiner(",") %}
|
||||
{% for category in index['categories'] %}
|
||||
{{ comma() }} <a href="#{{ category }}">{{ category.capitalize() }}</a> ({{ index['number_entries'][category] }})
|
||||
{% endfor %}
|
||||
</p>
|
||||
{% for category in index['categories'] %}
|
||||
<h2 id="{{ category }}">{{ category.capitalize() }}</h2>
|
||||
<div class="columns">
|
||||
{% for entries_column in index['entries'][category] %}
|
||||
<div class="column">
|
||||
<ul>
|
||||
{% for entry in entries_column %}
|
||||
<li>{{ entry }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
4
code/html/contribute.jinja
Normal file
4
code/html/contribute.jinja
Normal file
@ -0,0 +1,4 @@
|
||||
{% extends "base.jinja" %}
|
||||
|
||||
{% block content %}
|
||||
{% endblock %}
|
15
code/html/developers_for_letter.jinja
Normal file
15
code/html/developers_for_letter.jinja
Normal file
@ -0,0 +1,15 @@
|
||||
{% extends "base.jinja" %}
|
||||
|
||||
{% block content %}
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<h1>Inspirations ({{ letter.capitalize() }})</h1>
|
||||
{% for developer in developers %}
|
||||
<p>
|
||||
{{ developer['Name'] }}<br>
|
||||
Games: {{ developer['Games']|join(', ') }}
|
||||
</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
24
code/html/games_for_letter.jinja
Normal file
24
code/html/games_for_letter.jinja
Normal file
@ -0,0 +1,24 @@
|
||||
{% extends "base.jinja" %}
|
||||
|
||||
{% block content %}
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<h1>Games ({{ letter.capitalize() }})</h1>
|
||||
{% for g in games %}
|
||||
<p>
|
||||
<a id="#{{ g['title-anchor'] }}">{{ g['Title'] }}</a><br>
|
||||
Home: {{ g['Home'] }}<br>
|
||||
{% if 'Inspirations' in g %}{% endif%}
|
||||
{% if 'Media' in g %}{% endif%}
|
||||
{% if 'Download' in g %}{% endif%}
|
||||
{% if 'Play' in g %}{% endif%}
|
||||
{% if 'Developer' in g %}{% endif%}
|
||||
{% if 'Note' in g %}{% endif%}
|
||||
Technical info:<br>
|
||||
Language: {{ g['Code language'] }}<br>
|
||||
License: {{ g['Code license'] }}
|
||||
</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
14
code/html/index.jinja
Normal file
14
code/html/index.jinja
Normal file
@ -0,0 +1,14 @@
|
||||
{% extends "base.jinja" %}
|
||||
|
||||
{% block content %}
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<h1 class="title">
|
||||
Open source games list (OSGL)
|
||||
</h1>
|
||||
<p class="subtitle">
|
||||
Contains information about {{ index['number_games'] }} open source games.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
16
code/html/inspirations_for_letter.jinja
Normal file
16
code/html/inspirations_for_letter.jinja
Normal file
@ -0,0 +1,16 @@
|
||||
{% extends "base.jinja" %}
|
||||
|
||||
{% block content %}
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<h1>Inspirations ({{ letter.capitalize() }})</h1>
|
||||
{% for inspiration in inspirations %}
|
||||
<p>
|
||||
{{ inspiration['Name'] }}<br>
|
||||
{% if 'Media' in inspiration %}Media: {{ inspiration['Media'] }}<br>{% endif %}
|
||||
Inspired entries: {% for game in inspiration['Inspired entries'] %}{{ game }}{% endfor %}
|
||||
</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
14
code/html/list.jinja
Normal file
14
code/html/list.jinja
Normal file
@ -0,0 +1,14 @@
|
||||
{% extends "base.jinja" %}
|
||||
|
||||
{% block content %}
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<h1>{{ data['title'] }}</h1>
|
||||
<ul>
|
||||
{% for item in data['items'] %}
|
||||
<li>{{ item }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
4
code/html/statistics_index.jinja
Normal file
4
code/html/statistics_index.jinja
Normal file
@ -0,0 +1,4 @@
|
||||
{% extends "base.jinja" %}
|
||||
|
||||
{% block content %}
|
||||
{% endblock %}
|
4
code/html/table.jinja
Normal file
4
code/html/table.jinja
Normal file
@ -0,0 +1,4 @@
|
||||
{% extends "base.jinja" %}
|
||||
|
||||
{% block content %}
|
||||
{% endblock %}
|
@ -14,6 +14,7 @@ import textwrap
|
||||
from utils import osg, osg_ui, utils, constants as c
|
||||
import requests
|
||||
|
||||
|
||||
def check_validity_backlog():
|
||||
import requests
|
||||
|
||||
@ -62,8 +63,6 @@ def create_toc(title, file, entries):
|
||||
# write to toc file
|
||||
utils.write_text(toc_file, text)
|
||||
|
||||
print('Readme and TOCs updated')
|
||||
|
||||
|
||||
def sort_text_file(file, name):
|
||||
"""
|
||||
@ -432,6 +431,8 @@ class EntriesMaintainer:
|
||||
# write to readme
|
||||
utils.write_text(readme_file, text)
|
||||
|
||||
print('Readme and TOCs updated')
|
||||
|
||||
def update_statistics(self):
|
||||
"""
|
||||
Generates the statistics page.
|
||||
@ -821,7 +822,6 @@ if __name__ == "__main__":
|
||||
'Read entries': m.read_entries,
|
||||
'Write entries': m.write_entries,
|
||||
'Check template leftovers': m.check_template_leftovers,
|
||||
'Check external links': m.check_external_links,
|
||||
'Check inconsistencies': m.check_inconsistencies,
|
||||
'Check rejected entries': m.clean_rejected,
|
||||
'Check external links (takes quite long)': m.check_external_links,
|
||||
|
@ -8,6 +8,7 @@ valid_duplicates = ('Age of Empires', 'ARMA', 'Catacomb', 'Civilization', 'Compa
|
||||
'Final Fantasy', 'Heroes of Might and Magic', 'Jazz Jackrabbit', 'Marathon', 'Master of Orion', 'Quake',
|
||||
'RollerCoaster Tycoon', 'Star Wars Jedi Knight', 'The Settlers', 'Ultima', 'Ship Simulator')
|
||||
|
||||
|
||||
class InspirationMaintainer:
|
||||
|
||||
def __init__(self):
|
||||
@ -90,6 +91,7 @@ class InspirationMaintainer:
|
||||
for entry in self.entries:
|
||||
entry_name = entry['Title']
|
||||
for inspiration in entry.get('Inspirations', []):
|
||||
inspiration = inspiration.value
|
||||
if inspiration in self.inspirations:
|
||||
self.inspirations[inspiration]['Inspired entries'].append(entry_name)
|
||||
else:
|
||||
|
@ -2,4 +2,5 @@ pygithub
|
||||
lark-parser
|
||||
BeautifulSoup
|
||||
PyQt5
|
||||
wikipedia
|
||||
wikipedia
|
||||
Jinja2
|
@ -10,6 +10,10 @@ root_path = os.path.realpath(os.path.join(os.path.dirname(__file__), os.path.par
|
||||
entries_path = os.path.join(root_path, 'entries')
|
||||
tocs_path = os.path.join(entries_path, 'tocs')
|
||||
code_path = os.path.join(root_path, 'code')
|
||||
web_path = os.path.join(root_path, 'docs')
|
||||
web_template_path = os.path.join(code_path, 'html')
|
||||
web_css_path = os.path.join(web_path, 'css')
|
||||
|
||||
|
||||
inspirations_file = os.path.join(root_path, 'inspirations.md')
|
||||
developer_file = os.path.join(root_path, 'developers.md')
|
||||
|
Reference in New Issue
Block a user