Skip to content

Commit

Permalink
Merge branch 'master' into fix-root-links
Browse files Browse the repository at this point in the history
[ci skip]

Conflicts:
	CHANGES.txt
  • Loading branch information
Kwpolska committed Jan 18, 2015
2 parents aa3f967 + 9ab9bbe commit 86ec1da
Show file tree
Hide file tree
Showing 20 changed files with 51 additions and 135 deletions.
4 changes: 3 additions & 1 deletion CHANGES.txt
@@ -1,17 +1,19 @@
New in master
New in v7.3.0
=============

Features
--------

* Added ``root`` path handler (via Issues #1008, #1573)
* Added RSS feeds to gallery HEAD (part of Issue #786)

Bugfixes
--------

* Links to languages point to site root and not the blog (Issue #1008)
* Brand link is now language-specific (Issue #1573)
* Fixed compatibility with IPython 3.x (Issue #1581)
* Compilers mark tasks as out of date if compiler-specific options and plugins change (Issue #1523)

New in v7.3.0
=============
Expand Down
97 changes: 0 additions & 97 deletions docs/man/nikola.1

This file was deleted.

Binary file added docs/man/nikola.1.gz
Binary file not shown.
5 changes: 5 additions & 0 deletions nikola/data/themes/base-jinja/templates/gallery.tmpl
Expand Up @@ -34,3 +34,8 @@
{{ comments.comment_form(None, permalink, title) }}
{% endif %}
{% endblock %}

{% block extra_head %}
{{ super() }}
<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml">
{% endblock %}
5 changes: 5 additions & 0 deletions nikola/data/themes/base/templates/gallery.tmpl
Expand Up @@ -34,3 +34,8 @@
${comments.comment_form(None, permalink, title)}
%endif
</%block>

<%block name="extra_head">
${parent.extra_head()}
<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml">
</%block>
1 change: 1 addition & 0 deletions nikola/data/themes/bootstrap-jinja/templates/gallery.tmpl
Expand Up @@ -40,6 +40,7 @@

{% block extra_head %}
{{ super() }}
<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml">
<style type="text/css">
.image-block {
display: inline-block;
Expand Down
1 change: 1 addition & 0 deletions nikola/data/themes/bootstrap/templates/gallery.tmpl
Expand Up @@ -40,6 +40,7 @@ ${comments.comment_form(None, permalink, title)}

<%block name="extra_head">
${parent.extra_head()}
<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml">
<style type="text/css">
.image-block {
display: inline-block;
Expand Down
1 change: 1 addition & 0 deletions nikola/data/themes/bootstrap3-jinja/templates/gallery.tmpl
Expand Up @@ -41,6 +41,7 @@

{% block extra_head %}
{{ super() }}
<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml">
<style type="text/css">
.image-block {
display: inline-block;
Expand Down
1 change: 1 addition & 0 deletions nikola/data/themes/bootstrap3/templates/gallery.tmpl
Expand Up @@ -41,6 +41,7 @@ ${comments.comment_form(None, permalink, title)}

<%block name="extra_head">
${parent.extra_head()}
<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml">
<style type="text/css">
.image-block {
display: inline-block;
Expand Down
7 changes: 6 additions & 1 deletion nikola/plugins/command/check.py
Expand Up @@ -47,7 +47,12 @@ def _call_nikola_list(site, arguments):
command.append('--conf=' + site.configuration_filename)
command.extend(["list", "--all"])
result = []
for task in subprocess.Popen(command, shell=False, stdout=subprocess.PIPE).stdout.readlines():
if os.name == 'nt':
shell = True
command = ' '.join(command)
else:
shell = False
for task in subprocess.Popen(command, shell=shell, stdout=subprocess.PIPE).stdout.readlines():
result.append(task.decode('utf-8'))
return result

Expand Down
8 changes: 7 additions & 1 deletion nikola/plugins/compile/markdown/__init__.py
Expand Up @@ -53,16 +53,18 @@ class CompileMarkdown(PageCompiler):
site = None

def set_site(self, site):
self.enabled_extensions = []
for plugin_info in site.plugin_manager.getPluginsOfCategory("MarkdownExtension"):
if plugin_info.name in site.config['DISABLED_PLUGINS']:
site.plugin_manager.removePluginFromCategory(plugin_info, "MarkdownExtension")
continue

self.enabled_extensions.append(plugin_info.name)
site.plugin_manager.activatePluginByName(plugin_info.name)
plugin_info.plugin_object.set_site(site)
self.extensions.append(plugin_info.plugin_object)
plugin_info.plugin_object.short_help = plugin_info.description

self.enabled_extensions += site.config.get("MARKDOWN_EXTENSIONS")
return super(CompileMarkdown, self).set_site(site)

def compile_html(self, source, dest, is_two_file=True):
Expand Down Expand Up @@ -96,3 +98,7 @@ def create_post(self, path, **kw):
fd.write(write_metadata(metadata))
fd.write('-->\n\n')
fd.write(content)

def register_extra_dependencies(self, post):
"""Adds dependency to post object to check .dep file."""
post.add_dependency_uptodate(self.enabled_extensions)
4 changes: 4 additions & 0 deletions nikola/plugins/compile/pandoc.py
Expand Up @@ -70,3 +70,7 @@ def create_post(self, path, **kw):
fd.write(write_metadata(metadata))
fd.write('-->\n\n')
fd.write(content)

def register_extra_dependencies(self, post):
"""Adds dependency to post object to check .dep file."""
post.add_dependency_uptodate(self.site.config['PANDOC_OPTIONS'])
3 changes: 3 additions & 0 deletions nikola/plugins/compile/rest/__init__.py
Expand Up @@ -63,6 +63,7 @@ def _read_extra_deps(self, post):
def register_extra_dependencies(self, post):
"""Adds dependency to post object to check .dep file."""
post.add_dependency(lambda: self._read_extra_deps(post), 'fragment')
post.add_dependency_uptodate(self.enabled_plugins)

def compile_html(self, source, dest, is_two_file=True):
"""Compile reSt into HTML."""
Expand Down Expand Up @@ -128,12 +129,14 @@ def create_post(self, path, **kw):
fd.write(content)

def set_site(self, site):
self.enabled_plugins = []
for plugin_info in site.plugin_manager.getPluginsOfCategory("RestExtension"):
if plugin_info.name in site.config['DISABLED_PLUGINS']:
site.plugin_manager.removePluginFromCategory(plugin_info, "RestExtension")
continue

site.plugin_manager.activatePluginByName(plugin_info.name)
self.enabled_plugins.append(plugin_info.name)
plugin_info.plugin_object.set_site(site)
plugin_info.plugin_object.short_help = plugin_info.description

Expand Down
3 changes: 2 additions & 1 deletion nikola/plugins/task/galleries.py
Expand Up @@ -234,7 +234,8 @@ def gen_tasks(self):
folder += '/'
folders.append((folder, ft))

context["folders"] = natsort.natsorted(folders)
context["folders"] = natsort.natsorted(
folders, alg=natsort.ns.F | natsort.ns.IC)
context["crumbs"] = crumbs
context["permalink"] = self.site.link("gallery", gallery, lang)
context["enable_comments"] = self.kw['comments_in_galleries']
Expand Down
6 changes: 4 additions & 2 deletions nikola/plugins/task/listings.py
Expand Up @@ -143,8 +143,10 @@ def render_listing(in_name, out_name, input_folder, output_folder, folders=[], f
'crumbs': crumbs,
'permalink': permalink,
'lang': self.kw['default_lang'],
'folders': natsort.natsorted(folders),
'files': natsort.natsorted(files),
'folders': natsort.natsorted(
folders, alg=natsort.ns.F | natsort.ns.IC),
'files': natsort.natsorted(
files, alg=natsort.ns.F | natsort.ns.IC),
'description': title,
'source_link': source_link,
}
Expand Down
3 changes: 2 additions & 1 deletion nikola/post.py
Expand Up @@ -187,7 +187,8 @@ def __init__(
self._tags = {}
for lang in self.translated_to:
self._tags[lang] = natsort.natsorted(
list(set([x.strip() for x in self.meta[lang]['tags'].split(',')])))
list(set([x.strip() for x in self.meta[lang]['tags'].split(',')])),
alg=natsort.ns.F | natsort.ns.IC)
self._tags[lang] = [t for t in self._tags[lang] if t]
if 'draft' in self._tags[lang]:
is_draft = True
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Expand Up @@ -11,4 +11,4 @@ PyRSS2Gen>=1.1
logbook>=0.7.0
blinker>=1.3
setuptools>=5.4.1
natsort>=3.3.0
natsort>=3.5.2
4 changes: 3 additions & 1 deletion scripts/set_version.py
Expand Up @@ -9,6 +9,7 @@
import re
import sys
import glob
import subprocess


def sed_like_thing(pattern, repl, path):
Expand All @@ -34,4 +35,5 @@ def sed_like_thing(pattern, repl, path):
sed_like_thing("release = .*", "release = '{0}'".format(version), os.path.join('docs', 'sphinx', 'conf.py'))
sed_like_thing('__version__ = ".*"', '__version__ = "{0}"'.format(version), os.path.join('nikola', '__init__.py'))
sed_like_thing('New in master', 'New in v{0}'.format(version), 'CHANGES.txt')
os.system("help2man -h help -N --version-string='{0}' nikola > {1}".format(version, os.path.join('docs', 'man', 'nikola.1')))
subprocess.call(["help2man", "-N", "--version-string={0}".format(version), "-n", "static site and blog generator", "-o", os.path.join('docs', 'man', 'nikola.1'), "nikola"])
subprocess.call(["gzip", "-f", os.path.join('docs', 'man', 'nikola.1')])
2 changes: 1 addition & 1 deletion setup.cfg
@@ -1,5 +1,5 @@
[wheel]
universal = 0
universal = 1

[flake8]
ignore=E501
29 changes: 1 addition & 28 deletions setup.py
Expand Up @@ -96,33 +96,6 @@ def expands_symlinks_for_windows():
"\n\tYour best bet is to start again from clean.")


def install_manpages(root, prefix):
try:
man_pages = [
('docs/man/nikola.1', 'share/man/man1/nikola.1'),
]
join = os.path.join
normpath = os.path.normpath
if root is not None:
prefix = os.path.realpath(root) + os.path.sep + prefix
for src, dst in man_pages:
path_dst = join(normpath(prefix), normpath(dst))
try:
os.makedirs(os.path.dirname(path_dst))
except OSError:
pass
rst2man_cmd = ['rst2man.py', 'rst2man']
for rst2man in rst2man_cmd:
try:
subprocess.call([rst2man, src, path_dst])
except OSError:
continue
else:
break
except Exception as e:
print("Not installing the man pages:", e)


def remove_old_files(self):
tree = os.path.join(self.install_lib, 'nikola')
try:
Expand All @@ -136,7 +109,6 @@ def run(self):
expands_symlinks_for_windows()
remove_old_files(self)
install.run(self)
install_manpages(self.root, self.prefix)


setup(name='Nikola',
Expand Down Expand Up @@ -187,6 +159,7 @@ def run(self):
'docs/manual.txt',
'docs/theming.txt',
'docs/extending.txt']),
('share/man/man1', ['docs/man/nikola.1.gz']),
],
entry_points = {
'console_scripts': [
Expand Down

0 comments on commit 86ec1da

Please sign in to comment.