From cc1988fbda5f191768b9d20ef0f942b572d0bb39 Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Thu, 14 Jun 2012 23:08:34 -0400 Subject: [PATCH 001/246] new HTMLReader --- pelican/readers.py | 186 ++++++++---------- tests/content/article_with_keywords.html | 6 + tests/content/article_with_metadata.html | 15 ++ .../article_with_uppercase_metadata.html | 6 + tests/test_readers.py | 38 ++++ 5 files changed, 150 insertions(+), 101 deletions(-) create mode 100644 tests/content/article_with_keywords.html create mode 100644 tests/content/article_with_metadata.html create mode 100644 tests/content/article_with_uppercase_metadata.html diff --git a/pelican/readers.py b/pelican/readers.py index 83cb7e3b..9ce3e3c0 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -129,117 +129,101 @@ class MarkdownReader(Reader): metadata[name] = self.process_metadata(name, value[0]) return content, metadata -""" -class HtmlReader(Reader): - file_extensions = ['html', 'htm'] - _re = re.compile('\<\!\-\-\#\s?[A-z0-9_-]*\s?\:s?[A-z0-9\s_-]*\s?\-\-\>') - - def read(self, filename): - with open(filename) as content: - metadata = {'title': 'unnamed'} - for i in self._re.findall(content): - key = i.split(':')[0][5:].strip() - value = i.split(':')[-1][:-3].strip() - name = key.lower() - metadata[name] = self.process_metadata(name, value) - - return content, metadata -""" - -class PelicanHTMLParser(HTMLParser): - def __init__(self, settings): - HTMLParser.__init__(self) - self.body = '' - self.metadata = {} - self.settings = settings - - self._data_buffer = '' - - self._in_top_level = True - self._in_head = False - self._in_title = False - self._in_body = False - self._in_tags = False - - def handle_starttag(self, tag, attrs): - if tag == 'head' and self._in_top_level: - self._in_top_level = False - self._in_head = True - elif tag == 'title' and self._in_head: - self._in_title = True - self._data_buffer = '' - elif tag == 'body' and self._in_top_level: - self._in_top_level = False - self._in_body = True - self._data_buffer = '' - elif tag == 'meta' and self._in_head: - self._handle_meta_tag(attrs) - - elif self._in_body: - self._data_buffer += self.build_tag(tag, attrs, False) - - def handle_endtag(self, tag): - if tag == 'head': - if self._in_head: - self._in_head = False - self._in_top_level = True - elif tag == 'title': - self._in_title = False - self.metadata['title'] = self._data_buffer - elif tag == 'body': - self.body = self._data_buffer - self._in_body = False - self._in_top_level = True - elif self._in_body: - self._data_buffer += ''.format(cgi.escape(tag)) - - def handle_startendtag(self, tag, attrs): - if tag == 'meta' and self._in_head: - self._handle_meta_tag(attrs) - if self._in_body: - self._data_buffer += self.build_tag(tag, attrs, True) - - def handle_comment(self, data): - if self._in_body and data.strip() == 'PELICAN_END_SUMMARY': - self.metadata['summary'] = self._data_buffer - - def handle_data(self, data): - self._data_buffer += data - - def build_tag(self, tag, attrs, close_tag): - result = '<{}'.format(cgi.escape(tag)) - result += ''.join((' {}="{}"'.format(cgi.escape(k), cgi.escape(v)) for k,v in attrs)) - if close_tag: - return result + ' />' - return result + '>' - - def _handle_meta_tag(self, attrs): - name = self._attr_value(attrs, 'name') - contents = self._attr_value(attrs, 'contents', '') - if name == 'keywords': - if contents: - self.metadata['tags'] = [Tag(unicode(tag), self.settings) for tag in contents.split(',')] - elif name == 'date': - self.metadata['date'] = get_date(contents) - else: - self.metadata[name] = contents - - @classmethod - def _attr_value(cls, attrs, name, default=None): - return next((x[1] for x in attrs if x[0] == name), default) - class HTMLReader(Reader): + """Parses HTML files as input, looking for meta, title, and body tags""" file_extensions = ['htm', 'html'] enabled = True + class _HTMLParser(HTMLParser): + def __init__(self, settings): + HTMLParser.__init__(self) + self.body = '' + self.metadata = {} + self.settings = settings + + self._data_buffer = '' + + self._in_top_level = True + self._in_head = False + self._in_title = False + self._in_body = False + self._in_tags = False + + def handle_starttag(self, tag, attrs): + if tag == 'head' and self._in_top_level: + self._in_top_level = False + self._in_head = True + elif tag == 'title' and self._in_head: + self._in_title = True + self._data_buffer = '' + elif tag == 'body' and self._in_top_level: + self._in_top_level = False + self._in_body = True + self._data_buffer = '' + elif tag == 'meta' and self._in_head: + self._handle_meta_tag(attrs) + + elif self._in_body: + self._data_buffer += self.build_tag(tag, attrs, False) + + def handle_endtag(self, tag): + if tag == 'head': + if self._in_head: + self._in_head = False + self._in_top_level = True + elif tag == 'title': + self._in_title = False + self.metadata['title'] = self._data_buffer + elif tag == 'body': + self.body = self._data_buffer + self._in_body = False + self._in_top_level = True + elif self._in_body: + self._data_buffer += ''.format(cgi.escape(tag)) + + def handle_startendtag(self, tag, attrs): + if tag == 'meta' and self._in_head: + self._handle_meta_tag(attrs) + if self._in_body: + self._data_buffer += self.build_tag(tag, attrs, True) + + def handle_comment(self, data): + if self._in_body and data.strip() == 'PELICAN_END_SUMMARY': + self.metadata['summary'] = self._data_buffer + + def handle_data(self, data): + self._data_buffer += data + + def build_tag(self, tag, attrs, close_tag): + result = '<{}'.format(cgi.escape(tag)) + result += ''.join((' {}="{}"'.format(cgi.escape(k), cgi.escape(v)) for k,v in attrs)) + if close_tag: + return result + ' />' + return result + '>' + + def _handle_meta_tag(self, attrs): + name = self._attr_value(attrs, 'name').lower() + contents = self._attr_value(attrs, 'contents', '') + + if name == 'keywords': + name = 'tags' + self.metadata[name] = contents + + @classmethod + def _attr_value(cls, attrs, name, default=None): + return next((x[1] for x in attrs if x[0] == name), default) + def read(self, filename): """Parse content and metadata of markdown files""" with open(filename) as content: - parser = PelicanHTMLParser(self.settings) + parser = self._HTMLParser(self.settings) parser.feed(content) parser.close() - return parser.body, parser.metadata + metadata = {} + for k in parser.metadata: + metadata[k] = self.process_metadata(k, parser.metadata[k]) + return parser.body, metadata _EXTENSIONS = {} diff --git a/tests/content/article_with_keywords.html b/tests/content/article_with_keywords.html new file mode 100644 index 00000000..c869f514 --- /dev/null +++ b/tests/content/article_with_keywords.html @@ -0,0 +1,6 @@ + + + This is a super article ! + + + diff --git a/tests/content/article_with_metadata.html b/tests/content/article_with_metadata.html new file mode 100644 index 00000000..2bd77241 --- /dev/null +++ b/tests/content/article_with_metadata.html @@ -0,0 +1,15 @@ + + + This is a super article ! + + + + + + + + Multi-line metadata should be supported + as well as inline markup. + + + diff --git a/tests/content/article_with_uppercase_metadata.html b/tests/content/article_with_uppercase_metadata.html new file mode 100644 index 00000000..4fe5a9ee --- /dev/null +++ b/tests/content/article_with_uppercase_metadata.html @@ -0,0 +1,6 @@ + + + This is a super article ! + + + diff --git a/tests/test_readers.py b/tests/test_readers.py index a921cfc2..52887068 100644 --- a/tests/test_readers.py +++ b/tests/test_readers.py @@ -86,3 +86,41 @@ class MdReaderTest(unittest.TestCase): "

