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

library for markdown changed #50

Merged
merged 7 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def get_issues_by_owner_id(owner, issue):
if val['body_text']:
if "Weekly Goals" in val['body_text'] and not w_goal_url:
w_goal_url = val['body_text']
plain_text_body = markdown2.markdown(val['body_text'])
plain_text_body = markdown.markdown(val['body_text'])

tasks = re.findall(r'\[(x| )\]', plain_text_body)
total_tasks = len(tasks)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ python-dotenv==1.0.1
supabase==2.4.5
gunicorn==22.0.0
flasgger==0.9.7.1
markdown2==2.4.13
markdown==3.4.1
requests==2.32.2
flask-cors==4.0.1
6 changes: 3 additions & 3 deletions utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import requests,re,markdown2,os
import requests,re,markdown,os
from collections import defaultdict
from datetime import datetime, timedelta
from dateutil import parser
Expand Down Expand Up @@ -115,7 +115,7 @@ def find_week_data(issue_details):

for week in weekly_updates:

plain_text_body = markdown2.markdown(week['val']['body'])
plain_text_body = markdown.markdown(week['val']['body'])

tasks = re.findall(r'\[(x| )\]', plain_text_body)
total_tasks = len(tasks)
Expand Down Expand Up @@ -154,7 +154,7 @@ def find_week_avg(url):

if "Weekly Goals" in item['body']:
w_goal_url = item['body']
plain_text_body = markdown2.markdown(issue_details[0]['body'])
plain_text_body = markdown.markdown(issue_details[0]['body'])

tasks = re.findall(r'\[(x| )\]', plain_text_body)
total_tasks = len(tasks)
Expand Down
6 changes: 3 additions & 3 deletions v2_app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import traceback,re
from flask import Blueprint, jsonify, request
import markdown2
import markdown
from utils import require_secret_key
from db import SupabaseInterface
from utils import determine_week
Expand Down Expand Up @@ -51,15 +51,15 @@ def get_issues_by_owner_id_v2(owner, issue):
if val['body_text']:
if ("Weekly Goals" in val['body_text'] and not w_goal_url):
w_goal_url = val['body_text']
plain_text_body = markdown2.markdown(val['body_text'])
plain_text_body = markdown.markdown(val['body_text'])
tasks = re.findall(r'\[(x| )\]', plain_text_body)
total_tasks = len(tasks)
completed_tasks = tasks.count('x')
avg = round((completed_tasks/total_tasks)*100) if total_tasks!=0 else 0

if ("Weekly Learnings" in val['body_text'] and not w_learn_url):
w_learn_url = val['body_text']
plain_text_wurl = markdown2.markdown(val['body_text'])
plain_text_wurl = markdown.markdown(val['body_text'])


# mentors = mentors_data['mentors']
Expand Down
2 changes: 1 addition & 1 deletion v2_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import logging,re,markdown2
import logging,re,markdown

# Func to create name and link for all mentors and contributors
def define_link_data(usernames):
Expand Down
Loading