[-] Remove markdown dependency, use browser marked instead
This commit is contained in:
@@ -8,5 +8,6 @@
|
|||||||
</content>
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="library" name="marked" level="application" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
+1
-2
@@ -18,8 +18,7 @@ tabulate==0.8.9
|
|||||||
matplotlib==3.5.0
|
matplotlib==3.5.0
|
||||||
# Calculate data statistics
|
# Calculate data statistics
|
||||||
numpy==1.21.4
|
numpy==1.21.4
|
||||||
# Generate report
|
#
|
||||||
markdown==3.3.6
|
|
||||||
|
|
||||||
####################
|
####################
|
||||||
# Data Packing
|
# Data Packing
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ def generate_report() -> str:
|
|||||||
if line.startswith('@include'):
|
if line.startswith('@include'):
|
||||||
line = line[line.index('`') + 1:]
|
line = line[line.index('`') + 1:]
|
||||||
line = line[:line.index('`')]
|
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__':
|
if __name__ == '__main__':
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
# H1
|
||||||
|
|
||||||
|
Test Image:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Test Include:
|
||||||
|
|
||||||
|
@include `{REPORT_DIR}/1-covid-tweet-frequency/500-pop.md`
|
||||||
@@ -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>
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
|
|
||||||
# H1
|
|
||||||
|
|
||||||
Test Image:
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
Test Include:
|
|
||||||
|
|
||||||
@include `../report/1-covid-tweet-frequency/500-pop.md`
|
|
||||||
Reference in New Issue
Block a user