This is another markdown test file. Uses the mkd extension.

" self.assertEqual(content, expected) + +class HTMLReaderTest(unittest.TestCase): + + def test_article_with_metadata(self): + reader = readers.HTMLReader({}) + content, metadata = reader.read(_filename('article_with_metadata.html')) + expected = { + 'category': 'yeah', + 'author': u'Alexis Métaireau', + 'title': 'This is a super article !', + 'summary': u''' + Multi-line metadata should be supported + as well as inline markup. + ''', + 'date': datetime.datetime(2010, 12, 2, 10, 14), + 'tags': ['foo', 'bar', 'foobar'], + 'custom_field': 'http://notmyidea.org', + } + + for key, value in expected.items(): + self.assertEquals(value, metadata[key], key) + + def test_article_with_keywords(self): + reader = readers.HTMLReader({}) + content, metadata = reader.read(_filename('article_with_keywords.html')) + expected = { + 'tags': ['foo', 'bar', 'foobar'], + } + + for key, value in expected.items(): + self.assertEquals(value, metadata[key], key) + + def test_article_metadata_key_lowercase(self): + """Keys of metadata should be lowercase.""" + reader = readers.HTMLReader({}) + content, metadata = reader.read(_filename('article_with_uppercase_metadata.html')) + self.assertIn('category', metadata, "Key should be lowercase.") + self.assertEquals('Yeah', metadata.get('category'), "Value keeps cases.") From 0373c15e430e168928b645be3b9513f093b97403 Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Thu, 14 Jun 2012 23:16:27 -0400 Subject: [PATCH 002/246] include html comments properly in reader --- pelican/readers.py | 2 ++ tests/content/article_with_comments.html | 7 +++++ tests/test_readers.py | 36 ++++++++++++++++++------ 3 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 tests/content/article_with_comments.html diff --git a/pelican/readers.py b/pelican/readers.py index 9ce3e3c0..e3d0e0dd 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -190,6 +190,8 @@ class HTMLReader(Reader): def handle_comment(self, data): if self._in_body and data.strip() == 'PELICAN_END_SUMMARY': self.metadata['summary'] = self._data_buffer + else: + self._data_buffer += ''.format(data) def handle_data(self, data): self._data_buffer += data diff --git a/tests/content/article_with_comments.html b/tests/content/article_with_comments.html new file mode 100644 index 00000000..f222682d --- /dev/null +++ b/tests/content/article_with_comments.html @@ -0,0 +1,7 @@ + + + Summary comment is not included. + + + + diff --git a/tests/test_readers.py b/tests/test_readers.py index 52887068..b3e30bfc 100644 --- a/tests/test_readers.py +++ b/tests/test_readers.py @@ -88,6 +88,33 @@ class MdReaderTest(unittest.TestCase): self.assertEqual(content, expected) class HTMLReaderTest(unittest.TestCase): + def test_article_with_comments(self): + reader = readers.HTMLReader({}) + content, metadata = reader.read(_filename('article_with_comments.html')) + expected = { + 'summary': ''' + Summary comment is not included. + ''', + } + + for key, value in expected.items(): + self.assertEquals(value, metadata[key], key) + + self.assertEquals(''' + Summary comment is not included. + + + ''', content) + + def test_article_with_keywords(self): + reader = readers.HTMLReader({}) + content, metadata = reader.read(_filename('article_with_keywords.html')) + expected = { + 'tags': ['foo', 'bar', 'foobar'], + } + + for key, value in expected.items(): + self.assertEquals(value, metadata[key], key) def test_article_with_metadata(self): reader = readers.HTMLReader({}) @@ -108,15 +135,6 @@ class HTMLReaderTest(unittest.TestCase): for key, value in expected.items(): self.assertEquals(value, metadata[key], key) - def test_article_with_keywords(self): - reader = readers.HTMLReader({}) - content, metadata = reader.read(_filename('article_with_keywords.html')) - expected = { - 'tags': ['foo', 'bar', 'foobar'], - } - - for key, value in expected.items(): - self.assertEquals(value, metadata[key], key) def test_article_metadata_key_lowercase(self): """Keys of metadata should be lowercase.""" From c608d39aa40b8304f4e2e241564796201e582da4 Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Wed, 20 Jun 2012 19:52:17 -0400 Subject: [PATCH 003/246] re-import htmlparser --- pelican/readers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pelican/readers.py b/pelican/readers.py index 870c11c8..1916fa1e 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -15,6 +15,8 @@ except ImportError: Markdown = False # NOQA import re +from htmlparser import HTMLParser + from pelican.contents import Category, Tag, Author from pelican.utils import get_date, open From caa4442abb145d419a3120c7339ad7ecf91ac56c Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Wed, 20 Jun 2012 19:59:32 -0400 Subject: [PATCH 004/246] re-import cgi. properly turn utils.open into a context manager --- pelican/readers.py | 3 ++- pelican/utils.py | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pelican/readers.py b/pelican/readers.py index 1916fa1e..d05ab40f 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -15,7 +15,8 @@ except ImportError: Markdown = False # NOQA import re -from htmlparser import HTMLParser +import cgi +from HTMLParser import HTMLParser from pelican.contents import Category, Tag, Author from pelican.utils import get_date, open diff --git a/pelican/utils.py b/pelican/utils.py index 0940bf72..088a8faa 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -34,10 +34,15 @@ def get_date(string): raise ValueError("'%s' is not a valid date" % string) -def open(filename): +class open(object): """Open a file and return it's content""" - return _open(filename, encoding='utf-8').read() + def __init__(self, filename): + self.filename = filename + def __enter__(self): + return _open(self.filename, encoding='utf-8').read() + def __exit__(self, exc_type, exc_value, traceback): + pass def slugify(value): """ From 56800a1d43ff9e07659d0f5ad570a9004d44cd74 Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Wed, 20 Jun 2012 20:02:41 -0400 Subject: [PATCH 005/246] fix failing test with new open context manager --- pelican/readers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pelican/readers.py b/pelican/readers.py index d05ab40f..1d06bd6d 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -119,9 +119,9 @@ class MarkdownReader(Reader): def read(self, filename): """Parse content and metadata of markdown files""" - text = open(filename) - md = Markdown(extensions=set(self.extensions + ['meta'])) - content = md.convert(text) + with open(filename) as text: + md = Markdown(extensions=set(self.extensions + ['meta'])) + content = md.convert(text) metadata = {} for name, value in md.Meta.items(): From c0578eb9ab77c7be4a045f58a7844222ccbe6b95 Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Wed, 20 Jun 2012 23:19:06 -0400 Subject: [PATCH 006/246] handle escaped chars in html properly --- pelican/readers.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pelican/readers.py b/pelican/readers.py index 1d06bd6d..08ef4cf8 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -196,6 +196,12 @@ class HTMLReader(Reader): def handle_data(self, data): self._data_buffer += data + def handle_entityref(self, data): + self._data_buffer += '&{};'.format(data) + + def handle_charref(self, data): + self._data_buffer += '&{};'.format(data) + def build_tag(self, tag, attrs, close_tag): result = '<{}'.format(cgi.escape(tag)) result += ''.join((' {}="{}"'.format(cgi.escape(k), cgi.escape(v)) for k,v in attrs)) From 036728a194695d463123c714954c25a3d6a826d5 Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Thu, 21 Jun 2012 09:05:27 -0400 Subject: [PATCH 007/246] 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 008/246] 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 009/246] 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 010/246] 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:: From a5772bf3d6e0563b109dc1f2cb19743cf6a19aef Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Fri, 7 Dec 2012 00:10:30 +0100 Subject: [PATCH 011/246] allow override page url and save_as values directly from the metadata this is similar to the template override implemented in #404 --- pelican/contents.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pelican/contents.py b/pelican/contents.py index d675a2ad..77ee70f8 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -44,6 +44,8 @@ class Page(object): # set metadata as attributes for key, value in local_metadata.items(): + if key in ('save_as', 'url'): + key = 'override_' + key setattr(self, key.lower(), value) # also keep track of the metadata attributes available @@ -128,6 +130,8 @@ class Page(object): return self.settings[fq_key].format(**self.url_format) def get_url_setting(self, key): + if hasattr(self, 'override_' + key): + return getattr(self, 'override_' + key) key = key if self.in_default_lang else 'lang_%s' % key return self._expand_settings(key) From 00c7451200fd75056ebecb7cd681bda08b55d70a Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Fri, 7 Dec 2012 00:14:00 +0100 Subject: [PATCH 012/246] add functional test for save_as/url override and update functional tests output --- samples/content/pages/override_url_saveas.rst | 9 ++ .../basic/a-markdown-powered-article.html | 3 +- tests/output/basic/archives.html | 3 +- tests/output/basic/article-1.html | 3 +- tests/output/basic/article-2.html | 3 +- tests/output/basic/article-3.html | 3 +- .../output/basic/author/alexis-metaireau.html | 3 +- tests/output/basic/categories.html | 3 +- tests/output/basic/category/bar.html | 3 +- tests/output/basic/category/cat1.html | 3 +- tests/output/basic/category/misc.html | 3 +- tests/output/basic/category/yeah.html | 3 +- .../basic/filename_metadata-example.html | 3 +- tests/output/basic/index.html | 3 +- tests/output/basic/oh-yeah.html | 3 +- tests/output/basic/override/index.html | 53 +++++++++++ .../pages/this-is-a-test-hidden-page.html | 3 +- .../basic/pages/this-is-a-test-page.html | 3 +- tests/output/basic/second-article-fr.html | 3 +- tests/output/basic/second-article.html | 3 +- tests/output/basic/tag/bar.html | 3 +- tests/output/basic/tag/baz.html | 3 +- tests/output/basic/tag/foo.html | 3 +- tests/output/basic/tag/foobar.html | 3 +- tests/output/basic/tag/oh.html | 3 +- tests/output/basic/tag/yeah.html | 3 +- .../output/basic/this-is-a-super-article.html | 3 +- tests/output/basic/unbelievable.html | 3 +- .../custom/a-markdown-powered-article.html | 3 +- tests/output/custom/archives.html | 3 +- tests/output/custom/article-1.html | 3 +- tests/output/custom/article-2.html | 3 +- tests/output/custom/article-3.html | 3 +- .../custom/author/alexis-metaireau.html | 3 +- .../custom/author/alexis-metaireau2.html | 3 +- .../custom/author/alexis-metaireau3.html | 3 +- tests/output/custom/categories.html | 3 +- tests/output/custom/category/bar.html | 3 +- tests/output/custom/category/cat1.html | 3 +- tests/output/custom/category/misc.html | 3 +- tests/output/custom/category/yeah.html | 3 +- .../output/custom/drafts/a-draft-article.html | 3 +- .../custom/filename_metadata-example.html | 3 +- tests/output/custom/index.html | 3 +- tests/output/custom/index2.html | 3 +- tests/output/custom/index3.html | 3 +- tests/output/custom/jinja2_template.html | 3 +- tests/output/custom/oh-yeah-fr.html | 3 +- tests/output/custom/oh-yeah.html | 3 +- tests/output/custom/override/index.html | 88 +++++++++++++++++++ .../pages/this-is-a-test-hidden-page.html | 3 +- .../custom/pages/this-is-a-test-page.html | 3 +- tests/output/custom/second-article-fr.html | 3 +- tests/output/custom/second-article.html | 3 +- tests/output/custom/tag/bar.html | 3 +- tests/output/custom/tag/baz.html | 3 +- tests/output/custom/tag/foo.html | 3 +- tests/output/custom/tag/foobar.html | 3 +- tests/output/custom/tag/oh.html | 3 +- tests/output/custom/tag/yeah.html | 3 +- .../custom/this-is-a-super-article.html | 3 +- tests/output/custom/unbelievable.html | 3 +- 62 files changed, 268 insertions(+), 59 deletions(-) create mode 100644 samples/content/pages/override_url_saveas.rst create mode 100644 tests/output/basic/override/index.html create mode 100644 tests/output/custom/override/index.html diff --git a/samples/content/pages/override_url_saveas.rst b/samples/content/pages/override_url_saveas.rst new file mode 100644 index 00000000..8a515f60 --- /dev/null +++ b/samples/content/pages/override_url_saveas.rst @@ -0,0 +1,9 @@ +Override url/save_as +#################### + +:date: 2012-12-07 +:url: override/ +:save_as: override/index.html + +Test page which overrides save_as and url so that this page will be generated +at a custom location. diff --git a/tests/output/basic/a-markdown-powered-article.html b/tests/output/basic/a-markdown-powered-article.html index 80a12212..9b9da171 100644 --- a/tests/output/basic/a-markdown-powered-article.html +++ b/tests/output/basic/a-markdown-powered-article.html @@ -22,7 +22,8 @@