1
0
Fork 0
forked from github/pelican
Commit graph

798 commits

Author SHA1 Message Date
Justin Mayer
f3bc2ece86 Merge pull request #382 from mankyd/htmlparser
New, more thorough HTMLParser
2013-02-09 16:48:50 -08:00
Igor Kalnitsky
0285bbcec4 Fix bug with docutils' code directive.
Since version 0.9 `docutils` supports `code` directive. But this directive
can generate fullname classes for the `pygments` style classes.

For example, the following code

```reStructuredText
.. code:: c++

    GetFoo()->do_something();
```

generate the following output

```html
<pre class="code c++ literal-block">
  <span class="name">GetFoo</span>
  <span class="punctuation">()</span>
  <span class="operator">-&gt;</span>
  <span class="name">do_something</span>
  <span class="punctuation">();</span>
</pre>
```

Note, that fullname classes were used, when we need a short one

```html
<pre class="code c++ literal-block">
  <span class="n">GetFoo</span>
  <span class="p">()</span>
  <span class="o">-&gt;</span>
  <span class="n">do_something</span>
  <span class="p">();</span>
</pre>
```
2013-02-08 01:47:20 +02:00
dave mankoff
d5bfec3a8b update documentation and remove commented out code 2013-01-28 22:25:15 -05:00
dave mankoff
2a3d7d0319 fix python3 support 2013-01-28 22:21:45 -05:00
dave mankoff
7b59b34a73 get tests passing 2013-01-28 22:11:06 -05:00
dave mankoff
5f639b9a3b git rebase master 2013-01-28 21:46:54 -05:00
dave mankoff
357f3a3da2 properly write out charref's 2013-01-28 21:46:23 -05:00
dave mankoff
bc2bc7a330 git merge upstream/master 2013-01-28 21:41:42 -05:00
Benoît HERVIER
5f3a3e4582 Update pelican/contents.py
Put a space in error message to not concatain word 'about' and the missing tag
2013-01-24 14:10:26 +01:00
Rıdvan Örsvuran
0288bf1f68 added IGNORE_FILES setting for autoreload 2013-01-23 01:02:46 +01:00
Bruno Binet
ffdf8babbf Merge pull request #651 from traeblain/webasset-config
Update webassets plugin to allow user to pass configuration settings to webassets
2013-01-21 14:32:12 -08:00
Bruno Binet
d9855ae346 Merge pull request #662 from wking/rich-urlwrapper-comparisons
contents: Add rich comparisons to URLWrapper for easy sorting
2013-01-21 13:30:02 -08:00
Bruno Binet
6233f5a409 Merge pull request #667 from wking/page-path
Consolidate Path.filename and and StaticContent.filepath as `source_path`.
2013-01-18 07:30:03 -08:00
W. Trevor King
13cd0a4cb3 contents: Add deprecation warnings for Page.filename and StaticContent.filepath 2013-01-18 08:48:26 -05:00
W. Trevor King
ec50e18a3e utils: Add deprecated_attribute decorator 2013-01-18 08:48:21 -05:00
W. Trevor King
c3c3037a1d utils: Teach mkdir_p to fail if the existing target isn't a directory
Existing symlinks to directories will still pass, because isdir()
follows symbolic links.
2013-01-18 08:32:55 -05:00
W. Trevor King
004adfa5cc content: Convert Path.filename to .source_path
Making everything consistent is a bit awkward, since this is a
commonly used attribute, but I've done my best.

Reasons for not consolidating on `filename`:

* It is often used for the "basename" (last component in the path).
  Using `source_path` makes it clear that this attribute can contain
  multiple components.

Reasons for not consolidating on `filepath`:

* It is barely used in the Pelican source, and therefore easy to
  change.
* `path` is more Pythonic.  The only place `filepath` ever show up in
  the documentation for `os`, `os.path`, and `shutil` is in the
  `os.path.relpath` documentation [1].

Reasons for not consolidating on `path`:

* The Page elements have both a source (this attribute) and a
  destination (.save_as).  To avoid confusion for developers not aware
  of this, make it painfully obvious that this attribute is for the
  source.  Explicit is better than implicit ;).

