From 036728a194695d463123c714954c25a3d6a826d5 Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Thu, 21 Jun 2012 09:05:27 -0400 Subject: [PATCH 1/4] properly write out charref's --- pelican/readers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/readers.py b/pelican/readers.py index 08ef4cf8..93549d96 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -200,7 +200,7 @@ class HTMLReader(Reader): self._data_buffer += '&{};'.format(data) def handle_charref(self, data): - self._data_buffer += '&{};'.format(data) + self._data_buffer += '&#{};'.format(data) def build_tag(self, tag, attrs, close_tag): result = '<{}'.format(cgi.escape(tag)) From 847a6fe3cee7f05e36679d6b12fafaf58cfc1045 Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Thu, 21 Jun 2012 09:12:38 -0400 Subject: [PATCH 2/4] change 'markdown' to HTML in the comments --- pelican/readers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/readers.py b/pelican/readers.py index 93549d96..9d200599 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -222,7 +222,7 @@ class HTMLReader(Reader): return next((x[1] for x in attrs if x[0] == name), default) def read(self, filename): - """Parse content and metadata of markdown files""" + """Parse content and metadata of HTML files""" with open(filename) as content: parser = self._HTMLParser(self.settings) parser.feed(content) From a86d5fda71a2d2ce7295cb385641331b139bf361 Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Mon, 9 Jul 2012 22:43:51 -0400 Subject: [PATCH 3/4] add documentation for html reader --- docs/getting_started.rst | 30 ++++++++++++++++++++++++++++++ docs/internals.rst | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 93d578a0..d60cce83 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -154,6 +154,36 @@ Markdown posts should follow this pattern:: This is the content of my super blog post. +Lastly, you can use Vanilla HTML (files ending in ``.htm`` and ``.html``). Pelican +interprets the HTML in a very straightforward manner, reading meta data out +of ``meta`` tags, the title out of the ``title`` tag, and the body out of the +``body`` tag:: + + + + My super title + + + + + + + This is the content of my super blog post. + + Content continues down here. + + + +With HTML, there are two simple exceptions to the standard metadata. First, +``tags`` can be specified either with the ``tags`` metadata, as is standard in +Pelican, or with the ``keywords`` metadata, as is standard in HTML. The two can +be used interchangeably. The second note is that summaries are done differently +in HTML posts. Either a ``summary`` metadata tag can be supplied, or, as seen +above, you can place an HTML comment, ````, that +Pelican will recognize. Everything before the comment will be treated as a +summary. The content of the post will contain everything in the body tag, with +the special comment stripped out. + Note that, aside from the title, none of this metadata is mandatory: if the date is not specified, Pelican will rely on the file's "mtime" timestamp, and the category can be determined by the directory in which the file resides. For diff --git a/docs/internals.rst b/docs/internals.rst index 6b6f991f..a94d1c56 100644 --- a/docs/internals.rst +++ b/docs/internals.rst @@ -23,7 +23,7 @@ The logic is separated into different classes and concepts: on. Since those operations are commonly used, the object is created once and then passed to the generators. -* **Readers** are used to read from various formats (Markdown and +* **Readers** are used to read from various formats (HTML, Markdown and reStructuredText for now, but the system is extensible). Given a file, they return metadata (author, tags, category, etc.) and content (HTML-formatted). From 4ec6cefe1db92c0bc6cea9a95c810e3f5b455865 Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Mon, 9 Jul 2012 22:45:34 -0400 Subject: [PATCH 4/4] fix grammar --- docs/getting_started.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting_started.rst b/docs/getting_started.rst index d60cce83..5e553815 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -154,7 +154,7 @@ Markdown posts should follow this pattern:: This is the content of my super blog post. -Lastly, you can use Vanilla HTML (files ending in ``.htm`` and ``.html``). Pelican +Lastly, you can use vanilla HTML (files ending in ``.htm`` and ``.html``). Pelican interprets the HTML in a very straightforward manner, reading meta data out of ``meta`` tags, the title out of the ``title`` tag, and the body out of the ``body`` tag::