Skip to content

Commit

Permalink
fixed version sorting, removed hard-coded web address
Browse files Browse the repository at this point in the history
  • Loading branch information
kla7 committed Jun 27, 2024
1 parent 7eaa366 commit bc443ca
Show file tree
Hide file tree
Showing 22 changed files with 114 additions and 107 deletions.
4 changes: 2 additions & 2 deletions docs/_apps/aapb-pua-kaldi-wrapper/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ classes: wide
title: AAPB-PUA Kaldi Wrapper
---
A CLAMS wrapper for Kaldi-based ASR software originally developed by PopUpArchive and hipstas, and later updated by Kyeongmin Rim at Brandeis University. Wrapped software can be found at https://github.com/brandeis-llc/aapb-pua-kaldi-docker .
- [v2](http://apps.clams.ai/aapb-pua-kaldi-wrapper/v2) ([`keighrim`](https://github.com/keighrim))
- [v1](http://apps.clams.ai/aapb-pua-kaldi-wrapper/v1) ([`keighrim`](https://github.com/keighrim))
- [v2]({{ url }}/aapb-pua-kaldi-wrapper/v2) ([`keighrim`](https://github.com/keighrim))
- [v1]({{ url }}/aapb-pua-kaldi-wrapper/v1) ([`keighrim`](https://github.com/keighrim))
4 changes: 2 additions & 2 deletions docs/_apps/barsdetection/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ classes: wide
title: Bars Detection
---
This tool detects SMPTE color bars.
- [v1.1](http://apps.clams.ai/barsdetection/v1.1) ([`keighrim`](https://github.com/keighrim))
- [v1.0](http://apps.clams.ai/barsdetection/v1.0) ([`keighrim`](https://github.com/keighrim))
- [v1.1]({{ url }}/barsdetection/v1.1) ([`keighrim`](https://github.com/keighrim))
- [v1.0]({{ url }}/barsdetection/v1.0) ([`keighrim`](https://github.com/keighrim))
4 changes: 2 additions & 2 deletions docs/_apps/brandeis-acs-wrapper/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ classes: wide
title: Brandeis ACS Wrapper
---
Brandeis Acoustic Classification & Segmentation (ACS) is a audio segmentation tool developed at Brandeis Lab for Linguistics and Computation. The original software can be found at https://github.com/brandeis-llc/acoustic-classification-segmentation .
- [v2](http://apps.clams.ai/brandeis-acs-wrapper/v2) ([`keighrim`](https://github.com/keighrim))
- [v1](http://apps.clams.ai/brandeis-acs-wrapper/v1) ([`keighrim`](https://github.com/keighrim))
- [v2]({{ url }}/brandeis-acs-wrapper/v2) ([`keighrim`](https://github.com/keighrim))
- [v1]({{ url }}/brandeis-acs-wrapper/v1) ([`keighrim`](https://github.com/keighrim))
2 changes: 1 addition & 1 deletion docs/_apps/chyron-detection/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ classes: wide
title: Chyron Detection
---
This tool detects chyrons, generates time segments.
- [v1.0](http://apps.clams.ai/chyron-detection/v1.0) ([`keighrim`](https://github.com/keighrim))
- [v1.0]({{ url }}/chyron-detection/v1.0) ([`keighrim`](https://github.com/keighrim))
6 changes: 3 additions & 3 deletions docs/_apps/dbpedia-spotlight-wrapper/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ classes: wide
title: Dbpedia Spotlight Wrapper
---
Apply named entity linking to all text documents in a MMIF file.
- [v1.2](http://apps.clams.ai/dbpedia-spotlight-wrapper/v1.2) ([`wricketts`](https://github.com/wricketts))
- [v1.1](http://apps.clams.ai/dbpedia-spotlight-wrapper/v1.1) ([`keighrim`](https://github.com/keighrim))
- [v1.0](http://apps.clams.ai/dbpedia-spotlight-wrapper/v1.0) ([`wricketts`](https://github.com/wricketts))
- [v1.2]({{ url }}/dbpedia-spotlight-wrapper/v1.2) ([`wricketts`](https://github.com/wricketts))
- [v1.1]({{ url }}/dbpedia-spotlight-wrapper/v1.1) ([`keighrim`](https://github.com/keighrim))
- [v1.0]({{ url }}/dbpedia-spotlight-wrapper/v1.0) ([`wricketts`](https://github.com/wricketts))
4 changes: 2 additions & 2 deletions docs/_apps/doctr-wrapper/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ classes: wide
title: CLAMS docTR Wrapper
---
CLAMS app wraps the [docTR, End-to-End OCR model](https://pypi.org/project/python-doctr). The model can detect text regions in the input image and recognize text in the regions (via parseq OCR model, only English is support at the moment). The text-localized regions are organized hierarchically by the model into "pages" > "blocks" > "lines" > "words", and this CLAMS app translates them into `TextDocument`, `Paragraphs`, `Sentence`, and `Token` annotations to represent recognized text contents. See descriptions for I/O types below for details on how annotations are aligned to each other.
- [v1.1](http://apps.clams.ai/doctr-wrapper/v1.1) ([`keighrim`](https://github.com/keighrim))
- [v1.0](http://apps.clams.ai/doctr-wrapper/v1.0) ([`keighrim`](https://github.com/keighrim))
- [v1.1]({{ url }}/doctr-wrapper/v1.1) ([`keighrim`](https://github.com/keighrim))
- [v1.0]({{ url }}/doctr-wrapper/v1.0) ([`keighrim`](https://github.com/keighrim))
4 changes: 2 additions & 2 deletions docs/_apps/east-textdetection/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ classes: wide
title: EAST Text Detection
---
OpenCV-based text localization app that used EAST text detection model. Please visit the source code repository for full documentation.
- [v1.1](http://apps.clams.ai/east-textdetection/v1.1) ([`keighrim`](https://github.com/keighrim))
- [v1.0](http://apps.clams.ai/east-textdetection/v1.0) ([`keighrim`](https://github.com/keighrim))
- [v1.1]({{ url }}/east-textdetection/v1.1) ([`keighrim`](https://github.com/keighrim))
- [v1.0]({{ url }}/east-textdetection/v1.0) ([`keighrim`](https://github.com/keighrim))
4 changes: 2 additions & 2 deletions docs/_apps/easyocr-wrapper/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ classes: wide
title: Easyocr Wrapper
---
Using EasyOCR to extract text from timeframes
- [v1.1](http://apps.clams.ai/easyocr-wrapper/v1.1) ([`snewman-aa`](https://github.com/snewman-aa))
- [v1.0](http://apps.clams.ai/easyocr-wrapper/v1.0) ([`snewman-aa`](https://github.com/snewman-aa))
- [v1.1]({{ url }}/easyocr-wrapper/v1.1) ([`snewman-aa`](https://github.com/snewman-aa))
- [v1.0]({{ url }}/easyocr-wrapper/v1.0) ([`snewman-aa`](https://github.com/snewman-aa))
2 changes: 1 addition & 1 deletion docs/_apps/fewshotclassifier/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ classes: wide
title: Few Shot Classifier
---
This tool uses a vision model to classify video segments. Currenly supports "chyron" frame type.
- [v1.0](http://apps.clams.ai/fewshotclassifier/v1.0) ([`keighrim`](https://github.com/keighrim))
- [v1.0]({{ url }}/fewshotclassifier/v1.0) ([`keighrim`](https://github.com/keighrim))
2 changes: 1 addition & 1 deletion docs/_apps/gentle-forced-aligner-wrapper/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ classes: wide
title: Gentle Forced Aligner Wrapper
---
This CLAMS app aligns transcript and audio track using Gentle. Gentle is a robust yet lenient forced aligner built on Kaldi.This app only works when Gentle is already installed locally.Unfortunately, Gentle is not distributed as a Python package distribution.To get Gentle installation instruction, see https://lowerquality.com/gentle/ Make sure install Gentle from the git commit specified in ``analyzer_version`` in this metadata.
- [v1.0](http://apps.clams.ai/gentle-forced-aligner-wrapper/v1.0) ([`keighrim`](https://github.com/keighrim))
- [v1.0]({{ url }}/gentle-forced-aligner-wrapper/v1.0) ([`keighrim`](https://github.com/keighrim))
8 changes: 4 additions & 4 deletions docs/_apps/inaspeechsegmenter-wrapper/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ classes: wide
title: inaSpeechSegmenter Wrapper
---
inaSpeechSegmenter is a CNN-based audio segmentation toolkit. The original software can be found at https://github.com/ina-foss/inaSpeechSegmenter .
- [v2.0](http://apps.clams.ai/inaspeechsegmenter-wrapper/v2.0) ([`keighrim`](https://github.com/keighrim))
- [v1.2](http://apps.clams.ai/inaspeechsegmenter-wrapper/v1.2) ([`keighrim`](https://github.com/keighrim))
- [v1.1](http://apps.clams.ai/inaspeechsegmenter-wrapper/v1.1) ([`keighrim`](https://github.com/keighrim))
- [v1.0](http://apps.clams.ai/inaspeechsegmenter-wrapper/v1.0) ([`keighrim`](https://github.com/keighrim))
- [v2.0]({{ url }}/inaspeechsegmenter-wrapper/v2.0) ([`keighrim`](https://github.com/keighrim))
- [v1.2]({{ url }}/inaspeechsegmenter-wrapper/v1.2) ([`keighrim`](https://github.com/keighrim))
- [v1.1]({{ url }}/inaspeechsegmenter-wrapper/v1.1) ([`keighrim`](https://github.com/keighrim))
- [v1.0]({{ url }}/inaspeechsegmenter-wrapper/v1.0) ([`keighrim`](https://github.com/keighrim))
4 changes: 2 additions & 2 deletions docs/_apps/llava-captioner/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ classes: wide
title: Llava Captioner
---
Applies llava to video frames.
- [v1.1](http://apps.clams.ai/llava-captioner/v1.1) ([`kelleyl`](https://github.com/kelleyl))
- [v1.0](http://apps.clams.ai/llava-captioner/v1.0) ([`kelleyl`](https://github.com/kelleyl))
- [v1.1]({{ url }}/llava-captioner/v1.1) ([`kelleyl`](https://github.com/kelleyl))
- [v1.0]({{ url }}/llava-captioner/v1.0) ([`kelleyl`](https://github.com/kelleyl))
2 changes: 1 addition & 1 deletion docs/_apps/parseqocr-wrapper/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ classes: wide
title: Parseq OCR Wrapper
---
This tool applies Parseq OCR to a video or image and generates text boxes and OCR results.
- [v1.0](http://apps.clams.ai/parseqocr-wrapper/v1.0) ([`keighrim`](https://github.com/keighrim))
- [v1.0]({{ url }}/parseqocr-wrapper/v1.0) ([`keighrim`](https://github.com/keighrim))
6 changes: 3 additions & 3 deletions docs/_apps/pyscenedetect-wrapper/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ classes: wide
title: Pyscenedetect Wrapper
---
CLAMS app wraps PySceneDetect and performs shot boundary detection on input videos
- [v3](http://apps.clams.ai/pyscenedetect-wrapper/v3) ([`kelleyl`](https://github.com/kelleyl))
- [v2](http://apps.clams.ai/pyscenedetect-wrapper/v2) ([`keighrim`](https://github.com/keighrim))
- [v1](http://apps.clams.ai/pyscenedetect-wrapper/v1) ([`keighrim`](https://github.com/keighrim))
- [v3]({{ url }}/pyscenedetect-wrapper/v3) ([`kelleyl`](https://github.com/kelleyl))
- [v2]({{ url }}/pyscenedetect-wrapper/v2) ([`keighrim`](https://github.com/keighrim))
- [v1]({{ url }}/pyscenedetect-wrapper/v1) ([`keighrim`](https://github.com/keighrim))
10 changes: 5 additions & 5 deletions docs/_apps/simple-timepoints-stitcher/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ classes: wide
title: Simple Timepoints Stitcher
---
Stitches a sequence of `TimePoint` annotations into a sequence of `TimeFrame` annotations, performing simple smoothing of short peaks of positive labels.
- [v2.0](http://apps.clams.ai/simple-timepoints-stitcher/v2.0) ([`keighrim`](https://github.com/keighrim))
- [v1.3](http://apps.clams.ai/simple-timepoints-stitcher/v1.3) ([`keighrim`](https://github.com/keighrim))
- [v1.2](http://apps.clams.ai/simple-timepoints-stitcher/v1.2) ([`keighrim`](https://github.com/keighrim))
- [v1.1](http://apps.clams.ai/simple-timepoints-stitcher/v1.1) ([`keighrim`](https://github.com/keighrim))
- [v1.0](http://apps.clams.ai/simple-timepoints-stitcher/v1.0) ([`keighrim`](https://github.com/keighrim))
- [v2.0]({{ url }}/simple-timepoints-stitcher/v2.0) ([`keighrim`](https://github.com/keighrim))
- [v1.3]({{ url }}/simple-timepoints-stitcher/v1.3) ([`keighrim`](https://github.com/keighrim))
- [v1.2]({{ url }}/simple-timepoints-stitcher/v1.2) ([`keighrim`](https://github.com/keighrim))
- [v1.1]({{ url }}/simple-timepoints-stitcher/v1.1) ([`keighrim`](https://github.com/keighrim))
- [v1.0]({{ url }}/simple-timepoints-stitcher/v1.0) ([`keighrim`](https://github.com/keighrim))
10 changes: 5 additions & 5 deletions docs/_apps/slatedetection/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ classes: wide
title: Slate Detection
---
This tool detects slates.
- [v2.1](http://apps.clams.ai/slatedetection/v2.1) ([`keighrim`](https://github.com/keighrim))
- [v2.0](http://apps.clams.ai/slatedetection/v2.0) ([`keighrim`](https://github.com/keighrim))
- [v1.2](http://apps.clams.ai/slatedetection/v1.2) ([`keighrim`](https://github.com/keighrim))
- [v1.1](http://apps.clams.ai/slatedetection/v1.1) ([`keighrim`](https://github.com/keighrim))
- [v1.0](http://apps.clams.ai/slatedetection/v1.0) ([`kelleyl`](https://github.com/kelleyl))
- [v2.1]({{ url }}/slatedetection/v2.1) ([`keighrim`](https://github.com/keighrim))
- [v2.0]({{ url }}/slatedetection/v2.0) ([`keighrim`](https://github.com/keighrim))
- [v1.2]({{ url }}/slatedetection/v1.2) ([`keighrim`](https://github.com/keighrim))
- [v1.1]({{ url }}/slatedetection/v1.1) ([`keighrim`](https://github.com/keighrim))
- [v1.0]({{ url }}/slatedetection/v1.0) ([`kelleyl`](https://github.com/kelleyl))
6 changes: 3 additions & 3 deletions docs/_apps/spacy-wrapper/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ classes: wide
title: CLAMS wrapper for spaCy NLP
---
Apply spaCy NLP to all text documents in a MMIF file.
- [v1.2](http://apps.clams.ai/spacy-wrapper/v1.2) ([`marcverhagen`](https://github.com/marcverhagen))
- [v1.1](http://apps.clams.ai/spacy-wrapper/v1.1) ([`keighrim`](https://github.com/keighrim))
- [v1](http://apps.clams.ai/spacy-wrapper/v1) ([`keighrim`](https://github.com/keighrim))
- [v1.2]({{ url }}/spacy-wrapper/v1.2) ([`marcverhagen`](https://github.com/marcverhagen))
- [v1.1]({{ url }}/spacy-wrapper/v1.1) ([`keighrim`](https://github.com/keighrim))
- [v1]({{ url }}/spacy-wrapper/v1) ([`keighrim`](https://github.com/keighrim))
20 changes: 10 additions & 10 deletions docs/_apps/swt-detection/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ classes: wide
title: Scenes-with-text Detection
---
Detects scenes with text, like slates, chyrons and credits.
- [v5.0](http://apps.clams.ai/swt-detection/v5.0) ([`marcverhagen`](https://github.com/marcverhagen))
- [v4.4](http://apps.clams.ai/swt-detection/v4.4) ([`keighrim`](https://github.com/keighrim))
- [v4.3](http://apps.clams.ai/swt-detection/v4.3) ([`keighrim`](https://github.com/keighrim))
- [v4.2](http://apps.clams.ai/swt-detection/v4.2) ([`keighrim`](https://github.com/keighrim))
- [v4.1](http://apps.clams.ai/swt-detection/v4.1) ([`keighrim`](https://github.com/keighrim))
- [v4.0](http://apps.clams.ai/swt-detection/v4.0) ([`marcverhagen`](https://github.com/marcverhagen))
- [v3.0](http://apps.clams.ai/swt-detection/v3.0) ([`marcverhagen`](https://github.com/marcverhagen))
- [v2.1](http://apps.clams.ai/swt-detection/v2.1) ([`marcverhagen`](https://github.com/marcverhagen))
- [v2.0](http://apps.clams.ai/swt-detection/v2.0) ([`marcverhagen`](https://github.com/marcverhagen))
- [v1.0](http://apps.clams.ai/swt-detection/v1.0) ([`marcverhagen`](https://github.com/marcverhagen))
- [v5.0]({{ url }}/swt-detection/v5.0) ([`marcverhagen`](https://github.com/marcverhagen))
- [v4.4]({{ url }}/swt-detection/v4.4) ([`keighrim`](https://github.com/keighrim))
- [v4.3]({{ url }}/swt-detection/v4.3) ([`keighrim`](https://github.com/keighrim))
- [v4.2]({{ url }}/swt-detection/v4.2) ([`keighrim`](https://github.com/keighrim))
- [v4.1]({{ url }}/swt-detection/v4.1) ([`keighrim`](https://github.com/keighrim))
- [v4.0]({{ url }}/swt-detection/v4.0) ([`marcverhagen`](https://github.com/marcverhagen))
- [v3.0]({{ url }}/swt-detection/v3.0) ([`marcverhagen`](https://github.com/marcverhagen))
- [v2.1]({{ url }}/swt-detection/v2.1) ([`marcverhagen`](https://github.com/marcverhagen))
- [v2.0]({{ url }}/swt-detection/v2.0) ([`marcverhagen`](https://github.com/marcverhagen))
- [v1.0]({{ url }}/swt-detection/v1.0) ([`marcverhagen`](https://github.com/marcverhagen))
2 changes: 1 addition & 1 deletion docs/_apps/tesseractocr-wrapper/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ classes: wide
title: Tesseract OCR Wrapper
---
This tool applies Tesseract OCR to a video or image and generates text boxes and OCR results.
- [v1.0](http://apps.clams.ai/tesseractocr-wrapper/v1.0) ([`keighrim`](https://github.com/keighrim))
- [v1.0]({{ url }}/tesseractocr-wrapper/v1.0) ([`keighrim`](https://github.com/keighrim))
2 changes: 1 addition & 1 deletion docs/_apps/tonedetection/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ classes: wide
title: Tone_Detector
---
Detects spans of monotonic audio within an audio file
- [v1.0](http://apps.clams.ai/tonedetection/v1.0) ([`MrSqually`](https://github.com/MrSqually))
- [v1.0]({{ url }}/tonedetection/v1.0) ([`MrSqually`](https://github.com/MrSqually))
12 changes: 6 additions & 6 deletions docs/_apps/whisper-wrapper/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ classes: wide
title: Whisper Wrapper
---
A CLAMS wrapper for Whisper-based ASR software originally developed by OpenAI.
- [v6](http://apps.clams.ai/whisper-wrapper/v6) ([`keighrim`](https://github.com/keighrim))
- [v5](http://apps.clams.ai/whisper-wrapper/v5) ([`keighrim`](https://github.com/keighrim))
- [v4](http://apps.clams.ai/whisper-wrapper/v4) ([`keighrim`](https://github.com/keighrim))
- [v3](http://apps.clams.ai/whisper-wrapper/v3) ([`keighrim`](https://github.com/keighrim))
- [v2](http://apps.clams.ai/whisper-wrapper/v2) ([`keighrim`](https://github.com/keighrim))
- [v1](http://apps.clams.ai/whisper-wrapper/v1) ([`keighrim`](https://github.com/keighrim))
- [v6]({{ url }}/whisper-wrapper/v6) ([`keighrim`](https://github.com/keighrim))
- [v5]({{ url }}/whisper-wrapper/v5) ([`keighrim`](https://github.com/keighrim))
- [v4]({{ url }}/whisper-wrapper/v4) ([`keighrim`](https://github.com/keighrim))
- [v3]({{ url }}/whisper-wrapper/v3) ([`keighrim`](https://github.com/keighrim))
- [v2]({{ url }}/whisper-wrapper/v2) ([`keighrim`](https://github.com/keighrim))
- [v1]({{ url }}/whisper-wrapper/v1) ([`keighrim`](https://github.com/keighrim))
103 changes: 55 additions & 48 deletions scripts/app_page_data.py
Original file line number Diff line number Diff line change
@@ -1,48 +1,55 @@
import os
import json

directory = '../docs/_apps'

apps = [app for app in os.listdir(directory) if os.path.isdir(os.path.join(directory, app)) and not app.startswith('_')]

for app in apps:
app_dir = os.path.join(directory, app)
app_vers = [app_ver for app_ver in os.listdir(app_dir) if os.path.isdir(os.path.join(app_dir, app_ver))]
sorted_app_info = sorted([app_ver.lstrip('v') for app_ver in app_vers], reverse=True) # sort versions from latest to earliest
app_info_dict = {'v' + app_ver: tuple() for app_ver in sorted_app_info}
for app_ver in app_vers:
app_ver_dir = os.path.join(app_dir, app_ver)
json_files = [json_file for json_file in os.listdir(app_ver_dir) if json_file[-5:] == '.json']
for json_file in json_files:
json_file_path = os.path.join(app_ver_dir, json_file)
if json_file == 'metadata.json':
with open(json_file_path) as metadata_file:
metadata = json.load(metadata_file)
title = metadata['name']
ver_num = metadata['app_version']
if ver_num.lstrip('v') == sorted_app_info[0]:
description = metadata['description'] # get description for the latest app version
elif json_file == 'submission.json':
with open(json_file_path) as submission_file:
submission = json.load(submission_file)
submitter = submission['submitter']

app_info_dict[app_ver] = (ver_num, submitter)

file_name = os.path.join(directory, app, 'index.md')

f = open(file_name, "w")

f.write('---\n')
f.write("layout: posts\n")
f.write("classes: wide\n")
f.write(f"title: {title}\n")
f.write("---\n")
f.write(f"{description}\n")

for app_info in app_info_dict:
ver_num = app_info_dict[app_info][0]
submitter = app_info_dict[app_info][1]
f.write(f"- [{ver_num}](http://apps.clams.ai/{app}/{ver_num}) ([`{submitter}`](https://github.com/{submitter}))\n")

f.close()
import os
import json
import datetime

app_par_dir = os.path.join(os.path.dirname(__file__), '..', 'docs', '_apps')

apps = [app for app in os.listdir(app_par_dir) if os.path.isdir(os.path.join(app_par_dir, app)) and not app.startswith('_')]

for app in apps:
app_dir = os.path.join(app_par_dir, app)
app_vers = [app_ver for app_ver in os.listdir(app_dir) if os.path.isdir(os.path.join(app_dir, app_ver))]
app_submitters = dict()
app_descriptions = {app_ver: tuple() for app_ver in app_vers}
app_vers_sorted = list()
for app_ver in app_vers:
app_ver_dir = os.path.join(app_dir, app_ver)
json_files = [json_file for json_file in os.listdir(app_ver_dir) if json_file[-5:] == '.json']
for json_file in json_files:
json_file_path = os.path.join(app_ver_dir, json_file)
if json_file == 'metadata.json':
with open(json_file_path) as metadata_file:
metadata = json.load(metadata_file)
app_title = metadata['name']
ver_num = metadata['app_version']
app_descriptions[app_ver] = metadata['description']
elif json_file == 'submission.json':
with open(json_file_path) as submission_file:
app_submission = json.load(submission_file)
app_submitter = app_submission['submitter']
submission_time = app_submission['time']
app_submitters[app_ver] = app_submitter
app_vers_sorted.append({'app_ver': app_ver, 'submission_time': submission_time})

app_vers_sorted.sort(key=lambda x: x['submission_time'], reverse=True)
app_description = app_descriptions[app_vers_sorted[0]['app_ver']]

file_name = os.path.join(app_par_dir, app, 'index.md')

f = open(file_name, "w")

f.write('---\n')
f.write("layout: posts\n")
f.write("classes: wide\n")
f.write(f"title: {app_title}\n")
f.write("---\n")
f.write(f"{app_description}\n")

clams_url = "{{ url }}"

for app_ver in app_vers_sorted:
ver_num = app_ver['app_ver']
app_submitter = app_submitters[ver_num]
f.write(f"- [{ver_num}]({clams_url}/{app}/{ver_num}) ([`{app_submitter}`](https://github.com/{app_submitter}))\n")

f.close()

0 comments on commit bc443ca

Please sign in to comment.