[-] Remove markdown dependency, use browser marked instead

This commit is contained in:
Hykilpikonna
2021-11-24 19:53:32 -05:00
parent 411b50e793
commit 7857f50eb7
6 changed files with 31 additions and 14 deletions
+1
View File
@@ -8,5 +8,6 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="marked" level="application" />
</component>
</module>
+1 -2
View File
@@ -18,8 +18,7 @@ tabulate==0.8.9
matplotlib==3.5.0
# Calculate data statistics
numpy==1.21.4
# Generate report
markdown==3.3.6
#
####################
# Data Packing
+2 -2
View File
@@ -21,9 +21,9 @@ def generate_report() -> str:
if line.startswith('@include'):
line = line[line.index('`') + 1:]
line = line[:line.index('`')]
md[i] = read(os.path.join(REPORT_DIR, line))
md[i] = read(line)
return markdown.markdown('\n'.join(md))
return markdown.markdown('\n'.join(md), extensions=['tables'])
if __name__ == '__main__':
+10
View File
@@ -0,0 +1,10 @@
# H1
Test Image:
![]({REPORT_DIR}/1-covid-tweet-frequency/500-pop.png)
Test Include:
@include `{REPORT_DIR}/1-covid-tweet-frequency/500-pop.md`
+17
View File
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CSC110 Report</title>
</head>
<body>
<div id="content">
</div>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script>
document.getElementById('content').innerHTML =
marked.parse('# Marked in the browser\n\nRendered by **marked**.');
</script>
</body>
</html>
-10
View File
@@ -1,10 +0,0 @@
# H1
Test Image:
![](../report/1-covid-tweet-frequency/500-pop.png)
Test Include:
@include `../report/1-covid-tweet-frequency/500-pop.md`