Skip to content

Commit 42204a5

Browse files
committed
WIP: Add markdown to html converter
1 parent 5b8e8b0 commit 42204a5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

_search/server/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
pyyaml
22
typesense==0.10.0
33
beautifulsoup4
4+
markdown2

_search/server/tutorials.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55

66
import logging, traceback, re, sys
77
import json
8+
import markdown2
89
from parseutil import first_sentence
910
from pathlib import Path
1011
from pprint import pprint
1112

13+
1214
logger = logging.getLogger(__name__)
1315

1416

@@ -51,8 +53,9 @@ def process_cell(cell):
5153

5254
if 'source' in cell:
5355
s = "".join(cell['source'])
56+
# markdown to html converter
5457
if 'cell_type' in cell and cell['cell_type'] == 'markdown':
55-
s = markdown_to_html(s)
58+
s = markdown2.markdown(s)
5659
result += s
5760

5861
# case 1: code cell
@@ -68,10 +71,6 @@ def process_cell(cell):
6871

6972
return result
7073

71-
# TODO: convert markdown to html
72-
def markdown_to_html(data):
73-
return data
74-
7574
def load_imagej_tutorials(root):
7675
"""
7776
Loads the content from the given imagej/tutorials folder.

0 commit comments

Comments
 (0)