1
0
Fork 0
forked from github/pelican
Commit graph

88 commits

Author SHA1 Message Date
Deniz Turgut
9936538d8b unify css class for pygments 2013-04-02 18:39:52 -04:00
W. Trevor King
29cdb37af3 generators: Use the static format to read Static metadata
This cuts down on the remaining difference between static files and
articles/pages.  The main difference is that path-based metadata is
now parsed for static content.
2013-03-21 14:17:50 -04:00
W. Trevor King
f147d9ec4a readers: Add 'static' to the base Reader's extensions
Instead of just being a base class, we can use it to parse static
files.  It won't actually do any parsing, but we will get path
metadata extraction from read_file, and this will make the
StaticGenerator implementation simpler.
2013-03-21 13:03:54 -04:00
W. Trevor King
bfa8851af0 Add the PATH_METADATA setting
Sometimes the base filename doesn't have everything you need.

Remember that os.sep is platform dependent, so using it in a regular
expression for this setting may not be portable (boo MS Windows!).
2013-03-12 15:16:25 -07:00
W. Trevor King
c46ca5d5d1 readers: Split parse_path_metadata from read_file
For easier re-use.  I also extract the path metadata first, so
metadata explicitly listed in the file contents will take precedence
over metadata parsed from the filename.
2013-03-12 15:16:25 -07:00
Alexis Métaireau
12c43b7d4d Make METADATA_PROCESSORS and EXTENSIONS public. 2013-03-12 12:19:53 -07:00
Simon
a7a71da6df Fix a test in the asciidoc reader, and add asciidoc to travis so that
the related tests will not be skipped.
2013-03-03 21:43:04 -08:00
Eric
e721727476 Allow explicit setting of markdown extensions
These additions are to make it easier to disable pygments or any other
extension the user may not want. In the previous version, these plugins are
hardcoded, but by making it a variable in the config, it is possible to not use
pygments or easily load extra markdown plugins if needed; you can have multiple
plugins in one virtual environment and have different configs load them as
needed.

In my `pelicanconf.py` I then have the following:

    MD_EXTENSIONS = ['extra', 'syntaxhighlighter']

where `syntaxhighlighter` is a custom markdown extension I am working on to use
syntax highlighter instead of pygments for code highlighting.
2013-03-03 21:36:45 -08:00
Alexis Métaireau
519dcdbcb3 Manual pass on sources for better standards. 2013-03-03 20:12:31 -08:00
dave mankoff
08439bdcf1 fix null attributes in html parser 2013-02-10 11:02:52 -05:00
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
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
Alexis Métaireau
149ca493e0 Annotate py3k code when needed. 2013-01-11 18:55:04 +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
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
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
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
Alexis Métaireau
84c708b74b Revert "Get HtmlReader to work again"
This reverts commit 39db9ddcfd.

Conflicts:

	tests/test_readers.py
2012-10-29 00:36:42 +01:00
Alexis Métaireau
0ebba1c4ab merge with master 2012-10-25 14:54:19 +02:00
Alexis Métaireau
17dc36aad6 merge upstream 2012-10-12 23:22:55 +02:00
Wladislaw Merezhko
7ffa9e21d8 Change name of utils.open function to pelican_open and refactor this change across project. 2012-10-12 23:01:50 +02:00
Stéphane Bunel
5e895317f6 FIX: Standardizing "extentions" to "extensions" 2012-10-03 22:42:07 +02:00
Stéphane Bunel
ee46becaf9 FIX: Standardizing "extentions" to "extensions" 2012-10-03 22:29:59 +02:00
Stéphane Bunel
45c836fdf5 Update docs and tests for MARKDOWN_EXTENTIONS 2012-09-28 23:09:57 +02:00
stephane
4f5253bcb3 Add MARKDOWN_EXTENTIONS configuration parameter to enable Markdown extentions of your choice.
Ex: MARKDOWN_EXTENTIONS = [ 'toc', ] enable TOC markup to generate Table of Contents.
2012-09-27 19:49:42 +02:00
Wladislaw Merezhko
0c2625e59d Change name of utils.open function to pelican_open and refactor this change across project. 2012-09-08 13:07:51 +03:00
Florian Jacob
39db9ddcfd Get HtmlReader to work again
wrote unit tests and documentation, improved regular expression.
The HtmlReader is enabled by default now and parses metadata in html
files of the form:
<!-- key:value -->
2012-09-02 10:29:09 +02:00
Alexis Metaireau
22c88e4de3 update typogrify support 2012-07-26 22:02:06 +02:00
Dirkjan Ochtman
636fd6cc38 Add support for abbreviations to reST translator (fixes #395). 2012-07-17 13:30:06 +02:00
dave mankoff
c0578eb9ab handle escaped chars in html properly 2012-06-20 23:19:06 -04:00
dave mankoff
56800a1d43 fix failing test with new open context manager 2012-06-20 20:02:41 -04:00
dave mankoff
caa4442abb re-import cgi. properly turn utils.open into a context manager 2012-06-20 19:59:32 -04:00
dave mankoff
c608d39aa4 re-import htmlparser 2012-06-20 19:52:17 -04:00
dave mankoff
7b6a97dee0 git merge master 2012-06-20 19:49:31 -04:00
dave mankoff
0373c15e43 include html comments properly in reader 2012-06-14 23:16:27 -04:00
dave mankoff
cc1988fbda new HTMLReader 2012-06-14 23:08:34 -04:00
dave mankoff
c6d1de14f3 better html parser 2012-06-10 18:27:38 -04:00
Simon
4a0d4461e1 Apply typogrify on the title.
As it is done when reading the file, we need to remove html tags for the
permalink and the slug (this is done here for the notmyidea and simple themes).

While modifying the themes I also replaced the `pagename` template tag with
`article.url` (`pagename` was an empty variable, no more used ?).
2012-05-07 12:26:17 +02:00
Matt Bowcock
faecba6035 Changed variable name extension to file_extensions. 2012-05-01 22:34:32 -04:00