Where I was touching the line, I also updated the string formatting in
StaticGenerator.generate_output to use the forward compatible
'{}'.format() syntax.

[1]: http://docs.python.org/2/library/os.path.html#os.path.relpath
2013-01-18 07:57:35 -05:00
W. Trevor King
61f05672e6 content: Convert StaticContent.filepath to .filename
For reasons that are unclear to me, StaticContent introduces the
`filepath` attribute rather than using the existing (and semantically
equivalent) Page.filename.  This has caused confusion before [1], and
it's probably a good idea to merge the two.

While I was touching the line, I also updated the string formatting in
StaticGenerator.generate_output to use the forward compatible
'{}'.format() syntax.

[1]: https://github.com/getpelican/pelican/issues/162#issuecomment-3000363
2013-01-18 07:40:42 -05:00
Bruno Binet
08a5ea6fdf Merge pull request #663 from wking/url-format-metadata
contents: Page.url_format should expose all metadata
2013-01-18 03:20:10 -08:00
W. Trevor King
d2a221c899 contents: Encode Unicode locales for Python 2 in Page.__init__
Python 2.7 chokes on Unicode locales:

  $ python2.7
  >>> import locale
  >>> locale.setlocale(locale.LC_ALL, u'ja_JP.utf8')
  Traceback (most recent call last):
    ...
  ValueError: too many values to unpack

With the addition of:

  from __future__ import unicode_literals

to tests/test_contents.py in:

  commit bebb94c15b
  Author: W. Trevor King <wking@tremily.us>
  Date:   Tue Jan 15 22:50:58 2013 -0500

    test_contents.py: Add URLWrapper comparison tests

the locale strings in TestPage.test_datetime are interpreted as
Unicode.  Rather than fixing the encoding there, this patch updates
Page to handle Unicode locales automatically.
2013-01-17 09:49:03 -05:00
W. Trevor King
2c434ebac1 contents: Add rich comparisons to URLWrapper for easy sorting
There have been earlier attempts to sort categories and authors
[1,2,3], but they either sorted based on the object id [3], or only
sorted the main author and categories list.

This patch uses rich comparisons (keyed off URLWrapper.name, but
easily adjustable in subclasses) to make the objects sortable without
specifying a key for each sort.  For example, now

  {% for tag, articles in tags|sort %}

works as expected in a Jinja template.

The functools.total_ordering decorator fills in the missing rich
comparisons [4,5].

[1]: 877d454c8f
[2]: 7f36e0ed20
[3]: d0ec18f4db
[4]: http://docs.python.org/2/library/functools.html#functools.total_ordering
[5]: http://docs.python.org/3/library/functools.html#functools.total_ordering
2013-01-15 22:51:53 -05:00
Alexis Metaireau
a7fb6b5eae Merge pull request #661 from wking/settings-abspath
settings: Fix abspath existence check for path settings
2013-01-15 10:56:57 -08:00
Alexis Métaireau
149ca493e0 Annotate py3k code when needed. 2013-01-11 18:55:04 +01:00
Alexis Métaireau
1197e09626 Revert previously erased changes 2013-01-11 18:46:16 +01:00
Dirk Makowski
71995d5e1b Port pelican to python 3.
Stays compatible with 2.x series, thanks to an unified codebase.
2013-01-11 03:20:09 +01:00
W. Trevor King
88b5a27ddf contents: Page.url_format should expose all metadata
I want to add `directory` metadata to each page in `content/pages/` to
place my non-article pages by hand:

  PAGE_URL = '{directory}/{slug}'
  PAGE_SAVE_AS = '{directory}/{slug}/index.html'

