瀏覽代碼

Org_reader: Write the reader code

Gendre Sébastien 7 年之前
父節點
當前提交
9e4ae2f7ed
共有 1 個文件被更改,包括 8 次插入1 次删除
  1. 8 1
      org_reader/org_reader.py

+ 8 - 1
org_reader/org_reader.py

@@ -73,5 +73,12 @@ class OrgReader(BaseReader):
         Keyword Arguments:
         source_path -- Path to the Org file to parse
         """
-        pass
+        self._source_path = source_path
+        with pelican_open as text:
+            text_lines = list(text.splitlines())
+
+        header, content = self._separate_header_and_content(text_lines)
+        metadatas = self._parse_metadatas(header)
+        content_html = org_to_html("\n".join(content))
+        return content_html, metadatas