Bläddra i källkod

Org_reader: Write the reader code

Gendre Sébastien 7 år sedan
förälder
incheckning
9e4ae2f7ed
1 ändrade filer med 8 tillägg och 1 borttagningar
  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