To do this, I need the `directory` metadata for formatting the URL.
2013-01-03 18:18:18 -05:00
W. Trevor King
9eb5ad77ef settings: Fix abspath existence check for path settings
The path to check is `absp`.  `p` is the setting name.
2013-01-03 12:19:27 -05:00
Trae Blain
a71465217b Update webassets plugin to allow user to pass configuration settings to Webassets through their settings file. Also removed language about DEBUG not compiling CSS since as of at least webassets 0.8 this is no longer an issue. 2013-01-02 16:26:39 -06:00
Wraithan (Chris McDonald)
fcc74be267 pep8/style matching 2012-12-29 10:03:28 -08:00
Alexis Metaireau
92c085c28e Merge pull request #635 from michaelreneer/markdown-summary-metadata
Updated markdown reader to parse summary metadata as markup.
2012-12-11 05:07:30 -08:00
Alexis Metaireau
98c8db568b Merge pull request #577 from davidjb/import-improvements-slug
Provide slug storage option for posts during Pelican import
2012-12-11 03:52:12 -08:00
David Beitey
b4c5d7cf62 Store slugs in posts by default on Pelican import 2012-12-11 21:44:40 +10:00
Michael Reneer
b35947f7a6 Cleaned up markdown read. 2012-12-11 00:48:47 -05:00
Michael Reneer
733e41a6a7 Updated markdown reader to parse summary metadata as markup. 2012-12-11 00:34:15 -05:00
Bruno Binet
f79c844855 remote duplicated import statement (thanks @traeblain) 2012-12-09 08:30:17 +01:00
Alexis Métaireau
f92c0cb69d update the version scheme to support micro versions 2012-12-04 01:43:19 +01:00
Alexis Métaireau
be2a3f4030 bump version number 2012-12-04 01:27:16 +01:00
Bruno Binet
21e8087822 fix weird implementation for extension removal
this leads to raising exception when slug was not used to generate the url
2012-12-04 00:49:32 +01:00
Bruno Binet
8bb86d3e5d revert #523
we don't need a new MARKDOWN_EXTENSIONS setting because the equivalent setting
MD_EXTENSIONS already exists.
2012-12-03 22:35:11 +01:00
Bruno Binet
dfab8ed5b9 test the "metadata from filename" feature 2012-12-03 09:54:43 +01:00
Bruno Binet
debd6fb3b4 add FILENAME_METADATA setting to extract metadata from filename
FILENAME_METADATA default to '(?P<date>\d{4}-\d{2}-\d{2}).*' which will allow
to extract date metadata from the filename.
2012-12-03 09:53:14 +01:00
Justin Mayer
a0049f9fcd Strip tags from title in simple index. Fixes #612
This fix was applied previously to the relevant places in both the
"simple" and "notmyidea" themes, but the simple theme's index.html file
was apparently neglected.
2012-12-02 16:10:11 -08:00
Brian C. Lane
49f481e399 Add asciidoc reader support
http://www.methods.co.nz/asciidoc/index.html

Processes files ending in .asc with asciidoc. Extra arguments can be
passed by using the ASCIIDOC_OPTIONS config setting
2012-12-02 10:20:13 -08:00
Bruno Binet
a0504aeabe add support for relative cross-site links 2012-12-01 21:32:02 +01:00
Bruno Binet
c74abe579b Don't rewrite URLs
Remove the code that was appending ../static in front of some URLs, and add a
way to do cross-content linking.
2012-12-01 21:30:50 +01:00
Alexis Metaireau
f653118658 Merge pull request #588 from tpievila/dev_server_fix
Kill SimpleHTTPServer also on OS X
2012-11-29 14:08:53 -08:00
Simon
088c810b00 Change the way to compute relative paths to avoid the leading .././ when using
relative urls.
2012-11-29 21:50:46 +01:00
Bruno Binet
c749671778 Reimplemented the gzip compression as a plugin.
Extending the Writer wasn't the complete answer because the static
generator also copies some files. Instead, I implemented the work as a
plugin that attaches to the finalized event.
2012-11-29 15:00:44 +01:00
Justin Mayer
7056622322 Fix missing SITEURL and base home link
1. Following up on bbinet's changes in f12a297, ensure that the notmyidea
theme's article.html template includes the SITEURL variable when
constructing URL links.

2. Add missing slash to the base.html template so that clicking on the
site header at top left refers to "/" instead of "" when SITEURL is not
defined. Otherwise, the "" target will cause the browser to load the
current page and not the site's root (as one would expect).
2012-11-27 16:01:05 -08:00
Bruno Binet
fa82e19c1f change default value for DEFAULT_DATE to None
(was 'fs' => guess from file mtime)
2012-11-28 00:29:51 +01:00