From d02e8b7e76eaa96f78235c52866bed0eaf0446e6 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Sun, 2 Jun 2019 13:20:51 +0300 Subject: [PATCH] next --- .gitmodules | 3 + pelicanconf-ascii.py | 116 --------------------------------- pelicanconf-f.py | 116 --------------------------------- pelicanconf-full.py | 6 +- pelicanconf.py | 3 +- plugins/thirdparty/asciidoctor | 1 + 6 files changed, 9 insertions(+), 236 deletions(-) delete mode 100644 pelicanconf-ascii.py delete mode 100644 pelicanconf-f.py create mode 160000 plugins/thirdparty/asciidoctor diff --git a/.gitmodules b/.gitmodules index 07a184a..8371206 100644 --- a/.gitmodules +++ b/.gitmodules @@ -23,3 +23,6 @@ [submodule "plugins/thirdparty/replacer"] path = plugins/thirdparty/replacer url = git@github.com:/narusemotoki/replacer +[submodule "plugins/thirdparty/asciidoctor"] + path = plugins/thirdparty/asciidoctor + url = git@git.246060.ru:f1x1t/pelican-asciidoctor diff --git a/pelicanconf-ascii.py b/pelicanconf-ascii.py deleted file mode 100644 index 8f174b7..0000000 --- a/pelicanconf-ascii.py +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- # -from __future__ import unicode_literals -import os - -class i18n(object): - # looks for translations in - # {LOCALE_DIR}/{LANGUAGE}/LC_MESSAGES/{DOMAIN}.mo - # if not present, falls back to default - - DOMAIN = 'messages' - LOCALE_DIR = '{THEME}/translations' - LANGUAGES = ['ru'] - NEWSTYLE = True - - __name__ = 'i18n' - - def register(self): - from pelican.signals import generator_init - generator_init.connect(self.install_translator) - - def install_translator(self, generator): - import gettext - try: - translator = gettext.translation( - self.DOMAIN, - self.LOCALE_DIR.format(THEME=THEME), - self.LANGUAGES) - except (OSError, IOError): - translator = gettext.NullTranslations() - generator.env.install_gettext_translations(translator, self.NEWSTYLE) - -# ABOUT_ME = ' ' -AUTHOR = 'Андрей Астафьев' -SITENAME = 'ДСП' -SITEURL = 'https://dsp.246060.ru' - -PATH = 'wiki' -CACHE_PATH = 'cache-ascii' - -TIMEZONE = 'Europe/Moscow' - -DEFAULT_LANG = 'ru' - -# Generation time -CACHE_CONTENT = True -LOAD_CONTENT_CACHE = True - -# Feed generation is usually not desired when developing -FEED_ALL_ATOM = None -CATEGORY_FEED_ATOM = None -TRANSLATION_FEED_ATOM = None -AUTHOR_FEED_ATOM = None -AUTHOR_FEED_RSS = None -USE_FOLDER_AS_CATEGORY = True -DEFAULT_DATE = 'fs' -STATIC_PATHS = [ 'images', 'files', 'extras' ] - -EXTRA_PATH_METADATA = { - 'extras/favicon.ico': {'path': 'favicon.ico'}, -} - -DISPLAY_CATEGORIES_ON_MENU = False -DISPLAY_CATEGORIES_ON_SIDEBAR = True -DISPLAY_TAGS_ON_SIDEBAR = True - -THEME = 'themes/bootstrap4' -BOOTSTRAP_THEME = 'litera' - -I18N_TEMPLATES_LANG = 'ru' -I18N_GETTEXT_NEWSTYLE = True -I18N_GETTEXT_LOCALEDIR = 'themes/bootstrap4/translations' -I18N_GETTEXT_DOMAIN = 'messages' -JINJA_ENVIRONMENT = {'extensions': ['jinja2.ext.i18n']} - -PLUGIN_PATHS = ["plugins/official", "plugins/thirdparty"] -PLUGINS = [i18n(), "pelican-css", "pelidoc", "series", "subcategory", "tag_cloud", "tipue_search", "replacer", "asciidoctor"] - -PDF_PROCESSOR = True - -ASCIIDOCTOR_CMD = "asciidoctor" -ASCIIDOCTOR_IMAGES_PATH = '{}/wiki/images'.format(os.getcwd()) -ASCIIDOCTOR_EXTRA_OPTIONS = [ - '--require', 'asciidoctor-diagram', - '--attribute=imagesdir='+ASCIIDOCTOR_IMAGES_PATH, -] - -REPLACES = ( - ('{}/wiki/'.format(os.getcwd()), u''), -) - -YUICOMPRESSOR_EXECUTABLE = "yui-compressor" -YUICOMPRESSOR_EXTRA_OPTIONS = ["--nomunge"] -#PLUGINS += ["yuicompressor-opt"] - -DIRECT_TEMPLATES = ('index', 'categories', 'authors', 'archives', 'search') - -# Blogroll -LINKS = () -# LINKS = (('Pelican', 'http://getpelican.com/'), -# ('Python.org', 'http://python.org/'), -# ('Jinja2', 'http://jinja.pocoo.org/'), -# ('You can modify those links in your config file', '#'),) - -# Social widget -SOCIAL = () -# SOCIAL = (('You can add links in your config file', '#'), -# ('Another social link', '#'),) - -PYGMENTS_STYLE='pastie' - -DEFAULT_PAGINATION = 20 - -# Uncomment following line if you want document-relative URLs when developing -RELATIVE_URLS = True - diff --git a/pelicanconf-f.py b/pelicanconf-f.py deleted file mode 100644 index 8f174b7..0000000 --- a/pelicanconf-f.py +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- # -from __future__ import unicode_literals -import os - -class i18n(object): - # looks for translations in - # {LOCALE_DIR}/{LANGUAGE}/LC_MESSAGES/{DOMAIN}.mo - # if not present, falls back to default - - DOMAIN = 'messages' - LOCALE_DIR = '{THEME}/translations' - LANGUAGES = ['ru'] - NEWSTYLE = True - - __name__ = 'i18n' - - def register(self): - from pelican.signals import generator_init - generator_init.connect(self.install_translator) - - def install_translator(self, generator): - import gettext - try: - translator = gettext.translation( - self.DOMAIN, - self.LOCALE_DIR.format(THEME=THEME), - self.LANGUAGES) - except (OSError, IOError): - translator = gettext.NullTranslations() - generator.env.install_gettext_translations(translator, self.NEWSTYLE) - -# ABOUT_ME = ' ' -AUTHOR = 'Андрей Астафьев' -SITENAME = 'ДСП' -SITEURL = 'https://dsp.246060.ru' - -PATH = 'wiki' -CACHE_PATH = 'cache-ascii' - -TIMEZONE = 'Europe/Moscow' - -DEFAULT_LANG = 'ru' - -# Generation time -CACHE_CONTENT = True -LOAD_CONTENT_CACHE = True - -# Feed generation is usually not desired when developing -FEED_ALL_ATOM = None -CATEGORY_FEED_ATOM = None -TRANSLATION_FEED_ATOM = None -AUTHOR_FEED_ATOM = None -AUTHOR_FEED_RSS = None -USE_FOLDER_AS_CATEGORY = True -DEFAULT_DATE = 'fs' -STATIC_PATHS = [ 'images', 'files', 'extras' ] - -EXTRA_PATH_METADATA = { - 'extras/favicon.ico': {'path': 'favicon.ico'}, -} - -DISPLAY_CATEGORIES_ON_MENU = False -DISPLAY_CATEGORIES_ON_SIDEBAR = True -DISPLAY_TAGS_ON_SIDEBAR = True - -THEME = 'themes/bootstrap4' -BOOTSTRAP_THEME = 'litera' - -I18N_TEMPLATES_LANG = 'ru' -I18N_GETTEXT_NEWSTYLE = True -I18N_GETTEXT_LOCALEDIR = 'themes/bootstrap4/translations' -I18N_GETTEXT_DOMAIN = 'messages' -JINJA_ENVIRONMENT = {'extensions': ['jinja2.ext.i18n']} - -PLUGIN_PATHS = ["plugins/official", "plugins/thirdparty"] -PLUGINS = [i18n(), "pelican-css", "pelidoc", "series", "subcategory", "tag_cloud", "tipue_search", "replacer", "asciidoctor"] - -PDF_PROCESSOR = True - -ASCIIDOCTOR_CMD = "asciidoctor" -ASCIIDOCTOR_IMAGES_PATH = '{}/wiki/images'.format(os.getcwd()) -ASCIIDOCTOR_EXTRA_OPTIONS = [ - '--require', 'asciidoctor-diagram', - '--attribute=imagesdir='+ASCIIDOCTOR_IMAGES_PATH, -] - -REPLACES = ( - ('{}/wiki/'.format(os.getcwd()), u''), -) - -YUICOMPRESSOR_EXECUTABLE = "yui-compressor" -YUICOMPRESSOR_EXTRA_OPTIONS = ["--nomunge"] -#PLUGINS += ["yuicompressor-opt"] - -DIRECT_TEMPLATES = ('index', 'categories', 'authors', 'archives', 'search') - -# Blogroll -LINKS = () -# LINKS = (('Pelican', 'http://getpelican.com/'), -# ('Python.org', 'http://python.org/'), -# ('Jinja2', 'http://jinja.pocoo.org/'), -# ('You can modify those links in your config file', '#'),) - -# Social widget -SOCIAL = () -# SOCIAL = (('You can add links in your config file', '#'), -# ('Another social link', '#'),) - -PYGMENTS_STYLE='pastie' - -DEFAULT_PAGINATION = 20 - -# Uncomment following line if you want document-relative URLs when developing -RELATIVE_URLS = True - diff --git a/pelicanconf-full.py b/pelicanconf-full.py index 5c7d830..c56317d 100644 --- a/pelicanconf-full.py +++ b/pelicanconf-full.py @@ -36,7 +36,7 @@ SITENAME = 'ДСП' SITEURL = 'https://dsp.246060.ru' PATH = 'wiki' -CACHE_PATH = 'cache-ascii' +CACHE_PATH = 'cache-full' TIMEZONE = 'Europe/Moscow' @@ -94,8 +94,8 @@ REPLACES = ( ('{}/wiki/'.format(os.getcwd()), u''), ) -#YUICOMPRESSOR_EXECUTABLE = "yui-compressor" -#YUICOMPRESSOR_EXTRA_OPTIONS = ["--nomunge"] +YUICOMPRESSOR_EXECUTABLE = "yui-compressor" +YUICOMPRESSOR_EXTRA_OPTIONS = ["--nomunge"] PLUGINS += ["yuicompressor-opt"] PDF_PROCESSOR = True diff --git a/pelicanconf.py b/pelicanconf.py index 241ad74..f785ead 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -36,7 +36,7 @@ SITENAME = 'ДСП' SITEURL = 'https://dsp.246060.ru' PATH = 'wiki' -CACHE_PATH = 'cache-ascii' +CACHE_PATH = 'cache' TIMEZONE = 'Europe/Moscow' @@ -87,6 +87,7 @@ ASCIIDOCTOR_EXTRA_OPTIONS = [ '--attribute=pygments-css=class', '--attribute=lang=ru', '--attribute=figure-caption=Рис.', + '--attribute=toc-title=Содержание', '--attribute=experimental', ] diff --git a/plugins/thirdparty/asciidoctor b/plugins/thirdparty/asciidoctor new file mode 160000 index 0000000..9e0019a --- /dev/null +++ b/plugins/thirdparty/asciidoctor @@ -0,0 +1 @@ +Subproject commit 9e0019a728113f8502d04eeca8bf2682219086b6