add pelican test output scripts

This commit is contained in:
Ryan Lercho 2018-04-09 16:16:14 -04:00
parent 1f129caf3e
commit 2a11671594
63 changed files with 16255 additions and 0 deletions

4
.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
*.pyc
pelican.pid
srv.pid
output/

11
README.md Normal file
View file

@ -0,0 +1,11 @@
# packaging docs
## Running the server for writing new articles
Running the pelican development server is useful when writing new articles. The steps to
get it running are:
1. Install pelican: `sudo dnf install pelican GitPython`
2. Check out the packagin docs source (from your fork or the main repo)
3. In the main folder of the checked out repo, run `./develop_server.sh start`
and your local copy of the Docs Fedora will be at http://localhost:8000/

103
develop_server.sh Executable file
View file

@ -0,0 +1,103 @@
#!/usr/bin/env bash
##
# This section should match your Makefile
##
PY=${PY:-python}
PELICAN=${PELICAN:-pelican}
PELICANOPTS=
BASEDIR=$(pwd)
INPUTDIR=$BASEDIR/content
OUTPUTDIR=$BASEDIR/output
CONFFILE=$BASEDIR/pelicanconf.py
###
# Don't change stuff below here unless you are sure
###
SRV_PID=$BASEDIR/srv.pid
PELICAN_PID=$BASEDIR/pelican.pid
function usage(){
echo "usage: $0 (stop) (start) (restart) [port]"
echo "This starts Pelican in debug and reload mode and then launches"
echo "an HTTP server to help site development. It doesn't read"
echo "your Pelican settings, so if you edit any paths in your Makefile"
echo "you will need to edit your settings as well."
exit 3
}
function alive() {
kill -0 $1 >/dev/null 2>&1
}
function shut_down(){
PID=$(cat $SRV_PID)
if [[ $? -eq 0 ]]; then
if alive $PID; then
echo "Stopping HTTP server"
kill $PID
else
echo "Stale PID, deleting"
fi
rm $SRV_PID
else
echo "HTTP server PIDFile not found"
fi
PID=$(cat $PELICAN_PID)
if [[ $? -eq 0 ]]; then
if alive $PID; then
echo "Killing Pelican"
kill $PID
else
echo "Stale PID, deleting"
fi
rm $PELICAN_PID
else
echo "Pelican PIDFile not found"
fi
}
function start_up(){
local port=$1
echo "Starting up Pelican and HTTP server"
shift
$PELICAN --debug --autoreload -r $INPUTDIR -o $OUTPUTDIR -s $CONFFILE $PELICANOPTS &
pelican_pid=$!
echo $pelican_pid > $PELICAN_PID
cd $OUTPUTDIR
$PY -m pelican.server $port &
srv_pid=$!
echo $srv_pid > $SRV_PID
cd $BASEDIR
sleep 1
if ! alive $pelican_pid ; then
echo "Pelican didn't start. Is the Pelican package installed?"
return 1
elif ! alive $srv_pid ; then
echo "The HTTP server didn't start. Is there another service using port" $port "?"
return 1
fi
echo 'Pelican and HTTP server processes now running in background.'
}
###
# MAIN
###
[[ ($# -eq 0) || ($# -gt 2) ]] && usage
port=''
[[ $# -eq 2 ]] && port=$2
if [[ $1 == "stop" ]]; then
shut_down
elif [[ $1 == "restart" ]]; then
shut_down
start_up $port
elif [[ $1 == "start" ]]; then
if ! start_up $port; then
shut_down
fi
else
usage
fi

46
pelicanconf.py Normal file
View file

@ -0,0 +1,46 @@
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = u'The Fedora Project'
SITENAME = u'Fedora Documentation'
SITEURL = 'https://docs.pagure.org/docs-fedora/'
PATH = 'content'
ARTICLE_EXCLUDES = ['modules']
TIMEZONE = 'Europe/Paris'
DEFAULT_LANG = u'en'
THEME = 'theme'
# 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
# Blogroll
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 = (('You can add links in your config file', '#'),
('Another social link', '#'),)
DEFAULT_PAGINATION = False
PLUGIN_PATHS = ['plugins']
PLUGINS = ['asciidoc_reader', 'filetime_from_git', 'tipue_search', 'related_posts']
STATIC_PATHS = ['images']
DIRECT_TEMPLATES = (('index', 'tags', 'categories', 'authors', 'archives', 'search', 'all_articles'))
PAGINATED_DIRECT_TEMPLATES = ['index', 'all_articles']
# Uncomment following line if you want document-relative URLs when developing
RELATIVE_URLS = True

View file

@ -0,0 +1,49 @@
AsciiDoc Reader
###############
This plugin allows you to use `AsciiDoc <http://www.methods.co.nz/asciidoc/>`_
to write your posts. File extension should be ``.asc``, ``.adoc``,
or ``.asciidoc``.
Dependency
----------
There are two command line utilities commonly used to render AsciiDoc:
``asciidoc`` and ``asciidoctor``. One of the two will need to be installed and
on the PATH.
**Note**: The ``asciidoctor`` utility is recommended since the original
``asciidoc`` is no longer maintained.
Settings
--------
======================================== =======================================================
Setting name (followed by default value) What does it do?
======================================== =======================================================
``ASCIIDOC_CMD = asciidoc`` Selects which utility to use for rendering. Will
autodetect utility if not provided.
``ASCIIDOC_OPTIONS = []`` A list of options to pass to AsciiDoc. See the `manpage
<http://www.methods.co.nz/asciidoc/manpage.html>`_.
======================================== =======================================================
Example file header
-------------------
Following the `example <https://github.com/getpelican/pelican/blob/master/docs/content.rst#file-metadata>`_ in the main pelican documentation:
.. code-block:: none
= My super title
:date: 2010-10-03 10:20
:modified: 2010-10-04 18:40
:tags: thats, awesome
:category: yeah
:slug: my-super-post
:authors: Alexis Metaireau, Conan Doyle
:summary: Short version for index and feeds
== title level 2
and so on...

View file

@ -0,0 +1 @@
from .asciidoc_reader import *

View file

@ -0,0 +1,89 @@
# -*- coding: utf-8 -*-
"""
AsciiDoc Reader
===============
This plugin allows you to use AsciiDoc to write your posts.
File extension should be ``.asc``, ``.adoc``, or ``asciidoc``.
"""
from pelican.readers import BaseReader
from pelican import signals
import os
import re
import subprocess
def call(cmd):
"""Calls a CLI command and returns the stdout as string."""
return subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True).communicate()[0].decode('utf-8')
def default():
"""Attempt to find the default AsciiDoc utility."""
for cmd in ALLOWED_CMDS:
if len(call(cmd + " --help")):
return cmd
ALLOWED_CMDS = ["asciidoc", "asciidoctor"]
ENABLED = None != default()
class AsciiDocReader(BaseReader):
"""Reader for AsciiDoc files."""
enabled = ENABLED
file_extensions = ['asc', 'adoc', 'asciidoc']
default_options = ['--no-header-footer']
def read(self, source_path):
"""Parse content and metadata of AsciiDoc files."""
cmd = self._get_cmd()
content = ""
if cmd:
optlist = self.settings.get('ASCIIDOC_OPTIONS', []) + self.default_options
options = " ".join(optlist)
content = call("%s %s -o - %s" % (cmd, options, source_path))
metadata = self._read_metadata(source_path)
return content, metadata
def _get_cmd(self):
"""Returns the AsciiDoc utility command to use for rendering or None if
one cannot be found."""
if self.settings.get('ASCIIDOC_CMD') in ALLOWED_CMDS:
return self.settings.get('ASCIIDOC_CMD')
return default()
def _read_metadata(self, source_path):
"""Parses the AsciiDoc file at the given `source_path` and returns found
metadata."""
metadata = {}
with open(source_path) as fi:
prev = ""
for line in fi.readlines():
# Parse for doc title.
if 'title' not in metadata.keys():
title = ""
if line.startswith("= "):
title = line[2:].strip()
elif line.count("=") == len(prev.strip()):
title = prev.strip()
if title:
metadata['title'] = self.process_metadata('title', title)
# Parse for other metadata.
regexp = re.compile(r"^:[A-z]+:\s*[A-z0-9]")
if regexp.search(line):
toks = line.split(":", 2)
key = toks[1].strip().lower()
val = toks[2].strip()
if key == 'tags' or key == 'fedoraversions':
val = val.split(',')
metadata[key] = self.process_metadata(key, val)
prev = line
return metadata
def add_reader(readers):
for ext in AsciiDocReader.file_extensions:
readers.reader_classes[ext] = AsciiDocReader
def register():
signals.readers_init.connect(add_reader)

View file

@ -0,0 +1,70 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import os
from pelican.readers import Readers
from pelican.tests.support import unittest, get_settings
from .asciidoc_reader import ENABLED
CUR_DIR = os.path.dirname(__file__)
CONTENT_PATH = os.path.join(CUR_DIR, 'test_data')
@unittest.skipUnless(ENABLED, "asciidoc isn't installed")
class AsciiDocReaderTest(unittest.TestCase):
def read_file(self, path, **kwargs):
# Isolate from future API changes to readers.read_file
r = Readers(settings=get_settings(**kwargs))
return r.read_file(base_path=CONTENT_PATH, path=path)
def test_article_with_asc_extension(self):
# Ensure the asc extension is being processed by the correct reader
page = self.read_file(
path='article_with_asc_extension.asc')
expected = ('<div class="sect1">'
'<h2 id="_used_for_pelican_test">'
'Used for pelican test</h2>'
'<div class="sectionbody">'
'<div class="paragraph">'
'<p>The quick brown fox jumped over '
'the lazy dog&#8217;s back.</p>'
'</div></div></div>')
actual = "".join(page.content.splitlines())
expected = "".join(expected.splitlines())
self.assertEqual(actual, expected)
expected = {
'category': 'Blog',
'author': 'Author O. Article',
'title': 'Test AsciiDoc File Header',
'date': datetime.datetime(2011, 9, 15, 9, 5),
'tags': ['Linux', 'Python', 'Pelican'],
}
for key, value in expected.items():
self.assertEqual(value, page.metadata[key], (
'Metadata attribute \'%s\' does not match expected value.\n'
'Expected: %s\n'
'Actual: %s') % (key, value, page.metadata[key]))
def test_article_with_asc_options(self):
# test to ensure the ASCIIDOC_OPTIONS is being used
page = self.read_file(path='article_with_asc_options.asc',
ASCIIDOC_OPTIONS=["-a revision=1.0.42"])
expected = ('<div class="sect1">'
'<h2 id="_used_for_pelican_test">'
'Used for pelican test</h2>'
'<div class="sectionbody">'
'<div class="paragraph">'
'<p>version 1.0.42</p></div>'
'<div class="paragraph">'
'<p>The quick brown fox jumped over '
'the lazy dog&#8217;s back.</p>'
'</div></div></div>')
actual = "".join(page.content.splitlines())
expected = "".join(expected.splitlines())
self.assertEqual(actual, expected)
if __name__ == '__main__':
unittest.main()

View file

@ -0,0 +1,11 @@
Test AsciiDoc File Header
=========================
:Author: Author O. Article
:Email: <author@nowhere.com>
:Date: 2011-09-15 09:05
:Category: Blog
:Tags: Linux, Python, Pelican
== Used for pelican test
The quick brown fox jumped over the lazy dog's back.

View file

@ -0,0 +1,7 @@
= Test AsciiDoc File Header
== Used for pelican test
version {revision}
The quick brown fox jumped over the lazy dog's back.

View file

@ -0,0 +1,22 @@
Category Metadata
-----------------
A plugin to read metadata for each category from an index file in that
category's directory.
For this plugin to work properly, your articles should not have a
Category: tag in their metadata; instead, they should be stored in
(subdirectories of) per-category directories. Each per-category
directory must have a file named 'index.ext' at its top level, where
.ext is any extension that will be picked up by an article reader.
The metadata of that article becomes the metadata for the category,
copied over verbatim, with three special cases:
* The category's name is set to the article's title.
* The category's slug is set to the name of the parent directory
of the index.ext file.
* The _text_ of the article is stored as category.description.
You can use this, for example, to control the slug used for each
category independently of its name, or to add a description at the top
of each category page.

View file

@ -0,0 +1 @@
from .category_meta import *

View file

@ -0,0 +1,130 @@
'''Copyright 2014, 2015 Zack Weinberg
Category Metadata
-----------------
A plugin to read metadata for each category from an index file in that
category's directory.
For this plugin to work properly, your articles should not have a
Category: tag in their metadata; instead, they should be stored in
(subdirectories of) per-category directories. Each per-category
directory must have a file named 'index.ext' at its top level, where
.ext is any extension that will be picked up by an article reader.
The metadata of that article becomes the metadata for the category,
copied over verbatim, with three special cases:
* The category's name is set to the article's title.
* The category's slug is set to the name of the parent directory
of the index.ext file.
* The _text_ of the article is stored as category.description.
'''
from pelican import signals
import os
import re
import logging
logger = logging.getLogger(__name__)
### CORE BUG: https://github.com/getpelican/pelican/issues/1547
### Content.url_format does not honor category.slug (or author.slug).
### The sanest way to work around this is to dynamically redefine each
### article's class to a subclass of itself with the bug fixed.
###
### Core was fixed in rev 822fb134e041c6938c253dd4db71813c4d0dc74a,
### which is not yet in any release, so we dynamically detect whether
### the installed version of Pelican still has the bug.
patched_subclasses = {}
def make_patched_subclass(klass):
if klass.__name__ not in patched_subclasses:
class PatchedContent(klass):
@property
def url_format(self):
metadata = super(PatchedContent, self).url_format
if hasattr(self, 'author'):
metadata['author'] = self.author.slug
if hasattr(self, 'category'):
metadata['category'] = self.category.slug
return metadata
# Code in core uses Content class names as keys for things.
PatchedContent.__name__ = klass.__name__
patched_subclasses[klass.__name__] = PatchedContent
return patched_subclasses[klass.__name__]
def patch_urlformat(cont):
# Test whether this content object needs to be patched.
md = cont.url_format
if ((hasattr(cont, 'author') and cont.author.slug != md['author']) or
(hasattr(cont, 'category') and cont.category.slug != md['category'])):
logger.debug("Detected bug 1547, applying workaround.")
cont.__class__ = make_patched_subclass(cont.__class__)
### END OF BUG WORKAROUND
def make_category(article, slug):
# Reuse the article's existing category object.
category = article.category
# Setting a category's name resets its slug, so do that first.
category.name = article.title
category.slug = slug
category.summary = article.summary
# Description from article text.
# XXX Relative URLs in the article content may not be handled correctly.
setattr(category, 'description', article.content)
# Metadata, to the extent that this makes sense.
for k, v in article.metadata.items():
if k not in ('path', 'slug', 'category', 'name', 'title',
'description', 'reader'):
setattr(category, k, v)
logger.debug("Category: %s -> %s", category.slug, category.name)
return category
def pretaxonomy_hook(generator):
"""This hook is invoked before the generator's .categories property is
filled in. Each article has already been assigned a category
object, but these objects are _not_ unique per category and so are
not safe to tack metadata onto (as is).
The category metadata we're looking for is represented as an
Article object, one per directory, whose filename is 'index.ext'.
"""
category_objects = {}
real_articles = []
for article in generator.articles:
dirname, fname = os.path.split(article.source_path)
fname, _ = os.path.splitext(fname)
if fname == 'index':
category_objects[dirname] = \
make_category(article, os.path.basename(dirname))
else:
real_articles.append(article)
category_assignment = \
re.compile("^(" +
"|".join(re.escape(prefix)
for prefix in category_objects.keys()) +
")/")
for article in real_articles:
m = category_assignment.match(article.source_path)
if not m or m.group(1) not in category_objects:
logger.error("No category assignment for %s (%s)",
article, article.source_path)
continue
article.category = category_objects[m.group(1)]
patch_urlformat(article)
generator.articles = real_articles
def register():
signals.article_generator_pretaxonomy.connect(pretaxonomy_hook)

View file

@ -0,0 +1,60 @@
Use Git commit to determine page date
======================================
If the blog content is managed by git repo, this plugin will set articles'
and pages' ``metadata['date']`` according to git commit. This plugin depends
on python package ``gitpython``, install::
pip install gitpython
The date is determined via the following logic:
* if a file is not tracked by Git, or a file is staged but never committed
- metadata['date'] = filesystem time
- metadata['modified'] = filesystem time
* if a file is tracked, but no changes in staging area or working directory
- metadata['date'] = first commit time
- metadata['modified'] = last commit time
* if a file is tracked, and has changes in stage area or working directory
- metadata['date'] = first commit time
- metadata['modified'] = filesystem time
When this module is enabled, ``date`` and ``modified`` will be determined
by Git status; no need to manually set in article/page metadata. And
operations like copy and move will not affect the generated results.
If you don't want a given article or page to use the Git time, set the
metadata to ``gittime: off`` to disable it.
Other options
-------------
### GIT_HISTORY_FOLLOWS_RENAME (default True)
You can also set GIT_HISTORY_FOLLOWS_RENAME to True in your pelican config to
make the plugin follow file renames i.e. ensure the creation date matches
the original file creation date, not the date is was renamed.
### GIT_GENERATE_PERMALINK (default False)
Use in combination with permalink plugin to generate permalinks using the original
commit sha
### GIT_SHA_METADATA (default True)
Adds sha of current and oldest commit to metadata
### GIT_FILETIME_FROM_GIT (default True)
Enable filetime from git behaviour
Content specific options
------------------------
Adding metadata `gittime` = False will prevent the plugin trying to setting filetime for this
content.
Adding metadata `git_permalink` = False will prevent the plugin from adding permalink for this
content.
FAQ
---
### Q. I get a GitCommandError: 'git rev-list ...' when I run the plugin. What's up?
Be sure to use the correct gitpython module for your distros git binary.
Using the GIT_HISTORY_FOLLOWS_RENAME option to True may also make your problem go away as it uses
a different method to find commits.

View file

@ -0,0 +1 @@
from .registration import *

View file

@ -0,0 +1,108 @@
# -*- coding: utf-8 -*-
import base64
import hashlib
import os
import logging
from pelican.utils import strftime
from .utils import string_to_bool
from .utils import datetime_from_timestamp
from .registration import content_git_object_init
logger = logging.getLogger(__name__)
@content_git_object_init.connect
def filetime_from_git(content, git_content):
'''
Update modification and creation times from git
'''
if not content.settings['GIT_FILETIME_FROM_GIT']:
# Disabled for everything
return
if not string_to_bool(content.metadata.get('gittime', 'yes')):
# Disable for this content
return
path = content.source_path
fs_creation_time = datetime_from_timestamp(os.stat(path).st_ctime, content)
fs_modified_time = datetime_from_timestamp(os.stat(path).st_mtime, content)
# 1. file is not managed by git
# date: fs time
# 2. file is staged, but has no commits
# date: fs time
# 3. file is managed, and clean
# date: first commit time, update: last commit time or None
# 4. file is managed, but dirty
# date: first commit time, update: fs time
if git_content.is_managed_by_git():
if git_content.is_committed():
content.date = git_content.get_oldest_commit_date()
if git_content.is_modified():
content.modified = fs_modified_time
else:
content.modified = git_content.get_newest_commit_date()
else:
# File isn't committed
content.date = fs_creation_time
else:
# file is not managed by git
content.date = fs_creation_time
# Clean up content attributes
if not hasattr(content, 'modified'):
content.modified = content.date
if hasattr(content, 'date'):
content.locale_date = strftime(content.date, content.date_format)
if hasattr(content, 'modified'):
content.locale_modified = strftime(
content.modified, content.date_format)
@content_git_object_init.connect
def git_sha_metadata(content, git_content):
'''
Add sha metadata to content
'''
if not content.settings['GIT_SHA_METADATA']:
return
if not git_content.is_committed():
return
content.metadata['gitsha_newest'] = str(git_content.get_newest_commit())
content.metadata['gitsha_oldest'] = str(git_content.get_oldest_commit())
@content_git_object_init.connect
def git_permalink(content, git_content):
'''
Add git based permalink id to content metadata
'''
if not content.settings['GIT_GENERATE_PERMALINK']:
return
if not string_to_bool(content.metadata.get('git_permalink', 'yes')):
# Disable for this content
return
if not git_content.is_committed():
return
permalink_hash = hashlib.sha1()
permalink_hash.update(str(git_content.get_oldest_commit()))
permalink_hash.update(str(git_content.get_oldest_filename()))
git_permalink_id = base64.urlsafe_b64encode(permalink_hash.digest())
permalink_id_metadata_key = content.settings['PERMALINK_ID_METADATA_KEY']
if permalink_id_metadata_key in content.metadata:
content.metadata[permalink_id_metadata_key] = (
','.join((
content.metadata[permalink_id_metadata_key], git_permalink_id)))
else:
content.metadata[permalink_id_metadata_key] = git_permalink_id

View file

@ -0,0 +1,99 @@
# -*- coding: utf-8 -*-
"""
Wraps a content object to provide some git information
"""
import logging
from pelican.utils import memoized
from .git_wrapper import git_wrapper
DEV_LOGGER = logging.getLogger(__name__)
class GitContentAdapter(object):
"""
Wraps a content object to provide some git information
"""
def __init__(self, content):
self.content = content
self.git = git_wrapper('.')
self.tz_name = content.settings.get('TIMEZONE', None)
self.follow = content.settings['GIT_HISTORY_FOLLOWS_RENAME']
@memoized
def is_committed(self):
'''
Is committed
'''
return len(self.get_commits()) > 0
@memoized
def is_modified(self):
'''
Has content been modified since last commit
'''
return self.git.is_file_modified(self.content.source_path)
@memoized
def is_managed_by_git(self):
'''
Is content stored in a file managed by git
'''
return self.git.is_file_managed_by_git(self.content.source_path)
@memoized
def get_commits(self):
'''
Get all commits involving this filename
:returns: List of commits newest to oldest
'''
if not self.is_managed_by_git():
return []
return self.git.get_commits(self.content.source_path, self.follow)
@memoized
def get_oldest_commit(self):
'''
Get oldest commit involving this file
:returns: Oldest commit
'''
return self.git.get_commits(self.content.source_path, self.follow)[-1]
@memoized
def get_newest_commit(self):
'''
Get oldest commit involving this file
:returns: Newest commit
'''
return self.git.get_commits(self.content.source_path, follow=False)[0]
@memoized
def get_oldest_filename(self):
'''
Get the original filename of this content. Implies follow
'''
commit_and_name_iter = self.git.get_commits_and_names_iter(
self.content.source_path)
_commit, name = commit_and_name_iter.next()
return name
@memoized
def get_oldest_commit_date(self):
'''
Get datetime of oldest commit involving this file
:returns: Datetime of oldest commit
'''
oldest_commit = self.get_oldest_commit()
return self.git.get_commit_date(oldest_commit, self.tz_name)
@memoized
def get_newest_commit_date(self):
'''
Get datetime of newest commit involving this file
:returns: Datetime of newest commit
'''
newest_commit = self.get_newest_commit()
return self.git.get_commit_date(newest_commit, self.tz_name)

View file

@ -0,0 +1,162 @@
# -*- coding: utf-8 -*-
"""
Wrap python git interface for compatibility with older/newer version
"""
try:
from itertools import zip_longest
except ImportError:
from six.moves import zip_longest
import logging
import os
from time import mktime
from datetime import datetime
from pelican.utils import set_date_tzinfo
from git import Git, Repo
DEV_LOGGER = logging.getLogger(__name__)
def grouper(iterable, n, fillvalue=None):
'''
Collect data into fixed-length chunks or blocks
'''
# grouper('ABCDEFG', 3, 'x') --> ABC DEF Gxx
args = [iter(iterable)] * n
return zip_longest(fillvalue=fillvalue, *args)
class _GitWrapperCommon(object):
'''
Wrap git module to provide a more stable interface across versions
'''
def __init__(self, repo_path):
self.git = Git()
self.repo = Repo(os.path.abspath('.'))
def is_file_managed_by_git(self, path):
'''
:param path: Path to check
:returns: True if path is managed by git
'''
status, _stdout, _stderr = self.git.execute(
['git', 'ls-files', path, '--error-unmatch'],
with_extended_output=True,
with_exceptions=False)
return status == 0
def is_file_modified(self, path):
'''
Does a file have local changes not yet committed
:returns: True if file has local changes
'''
status, _stdout, _stderr = self.git.execute(
['git', 'diff', '--quiet', 'HEAD', path],
with_extended_output=True,
with_exceptions=False)
return status != 0
def get_commits_following(self, path):
'''
Get all commits including path following the file through
renames
:param path: Path which we will find commits for
:returns: Sequence of commit objects. Newest to oldest
'''
return [
commit for commit, _ in self.get_commits_and_names_iter(
path)]
def get_commits_and_names_iter(self, path):
'''
Get all commits including a given path following renames
'''
log_result = self.git.log(
'--pretty=%H',
'--follow',
'--name-only',
'--',
path).splitlines()
for commit_sha, _, filename in grouper(log_result, 3):
yield self.repo.commit(commit_sha), filename
def get_commits(self, path, follow=False):
'''
Get all commits including path
:param path: Path which we will find commits for
:param bool follow: If True we will follow path through renames
:returns: Sequence of commit objects. Newest to oldest
'''
if follow:
return self.get_commits_following(path)
else:
return self._get_commits(path)
class _GitWrapperLegacy(_GitWrapperCommon):
def _get_commits(self, path):
'''
Get all commits including path without following renames
:param path: Path which we will find commits for
:returns: Sequence of commit objects. Newest to oldest
'''
return self.repo.commits(path=path)
@staticmethod
def get_commit_date(commit, tz_name):
'''
Get datetime of commit comitted_date
'''
return set_date_tzinfo(
datetime.fromtimestamp(mktime(commit.committed_date)),
tz_name=tz_name)
class _GitWrapper(_GitWrapperCommon):
def _get_commits(self, path):
'''
Get all commits including path without following renames
:param path: Path which we will find commits for
:returns: Sequence of commit objects. Newest to oldest
.. NOTE ::
If this fails it could be that your gitpython version is out of sync with the git
binary on your distro. Make sure you use the correct gitpython version.
Alternatively enabling GIT_FILETIME_FOLLOW may also make your problem go away.
'''
return list(self.repo.iter_commits(paths=path))
@staticmethod
def get_commit_date(commit, tz_name):
'''
Get datetime of commit comitted_date
'''
return set_date_tzinfo(
datetime.fromtimestamp(commit.committed_date),
tz_name=tz_name)
_wrapper_cache = {}
def git_wrapper(path):
'''
Get appropriate wrapper factory and cache instance for path
'''
path = os.path.abspath(path)
if path not in _wrapper_cache:
if hasattr(Repo, 'commits'):
_wrapper_cache[path] = _GitWrapperLegacy(path)
else:
_wrapper_cache[path] = _GitWrapper(path)
return _wrapper_cache[path]

View file

@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
"""
Handle registration and setup for plugin
"""
import logging
from blinker import signal
from .content_adapter import GitContentAdapter
from pelican import signals
DEV_LOGGER = logging.getLogger(__name__)
content_git_object_init = signal('content_git_object_init')
def send_content_git_object_init(content):
content_git_object_init.send(content, git_content=GitContentAdapter(content))
def setup_option_defaults(pelican_inst):
pelican_inst.settings.setdefault('GIT_FILETIME_FROM_GIT', True)
pelican_inst.settings.setdefault('GIT_HISTORY_FOLLOWS_RENAME', True)
pelican_inst.settings.setdefault('GIT_SHA_METADATA', True)
pelican_inst.settings.setdefault('GIT_GENERATE_PERMALINK', False)
def register():
signals.content_object_init.connect(send_content_git_object_init)
signals.initialized.connect(setup_option_defaults)
# Import actions
from . import actions

View file

@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
"""
Utility functions
"""
from datetime import datetime
import logging
from pelican.utils import set_date_tzinfo
DEV_LOGGER = logging.getLogger(__name__)
STRING_BOOLS = {
'yes': True,
'no': False,
'true': True,
'false': False,
'0': False,
'1': True,
'on': True,
'off': False,
}
def string_to_bool(string):
'''
Convert a string to a bool based
'''
return STRING_BOOLS[string.strip().lower()]
def datetime_from_timestamp(timestamp, content):
"""
Helper function to add timezone information to datetime,
so that datetime is comparable to other datetime objects in recent versions
that now also have timezone information.
"""
return set_date_tzinfo(
datetime.fromtimestamp(timestamp),
tz_name=content.settings.get('TIMEZONE', None))

View file

@ -0,0 +1,34 @@
Related posts
-------------
This plugin adds the ``related_posts`` variable to the article's context.
By default, up to 5 articles are listed. You can customize this value by
defining ``RELATED_POSTS_MAX`` in your settings file::
RELATED_POSTS_MAX = 10
You can then use the ``article.related_posts`` variable in your templates.
For example::
{% if article.related_posts %}
<ul>
{% for related_post in article.related_posts %}
<li><a href="{{ SITEURL }}/{{ related_post.url }}">{{ related_post.title }}</a></li>
{% endfor %}
</ul>
{% endif %}
Your related posts should share a common tag. You can also use ``related_posts:`` in your post's meta data.
The 'related_posts:' meta data works together with your existing slugs::
related_posts: slug1, slug2, slug3, ... slugN
``N`` represents the ``RELATED_POSTS_MAX``.
Additionally, you can specify::
RELATED_POSTS_SKIP_SAME_CATEGORY = True
in your settings file. With this setting, ``article.related_posts`` will
contain only related posts from categories other than the original article's.

View file

@ -0,0 +1 @@
from .related_posts import *

View file

@ -0,0 +1,56 @@
"""
Related posts plugin for Pelican
================================
Adds related_posts variable to article's context
"""
from pelican import signals
from collections import Counter
from itertools import chain
def add_related_posts(generator):
# get the max number of entries from settings
# or fall back to default (5)
numentries = generator.settings.get('RELATED_POSTS_MAX', 5)
# Skip all posts in the same category as the article
skipcategory = generator.settings.get('RELATED_POSTS_SKIP_SAME_CATEGORY', False)
for article in chain(generator.articles, generator.drafts):
# set priority in case of forced related posts
if hasattr(article,'related_posts'):
# split slugs
related_posts = article.related_posts.split(',')
posts = []
# get related articles
for slug in related_posts:
i = 0
slug = slug.strip()
for a in generator.articles:
if i >= numentries: # break in case there are max related psots
break
if a.slug == slug:
posts.append(a)
i += 1
article.related_posts = posts
else:
# no tag, no relation
if not hasattr(article, 'tags'):
continue
# score = number of common tags
related = chain(*(generator.tags[tag] for tag in article.tags))
if skipcategory:
related = (other for other in related
if other.category != article.category)
scores = Counter(related)
# remove itself
scores.pop(article, None)
article.related_posts = [other for other, count
in scores.most_common(numentries)]
def register():
signals.article_generator_finalized.connect(add_related_posts)

View file

@ -0,0 +1,67 @@
Tipue Search
============
A Pelican plugin to serialize generated HTML to JSON that can be used by jQuery plugin - Tipue Search.
Copyright (c) Talha Mansoor
Author | Talha Mansoor
----------------|-----
Author Email | talha131@gmail.com
Author Homepage | http://onCrashReboot.com
Github Account | https://github.com/talha131
Why do you need it?
===================
Static sites do not offer search feature out of the box. [Tipue Search](http://www.tipue.com/search/)
is a jQuery plugin that search the static site without using any third party service, like DuckDuckGo or Google.
Tipue Search offers 4 search modes. Its [JSON search mode](http://www.tipue.com/search/docs/json/) is the best search mode
especially for large sites.
Tipue's JSON search mode requires the textual content of site in JSON format.
Requirements
============
Tipue Search requires BeautifulSoup.
```bash
pip install beautifulsoup4
```
How Tipue Search works
=========================
Tipue Search serializes the generated HTML into JSON. Format of JSON is as follows
```python
{
"pages": [
{
"text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero.",
"tags": "Example Category",
"url" : "http://oncrashreboot.com/plugin-example.html",
"title": "Everything you want to know about Lorem Ipsum"
},
{
"text": "Sed dignissim lacinia nunc. Curabitur tortor. Pellentesque nibh. Aenean quam. In scelerisque sem at dolor. Maecenas mattis. Sed convallis tristique sem. Proin ut ligula vel nunc egestas porttitor. Morbi lectus risus, iaculis vel, suscipit quis, luctus non, massa. Fusce ac turpis quis ligula lacinia aliquet. Mauris ipsum. Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh.",
"tags": "Example Category",
"url" : "http://oncrashreboot.com/plugin-example-2.html",
"title": "Review of the book Lorem Ipsum"
}
]
}
```
JSON is written to file `tipuesearch_content.json` which is created in the root of `output` directory.
How to use
==========
To utilize JSON Search mode, your theme needs to have Tipue Search properly configured in it. [Official documentation](http://www.tipue.com/search/docs/#json) has the required details.
Pelican [Elegant Theme](https://github.com/talha131/pelican-elegant) and [Plumage
theme](https://github.com/kdeldycke/plumage) have Tipue Search configured. You can view their
code to understand the configuration.

View file

@ -0,0 +1 @@
from .tipue_search import *

View file

@ -0,0 +1,114 @@
# -*- coding: utf-8 -*-
"""
Tipue Search
============
A Pelican plugin to serialize generated HTML to JSON
that can be used by jQuery plugin - Tipue Search.
Copyright (c) Talha Mansoor
"""
from __future__ import unicode_literals
import os.path
import json
from bs4 import BeautifulSoup
from codecs import open
try:
from urlparse import urljoin
except ImportError:
from urllib.parse import urljoin
from pelican import signals
class Tipue_Search_JSON_Generator(object):
def __init__(self, context, settings, path, theme, output_path, *null):
self.output_path = output_path
self.context = context
self.siteurl = settings.get('SITEURL')
self.tpages = settings.get('TEMPLATE_PAGES')
self.output_path = output_path
self.json_nodes = []
def create_json_node(self, page):
if getattr(page, 'status', 'published') != 'published':
return
soup_title = BeautifulSoup(page.title.replace('&nbsp;', ' '), 'html.parser')
page_title = soup_title.get_text(' ', strip=True).replace('', '"').replace('', '"').replace('', "'").replace('^', '&#94;')
soup_text = BeautifulSoup(page.content, 'html.parser')
page_text = soup_text.get_text(' ', strip=True).replace('', '"').replace('', '"').replace('', "'").replace('', ' ').replace('^', '&#94;')
page_text = ' '.join(page_text.split())
if getattr(page, 'category', 'None') == 'None':
page_category = ''
else:
page_category = page.category.name
page_url = self.siteurl + '/' + page.url
node = {'title': page_title,
'text': page_text,
'tags': page_category,
'url': page_url}
self.json_nodes.append(node)
def create_tpage_node(self, srclink):
srcfile = open(os.path.join(self.output_path, self.tpages[srclink]), encoding='utf-8')
soup = BeautifulSoup(srcfile, 'html.parser')
page_text = soup.get_text()
# What happens if there is not a title.
if soup.title is not None:
page_title = soup.title.string
else:
page_title = ''
# Should set default category?
page_category = ''
page_url = urljoin(self.siteurl, self.tpages[srclink])
node = {'title': page_title,
'text': page_text,
'tags': page_category,
'url': page_url}
self.json_nodes.append(node)
def generate_output(self, writer):
path = os.path.join(self.output_path, 'tipuesearch_content.json')
pages = self.context['pages'] + self.context['articles']
for article in self.context['articles']:
pages += article.translations
for srclink in self.tpages:
self.create_tpage_node(srclink)
for page in pages:
self.create_json_node(page)
root_node = {'pages': self.json_nodes}
with open(path, 'w', encoding='utf-8') as fd:
json.dump(root_node, fd, separators=(',', ':'), ensure_ascii=False)
def get_generators(generators):
return Tipue_Search_JSON_Generator
def register():
signals.get_generators.connect(get_generators)

24
publishconf.py Normal file
View file

@ -0,0 +1,24 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
SITEURL = ''
RELATIVE_URLS = False
FEED_ALL_ATOM = 'feeds/all.atom.xml'
CATEGORY_FEED_ATOM = 'feeds/%s.atom.xml'
DELETE_OUTPUT_DIRECTORY = True
# Following items are often useful when publishing
#DISQUS_SITENAME = ""
#GOOGLE_ANALYTICS = ""

View file

@ -0,0 +1,590 @@
@import url(https://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css);
/* ------------------------------------------------------------
Image: "Spin" https://www.flickr.com/photos/eflon/3655695161/
Author: eflon https://www.flickr.com/photos/eflon/
License: https://creativecommons.org/licenses/by/2.0/
---------------------------------------------------------------*/
.attribution {
text-align: center;
position: relative;
bottom: -20px;
}
.attribution .btn {
color: #808080;
color: rgba(175,175,175, .65);
font-size: 11px;
}
.attribution .btn:hover {
text-decoration: none;
color: #aaa;
}
.popover-content {
font-size: 12px;
line-height: 1.3;
font-weight: normal;
}
@media screen and (max-width: 980px) {
body {
margin-bottom: 200px;
}
footer {
text-align: center;
}
footer .text-right {
text-align: center !important;
}
#footer_social .first {
margin-left: 0;
}
#footer_social > a {
top: 24px;
}
}
.fa-inverse:hover {
color: #ccc;
}
.collapse a.active {
background-color: #DEEAF4;
color: #000;
position: relative;
}
.collapse a.active:hover {
text-decoration: none;
}
.collapse a.active:before {
background-color: #A0C3E5;
content: "";
display: inline-block;
height: 100%;
left: 0;
position: absolute;
top: 0;
width: 3px;
}
.main h2, .main .h2 {
border-top: 0px;
padding-top: 10px;
font-size: 28px;
}
.page-header .img-responsive {
display: inline;
}
.docs-content h1,
.docs-content h2,
.docs-content h3,
.docs-content h4,
.docs-content h5,
.docs-content h6
{
font-weight: bold;
color: #444;
}
.docs-content h1{
font-size: 1.5rem
}
.docs-content h2{
font-size: 1.3rem
}
.docs-content h3{
font-size: 1.1rem
}
.docs-content h4,
.docs-content h5,
.docs-content h6{
font-size: 1rem;
}
.docs-content .page-header h1 {
line-height: 1.5rem;
padding-bottom: 0.2em;
margin-bottom: 0.7em;
border-bottom: 1px solid #ccc;
}
nav .breadcrumb{
background: none;
font-size:0.8em;
padding-left:10px;
padding-bottom:0px;
}
.nav > li > a.hover{
background-color: none;
}
.breadcrumb-item + .breadcrumb-item::before{
content: '\f054';
font-family: FontAwesome;
font-size: 0.8em;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
position: relative;
}
h2 > a.anchor, h3 > a.anchor, h4 > a.anchor, h5 > a.anchor, h6 > a.anchor {
display: block;
font-weight: normal;
margin-left: -1.5ex;
position: absolute;
text-align: center;
text-decoration: none !important;
visibility: hidden;
width: 1.5ex;
z-index: 1001;
}
h2 > a.anchor:before, h3 > a.anchor:before, h4 > a.anchor:before, h5 > a.anchor:before, h6 > a.anchor:before {
content: "\f0c1";
display: block;
font-family: FontAwesome;
font-size: 0.7em;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
padding-top: 0.2em;
}
h4 > a.anchor:before, h5 > a.anchor:before, h6 > a.anchor:before {
font-size: 1em;
}
h2:hover > a.anchor,
h2 > a.anchor:hover,
h3:hover > a.anchor,
h3 > a.anchor:hover,
h4:hover > a.anchor,
h4 > a.anchor:hover,
h5:hover > a.anchor,
h5 > a.anchor:hover,
h6:hover > a.anchor,
h6 > a.anchor:hover {
visibility: visible;
}
.main {
border-left: 1px solid #e7e7e7;
margin-left: -1px;
padding-left: 25px;
}
@media (min-width: 768px) {
.main {
padding-left: 30px;
}
}
.masthead, .footer{
position: relative;
z-index: 1;
}
.footer a{
color:#aaa
}
.footer{
font-size:0.8em;
}
.footer h3{
font-size:1.3em;
font-weight: bold;
text-transform: uppercase;
}
/*
* Sidebar
*/
.docs-sidebar{
background: #eee;
box-shadow: -3000px 0 0 3000px #eee;
}
.nav-header {
font-size: 16px;
}
.nav-header ul {
font-size: 14px;
padding-left:1em;
}
.nav-header ul li a {
display: block;
padding: 3px 0px 4px 7px;
font-size: 13px;
font-weight: normal;
}
.nav-sidebar .fa {
text-align: center;
top: -1px;
width: 14px;
}
.docs-sidebar li a {
color: #555;
}
.nav-sidebar li a:hover {
color: #000;
}
.nav-sidebar ul li ul.nav-tertiary li a {
padding-left: 50px;
}
.nav-sidebar > li > a {
padding: 7px 0;
}
.nav-sidebar > li > a:focus, .nav-sidebar > li > a:hover {
background: transparent;
}
.sidebar {
font-weight: 300;
display: none;
padding-top: 13px;
}
@media screen and (max-width: 767px) {
.sidebar {
padding-left: 30px;
padding-right: 0;
}
}
@media screen and (min-width: 768px) {
.sidebar {
border-right: 1px solid #e7e7e7;
display: block;
}
}
/* Remnants of Asciidoctor default stylesheet - remove styles as needed */
#map_canvas img, #map_canvas embed, #map_canvas object, .map_canvas img, .map_canvas embed, .map_canvas object { max-width: none !important; }
.left { float: left !important; }
.right { float: right !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }
.text-justify { text-align: justify !important; }
.hide { display: none; }
.subheader, #content #toctitle, .admonitionblock td.content > .title, .audioblock > .title, .exampleblock > .title, .imageblock > .title, .listingblock > .title, .literalblock > .title, .stemblock > .title, .openblock > .title, .paragraph > .title, .quoteblock > .title, table.tableblock > .title, .verseblock > .title, .videoblock > .title, .dlist > .title, .olist > .title, .ulist > .title, .qlist > .title, .hdlist > .title { line-height: 1.4; color: #7a2518; font-weight: 300; margin-top: 0.2em; margin-bottom: 0.5em; }
abbr, acronym { text-transform: uppercase; font-size: 90%; color: #333333; border-bottom: 1px dotted #dddddd; cursor: help; }
abbr { text-transform: none; }
blockquote { margin: 0 0 1.25em; padding: 0.5625em 1.25em 0 1.1875em; border-left: 3px solid #487c58; }
blockquote cite { display: block; font-size: inherit; color: #454545; }
blockquote cite:before { content: "\2014 \0020"; }
blockquote cite a, blockquote cite a:visited { color: #454545; }
blockquote, blockquote p { line-height: 1.6; color: #6e6e6e; }
@media only screen and (min-width: 768px) {
#toctitle, .sidebarblock > .content > .title { line-height: 1.4; }
#toctitle, .sidebarblock > .content > .title { font-size: 1.6875em; }
}
table { background: white; margin-bottom: 1.25em; border: solid 1px #dddddd; }
table thead, table tfoot { background: whitesmoke; font-weight: bold; }
table thead tr th, table thead tr td, table tfoot tr th, table tfoot tr td { padding: 0.5em 0.625em 0.625em; font-size: inherit; color: #333333; text-align: left; }
table tr th, table tr td { padding: 0.5625em 0.625em; font-size: inherit; color: #333333; }
table tr.even, table tr.alt, table tr:nth-of-type(even) { background: #f9f9f9; }
table thead tr th, table tfoot tr th, table tbody tr td, table tr td, table tfoot tr td { display: table-cell; line-height: 1.6; }
.clearfix:before, .clearfix:after, .float-group:before, .float-group:after { content: " "; display: table; }
.clearfix:after, .float-group:after { clear: both; }
*:not(pre) > code { font-size: inherit; padding: 0; white-space: nowrap; background-color: inherit; border: 0 solid #dddddd; -webkit-border-radius: 4px; border-radius: 4px; text-shadow: none; line-height: 1; }
.keyseq { color: #666666; }
kbd:not(.keyseq) { display: inline-block; color: #333333; font-size: 0.75em; line-height: 1.4; background-color: #f7f7f7; border: 1px solid #ccc; -webkit-border-radius: 3px; border-radius: 3px; -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 0 0 2px white inset; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 0 0 2px white inset; margin: -0.15em 0.15em 0 0.15em; padding: 0.2em 0.6em 0.2em 0.5em; vertical-align: middle; white-space: nowrap; }
.keyseq kbd:first-child { margin-left: 0; }
.keyseq kbd:last-child { margin-right: 0; }
.menuseq, .menu { color: #1a1a1a; }
b.button:before, b.button:after { position: relative; top: -1px; font-weight: normal; }
b.button:before { content: "["; padding: 0 3px 0 2px; }
b.button:after { content: "]"; padding: 0 2px 0 3px; }
p a > code:hover { color: #561309; }
#header, #content, #footnotes, #footer { width: 100%; margin-left: auto; margin-right: auto; margin-top: 0; margin-bottom: 0; max-width: 62.5em; *zoom: 1; position: relative; padding-left: 0.9375em; padding-right: 0.9375em; }
#header:before, #header:after, #content:before, #content:after, #footnotes:before, #footnotes:after, #footer:before, #footer:after { content: " "; display: table; }
#header:after, #content:after, #footnotes:after, #footer:after { clear: both; }
#content:before { content: none; }
#header { margin-bottom: 2.5em; }
#header > h1 { color: black; font-weight: 300; border-bottom: 1px solid #d8d8d8; margin-bottom: -28px; padding-bottom: 32px; }
#header span { color: #6e6e6e; }
#header #revnumber { text-transform: capitalize; }
#header br { display: none; }
#header br + span { padding-left: 3px; }
#header br + span:before { content: "\2013 \0020"; }
#header br + span.author { padding-left: 0; }
#header br + span.author:before { content: ", "; }
#toc { border-bottom: 3px double #e5e5e5; padding-top: 1em; padding-bottom: 1.25em; }
#toc > ul { margin-left: 0.25em; }
#toc ul.sectlevel0 > li > a { font-style: italic; }
#toc ul.sectlevel0 ul.sectlevel1 { margin-left: 0; margin-top: 0.5em; margin-bottom: 0.5em; }
#toc ul { font-family: "Open Sans", "DejaVu Sans", "Sans", sans-serif; list-style-type: none; }
#toc a { text-decoration: none; }
#toc a:active { text-decoration: underline; }
#toctitle { color: #7a2518; }
@media only screen and (min-width: 768px) { body.toc2 { padding-left: 15em; padding-right: 0; }
#toc.toc2 { background-color: #fafaf9; position: fixed; width: 15em; left: 0; top: 0; border-right: 1px solid #e5e5e5; border-bottom: 0; z-index: 1000; padding: 1.25em 1em; height: 100%; overflow: auto; }
#toc.toc2 #toctitle { margin-top: 0; font-size: 1.2em; }
#toc.toc2 > ul { font-size: .90em; margin-bottom: 0; }
#toc.toc2 ul ul { margin-left: 0; padding-left: 1em; }
#toc.toc2 ul.sectlevel0 ul.sectlevel1 { padding-left: 0; margin-top: 0.5em; margin-bottom: 0.5em; }
body.toc2.toc-right { padding-left: 0; padding-right: 15em; }
body.toc2.toc-right #toc.toc2 { border-right: 0; border-left: 1px solid #e5e5e5; left: auto; right: 0; } }
@media only screen and (min-width: 1280px) { body.toc2 { padding-left: 20em; padding-right: 0; }
#toc.toc2 { width: 20em; }
#toc.toc2 #toctitle { font-size: 1.375em; }
#toc.toc2 > ul { font-size: 0.95em; }
#toc.toc2 ul ul { padding-left: 1.25em; }
body.toc2.toc-right { padding-left: 0; padding-right: 20em; } }
#content #toc { border-style: solid; border-width: 1px; border-color: #e3e3dd; margin-bottom: 1.25em; padding: 1.25em; background: #fafaf9; border-width: 0; -webkit-border-radius: 4px; border-radius: 4px; }
#content #toc > :first-child { margin-top: 0; }
#content #toc > :last-child { margin-bottom: 0; }
#content #toctitle { font-size: 1.375em; }
#footer { max-width: 100%; background-color: #333333; padding: 1.25em; }
#footer-text { color: #cccccc; line-height: 1.44; }
.audioblock, .imageblock, .literalblock, .listingblock, .stemblock, .verseblock, .videoblock { margin-bottom: 2.5em; }
.admonitionblock td.content > .title, .audioblock > .title, .exampleblock > .title, .imageblock > .title, .listingblock > .title, .literalblock > .title, .stemblock > .title, .openblock > .title, .paragraph > .title, .quoteblock > .title, table.tableblock > .title, .verseblock > .title, .videoblock > .title, .dlist > .title, .olist > .title, .ulist > .title, .qlist > .title, .hdlist > .title { text-rendering: optimizeLegibility; text-align: left; font-family: "Noto Serif", "DejaVu Serif", "Serif", serif; font-weight: normal; font-style: italic; }
table.tableblock > caption.title { white-space: nowrap; overflow: visible; max-width: 0; }
table.tableblock #preamble > .sectionbody > .paragraph:first-of-type p { font-size: inherit; }
.admonitionblock > table { border: 0; background: none; width: 100%; }
.admonitionblock > table td.icon { text-align: center; width: 80px; }
.admonitionblock > table td.icon img { max-width: none; }
.admonitionblock > table td.icon .title { font-weight: 300; text-transform: uppercase; }
.admonitionblock > table td.content { padding-left: 0; padding-right: 1.25em; color: #6e6e6e; }
.admonitionblock > table td.content > :last-child > :last-child { margin-bottom: 0; }
.exampleblock > .content { border-style: solid; border-width: 1px; border-color: #e6e6e6; margin-bottom: 1.25em; padding: 1.25em; background: white; -webkit-border-radius: 4px; border-radius: 4px; }
.exampleblock > .content > :first-child { margin-top: 0; }
.exampleblock > .content > :last-child { margin-bottom: 0; }
.exampleblock > .content h1, .exampleblock > .content h2, .exampleblock > .content h3, .exampleblock > .content #toctitle, .sidebarblock.exampleblock > .content > .title, .exampleblock > .content h4, .exampleblock > .content h5, .exampleblock > .content h6, .exampleblock > .content p { color: #333333; }
.exampleblock > .content h1, .exampleblock > .content h2, .exampleblock > .content h3, .exampleblock > .content #toctitle, .sidebarblock.exampleblock > .content > .title, .exampleblock > .content h4, .exampleblock > .content h5, .exampleblock > .content h6 { line-height: 1; margin-bottom: 0.625em; }
.exampleblock > .content h1.subheader, .exampleblock > .content h2.subheader, .exampleblock > .content h3.subheader, .exampleblock > .content .subheader#toctitle, .sidebarblock.exampleblock > .content > .subheader.title, .exampleblock > .content h4.subheader, .exampleblock > .content h5.subheader, .exampleblock > .content h6.subheader { line-height: 1.4; }
.exampleblock.result > .content { -webkit-box-shadow: 0 1px 8px #e3e3dd; box-shadow: 0 1px 8px #e3e3dd; }
.sidebarblock { border-style: solid; border-width: 1px; border-color: #e3e3dd; margin-top: -1.0em; margin-bottom: 1.6em; margin-left: 1em; padding: .5em; background: #F1F3F5; -webkit-border-radius: 4px; border-radius: 4px; overflow-x: auto; float: right; width: 40%; }
.sidebarblock > :first-child { margin-top: 0; }
.sidebarblock > :last-child { margin-bottom: 0; }
.sidebarblock h1, .sidebarblock h2, .sidebarblock h3, .sidebarblock #toctitle, .sidebarblock > .content > .title, .sidebarblock h4, .sidebarblock h5, .sidebarblock h6, .sidebarblock p { color: #333333; }
.sidebarblock h1, .sidebarblock h2, .sidebarblock h3, .sidebarblock #toctitle, .sidebarblock > .content > .title, .sidebarblock h4, .sidebarblock h5, .sidebarblock h6 { line-height: 1; margin-bottom: 0.625em; }
.sidebarblock h1.subheader, .sidebarblock h2.subheader, .sidebarblock h3.subheader, .sidebarblock .subheader#toctitle, .sidebarblock > .content > .subheader.title, .sidebarblock h4.subheader, .sidebarblock h5.subheader, .sidebarblock h6.subheader { line-height: 1.4; }
.sidebarblock > .content > .title { color: inherit; font-size: 28px; font-weight: 500; margin-top: 0; line-height: 1.6; }
.width50 { width: 50% ! important}
.exampleblock > .content > :last-child > :last-child, .exampleblock > .content .olist > ol > li:last-child > :last-child, .exampleblock > .content .ulist > ul > li:last-child > :last-child, .exampleblock > .content .qlist > ol > li:last-child > :last-child, .sidebarblock > .content > :last-child > :last-child, .sidebarblock > .content .olist > ol > li:last-child > :last-child, .sidebarblock > .content .ulist > ul > li:last-child > :last-child, .sidebarblock > .content .qlist > ol > li:last-child > :last-child { margin-bottom: 0; }
.literalblock pre, .literalblock pre[class], .listingblock pre, .listingblock pre[class] { border: 0px; background-color: #F0F3F5; -webkit-border-radius: 5px; border-radius: 5px; padding: 1.5em 2.5em; word-wrap: break-word; }
.literalblock pre.nowrap, .literalblock pre[class].nowrap, .listingblock pre.nowrap, .listingblock pre[class].nowrap { overflow-x: auto; white-space: pre; word-wrap: normal; }
.literalblock pre > code, .literalblock pre[class] > code, .listingblock pre > code, .listingblock pre[class] > code { display: block; }
.listingblock > .content { position: relative; }
.listingblock:hover code[class*=" language-"]:before { text-transform: uppercase; font-size: 0.9em; color: #999; position: absolute; top: 0.375em; right: 0.375em; }
.listingblock:hover code.asciidoc:before { content: "asciidoc"; }
.listingblock:hover code.clojure:before { content: "clojure"; }
.listingblock:hover code.css:before { content: "css"; }
.listingblock:hover code.go:before { content: "go"; }
.listingblock:hover code.groovy:before { content: "groovy"; }
.listingblock:hover code.html:before { content: "html"; }
.listingblock:hover code.java:before { content: "java"; }
.listingblock:hover code.javascript:before { content: "javascript"; }
.listingblock:hover code.python:before { content: "python"; }
.listingblock:hover code.ruby:before { content: "ruby"; }
.listingblock:hover code.sass:before { content: "sass"; }
.listingblock:hover code.scss:before { content: "scss"; }
.listingblock:hover code.xml:before { content: "xml"; }
.listingblock:hover code.yaml:before { content: "yaml"; }
.listingblock.terminal pre .command:before { content: attr(data-prompt); padding-right: 0.5em; color: #999; }
.listingblock.terminal pre .command:not([data-prompt]):before { content: '$'; }
table.pyhltable { border: 0; margin-bottom: 0; }
table.pyhltable td { vertical-align: top; padding-top: 0; padding-bottom: 0; }
table.pyhltable td.code { padding-left: .75em; padding-right: 0; }
.highlight.pygments .lineno, table.pyhltable td:not(.code) { color: #999; padding-left: 0; padding-right: .5em; border-right: 1px solid #d8d8d8; }
.highlight.pygments .lineno { display: inline-block; margin-right: .25em; }
table.pyhltable .linenodiv { background-color: transparent !important; padding-right: 0 !important; }
.quoteblock { margin: 0 0 1.25em 0; padding: 0.5625em 1.25em 0 1.1875em; border-left: 3px solid #487c58; }
.quoteblock blockquote { margin: 0 0 1.25em 0; padding: 0 0 0.625em 0; border: 0; }
.quoteblock blockquote > .paragraph:last-child p { margin-bottom: 0; }
.quoteblock .attribution { margin-top: -0.625em; padding-bottom: 0.625em; font-size: inherit; color: #454545; line-height: 1.6; }
.quoteblock .attribution br { display: none; }
.quoteblock .attribution cite { display: block; }
table.tableblock { max-width: 100%; }
table.tableblock td .paragraph:last-child p > p:last-child, table.tableblock th > p:last-child, table.tableblock td > p:last-child { margin-bottom: 0; }
table.spread { width: 100%; }
table.tableblock, th.tableblock, td.tableblock { border: 0 solid #dddddd; }
table.grid-all th.tableblock, table.grid-all td.tableblock { border-width: 0 1px 1px 0; }
table.grid-all tfoot > tr > th.tableblock, table.grid-all tfoot > tr > td.tableblock { border-width: 1px 1px 0 0; }
table.grid-cols th.tableblock, table.grid-cols td.tableblock { border-width: 0 1px 0 0; }
table.grid-all * > tr > .tableblock:last-child, table.grid-cols * > tr > .tableblock:last-child { border-right-width: 0; }
table.grid-rows th.tableblock, table.grid-rows td.tableblock { border-width: 0 0 1px 0; }
table.grid-all tbody > tr:last-child > th.tableblock, table.grid-all tbody > tr:last-child > td.tableblock, table.grid-all thead:last-child > tr > th.tableblock, table.grid-rows tbody > tr:last-child > th.tableblock, table.grid-rows tbody > tr:last-child > td.tableblock, table.grid-rows thead:last-child > tr > th.tableblock { border-bottom-width: 0; }
table.grid-rows tfoot > tr > th.tableblock, table.grid-rows tfoot > tr > td.tableblock { border-width: 1px 0 0 0; }
table.frame-all { border-width: 1px; }
table.frame-sides { border-width: 0 1px; }
table.frame-topbot { border-width: 1px 0; }
th.halign-left, td.halign-left { text-align: left; }
th.halign-right, td.halign-right { text-align: right; }
th.halign-center, td.halign-center { text-align: center; }
th.valign-top, td.valign-top { vertical-align: top; }
th.valign-bottom, td.valign-bottom { vertical-align: bottom; }
th.valign-middle, td.valign-middle { vertical-align: middle; }
table thead th, table tfoot th { font-weight: bold; }
tbody tr th { display: table-cell; line-height: 1.6; background: whitesmoke; }
tbody tr th, tbody tr th p, tfoot tr th, tfoot tr th p { color: #333333; font-weight: bold; }
td > div.verse { white-space: pre; }
ul.unstyled, ol.unnumbered, ul.checklist, ul.none { list-style-type: none; }
ul.unstyled, ol.unnumbered, ul.checklist { margin-left: 0.625em; }
ul.checklist li > p:first-child > .fa-check-square-o:first-child, ul.checklist li > p:first-child > input[type="checkbox"]:first-child { margin-right: 0.25em; }
ul.checklist li > p:first-child > input[type="checkbox"]:first-child { position: relative; top: 1px; }
ul.inline { margin: 0 auto 0.625em auto; margin-left: -1.375em; margin-right: 0; padding: 0; list-style: none; overflow: hidden; }
ul.inline > li { list-style: none; float: left; margin-left: 1.375em; display: block; }
ul.inline > li > * { display: block; }
.unstyled dl dt { font-weight: normal; font-style: normal; }
ol.arabic { list-style-type: decimal; }
ol.decimal { list-style-type: decimal-leading-zero; }
ol.loweralpha { list-style-type: lower-alpha; }
ol.upperalpha { list-style-type: upper-alpha; }
ol.lowerroman { list-style-type: lower-roman; }
ol.upperroman { list-style-type: upper-roman; }
ol.lowergreek { list-style-type: lower-greek; }
.hdlist > table, .colist > table { border: 0; background: none; }
.hdlist > table > tbody > tr, .colist > table > tbody > tr { background: none; }
td.hdlist1 { padding-right: .75em; font-weight: bold; }
td.hdlist1, td.hdlist2 { vertical-align: top; }
.literalblock + .colist, .listingblock + .colist { margin-top: -0.5em; }
.colist > table tr > td:first-of-type { padding: 0 .75em; line-height: 1; }
.colist > table tr > td:last-of-type { padding: 0.25em 0; }
.qanda > ol > li > p > em:only-child { color: #1d4b8f; }
.thumb, .th { line-height: 0; display: inline-block; border: solid 4px white; -webkit-box-shadow: 0 0 0 1px #dddddd; box-shadow: 0 0 0 1px #dddddd; }
.imageblock.left, .imageblock[style*="float: left"] { margin: 0.25em 0.625em 1.25em 0; }
.imageblock.right, .imageblock[style*="float: right"] { margin: 0.25em 0 1.25em 0.625em; }
.imageblock > .title { margin-bottom: 0; }
.imageblock.thumb, .imageblock.th { border-width: 6px; }
.imageblock.thumb > .title, .imageblock.th > .title { padding: 0 0.125em; }
.image.left, .image.right { margin-top: 0.25em; margin-bottom: 0.25em; display: inline-block; line-height: 0; }
.image.left { margin-right: 0.625em; }
.image.right { margin-left: 0.625em; }
a.image { text-decoration: none; }
span.footnote, span.footnoteref { vertical-align: super; font-size: 0.875em; }
span.footnote a, span.footnoteref a { text-decoration: none; }
span.footnote a:active, span.footnoteref a:active { text-decoration: underline; }
#footnotes { padding-top: 0.75em; padding-bottom: 0.75em; margin-bottom: 0.625em; }
#footnotes hr { width: 20%; min-width: 6.25em; margin: -.25em 0 .75em 0; border-width: 1px 0 0 0; }
#footnotes .footnote { padding: 0 0.375em; line-height: 1.3; font-size: 0.875em; margin-left: 1.2em; text-indent: -1.2em; margin-bottom: .2em; }
#footnotes .footnote a:first-of-type { font-weight: bold; text-decoration: none; }
#footnotes .footnote:last-of-type { margin-bottom: 0; }
#content #footnotes { margin-top: -0.625em; margin-bottom: 0; padding: 0.75em 0; }
.gist .file-data > table { border: none; background: #fff; width: 100%; margin-bottom: 0; }
.gist .file-data > table td.line-data { width: 99%; }
div.unbreakable { page-break-inside: avoid; }
.replaceable { font-style: italic; font-color: inherit; font-family: inherit; }
.parameter { font-style: italic; font-family: monospace; }
.userinput { font-weight: bold; font-family: monospace; }
.envar { font-weight: bold; font-family: monospace; font-size: 90%; }
.sysitem { font-weight: bold; font-size: 90%; }
.package { font-weight: bold; font-size: 90%; }
.filename { font-weight: bold; font-style: italic; font-size: 90%; }
.big { font-size: larger; }
.small { font-size: smaller; }
.underline { text-decoration: underline; }
.overline { text-decoration: overline; }
.line-through { text-decoration: line-through; }
.aqua { color: #00bfbf; }
.aqua-background { background-color: #00fafa; }
.black { color: black; }
.black-background { background-color: black; }
.blue { color: #0000bf; }
.blue-background { background-color: #0000fa; }
.fuchsia { color: #bf00bf; }
.fuchsia-background { background-color: #fa00fa; }
.gray { color: #606060; }
.gray-background { background-color: #7d7d7d; }
.green { color: #006000; }
.green-background { background-color: #007d00; }
.lime { color: #00bf00; }
.lime-background { background-color: #00fa00; }
.maroon { color: #600000; }
.maroon-background { background-color: #7d0000; }
.navy { color: #000060; }
.navy-background { background-color: #00007d; }
.olive { color: #606000; }
.olive-background { background-color: #7d7d00; }
.purple { color: #600060; }
.purple-background { background-color: #7d007d; }
.red { color: #bf0000; }
.red-background { background-color: #fa0000; }
.silver { color: #909090; }
.silver-background { background-color: #bcbcbc; }
.teal { color: #006060; }
.teal-background { background-color: #007d7d; }
.white { color: #bfbfbf; }
.white-background { background-color: #fafafa; }
.yellow { color: #bfbf00; }
.yellow-background { background-color: #fafa00; }
span.icon > .fa { cursor: default; }
.admonitionblock td.icon [class^="fa icon-"] { font-size: 2.5em; cursor: default; }
.admonitionblock td.icon .icon-note:before { content: "\f05a"; color: #4E9FDD; }
.admonitionblock td.icon .icon-tip:before { content: "\f0eb"; color: #2C8596; }
.admonitionblock td.icon .icon-warning:before { content: "\f071"; color: #ec7a08; }
.admonitionblock td.icon .icon-caution:before { content: "\f06d"; color: #ec7a08; }
.admonitionblock td.icon .icon-important:before { content: "\f06a"; color: #c00; }
.conum[data-value] { display: inline-block; color: white !important; background-color: #333333; -webkit-border-radius: 100px; border-radius: 100px; text-align: center; width: 20px; height: 20px; font-size: 12px; line-height: 20px; font-family: "Open Sans", "Sans", sans-serif; font-style: normal; font-weight: bold; text-indent: -1px; }
.conum[data-value] * { color: white !important; }
.conum[data-value] + b { display: none; }
.conum[data-value]:after { content: attr(data-value); }
pre .conum[data-value] { position: relative; top: -2px; }
b.conum * { color: inherit !important; }
.conum:not([data-value]):empty { display: none; }
.print-only { display: none !important; }
@media print { @page { margin: 1.25cm 0.75cm; }
* { -webkit-box-shadow: none !important; box-shadow: none !important; text-shadow: none !important; }
a, a:visited { color: inherit !important; text-decoration: underline !important; }
a[href^="http:"]:after, a[href^="https:"]:after { content: " (" attr(href) ")"; }
a[href^="#"], a[href^="#"]:visited, a[href^="mailto:"], a[href^="mailto:"]:visited { text-decoration: none !important; }
abbr[title]:after { content: " (" attr(title) ")"; }
pre, blockquote { page-break-inside: avoid; }
code { color: #191919; }
thead { display: table-header-group; }
tr, img { page-break-inside: avoid; }
img { max-width: 100% !important; }
p { orphans: 3; widows: 3; }
h2, h3, #toctitle, .sidebarblock > .content > .title, #toctitle, .sidebarblock > .content > .title { page-break-after: avoid; }
#toc, .sidebarblock { background: none !important; }
#toc { border-bottom: 1px solid #d8d8d8 !important; padding-bottom: 0 !important; }
.sect1 { padding-bottom: 0 !important; }
.sect1 + .sect1 { border: none !important; }
body.book #header { text-align: center; }
body.book #header > h1 { border: none !important; margin: 2.5em 0 1em 0; padding: 0; }
body.book #header span { line-height: 1.6; }
body.book #header br { display: block; }
body.book #header br + span { padding-left: 0; }
body.book #header br + span:before { content: none !important; }
body.book #toc { border: none !important; text-align: left !important; padding: 0 !important; }
#footer { background: none !important; }
#footer-text { color: #333333 !important; }
.hide-on-print { display: none !important; }
.print-only { display: block !important; }
.hide-for-print { display: none !important; }
.show-for-print { display: inherit !important; } }
.corner-ribbon{
width: 16em;
background: #3c6eb4 ;
position: absolute;
top: 3em;
right: -4em;
text-align: center;
line-height: 5ex;
color: #dedede;
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
z-index: 999;
}
.corner-ribbon a { color: #FFFFFF; }

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

View file

@ -0,0 +1,133 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="53mm"
height="10.58333mm"
viewBox="0 0 53 10.58333"
id="svg2"
version="1.1"
inkscape:version="0.92.0 r"
sodipodi:docname="docs-fedora-logo.svg"
inkscape:export-filename="/home/rlerch/Source/docs-fedora/theme/static/docs-fedora-logo.png"
inkscape:export-xdpi="192.00006"
inkscape:export-ydpi="192.00006">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="2.8284272"
inkscape:cx="161.60848"
inkscape:cy="-3.2019881"
inkscape:document-units="mm"
inkscape:current-layer="g4624"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1920"
inkscape:window-height="1136"
inkscape:window-x="1920"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:snap-bbox="true"
inkscape:bbox-nodes="true"
inkscape:snap-page="true"
inkscape:snap-global="false" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-48.767028,-31.073165)">
<g
id="g4595"
transform="matrix(0.45619308,0,0,0.45619308,26.519847,-9.145808)">
<g
id="g4624"
transform="matrix(0.92003825,0,0,0.92003825,3.8994993,8.9046582)">
<text
id="text4225"
y="106.6515"
x="48.655697"
style="font-style:normal;font-weight:normal;font-size:11.49793434px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#555753;fill-opacity:1;stroke:none;stroke-width:0.34780943px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Montserrat;-inkscape-font-specification:Montserrat;fill:#555753;fill-opacity:1;stroke-width:0.34780943px"
y="106.6515"
x="48.655697"
id="tspan4227"
sodipodi:role="line">DOCUMENTATION</tspan></text>
<g
transform="matrix(0.1527149,0,0,0.1527149,49.003427,86.308841)"
id="g4488">
<g
transform="translate(-266.55899,-345.34488)"
id="layer1-0">
<path
inkscape:connector-curvature="0"
d="m 316.7736,397.581 c 0,0 0,0 -20.53889,0 0.3327,4.45245 3.92157,7.77609 8.70715,7.77609 3.38983,0 6.31456,-1.39616 8.64094,-3.65507 0.46553,-0.46679 0.99726,-0.59962 1.59519,-0.59962 0.79781,0 1.59561,0.39932 2.12692,1.06388 0.3327,0.46553 0.53216,0.99726 0.53216,1.52857 0,0.73118 -0.3327,1.52857 -0.93106,2.12734 -2.7919,2.99052 -7.51086,4.98503 -12.16403,4.98503 -8.44149,0 -15.22074,-6.77967 -15.22074,-15.22158 0,-8.44149 6.58022,-15.22074 15.02171,-15.22074 8.37529,0 14.62323,6.51317 14.62323,15.08749 0,1.26418 -1.12924,2.12861 -2.39258,2.12861 z m -12.23065,-11.76512 c -4.45329,0 -7.51085,2.92473 -8.17499,7.17731 10.03626,0 16.35083,0 16.35083,0 -0.59836,-4.05355 -3.78874,-7.17731 -8.17584,-7.17731 z"
id="path11"
style="fill:#3c6eb4" />
<path
inkscape:connector-curvature="0"
d="m 375.46344,410.80807 c -8.44106,0 -15.22074,-6.77968 -15.22074,-15.22159 0,-8.44149 6.77968,-15.22074 15.22074,-15.22074 8.44234,0 15.22159,6.77925 15.22159,15.22074 -4.2e-4,8.44149 -6.77968,15.22159 -15.22159,15.22159 z m 0,-24.65992 c -5.31688,0 -8.77377,4.25427 -8.77377,9.43833 0,5.18364 3.45689,9.43833 8.77377,9.43833 5.31731,0 8.77504,-4.25469 8.77504,-9.43833 -4.2e-4,-5.18406 -3.45773,-9.43833 -8.77504,-9.43833 z"
id="path13"
style="fill:#3c6eb4" />
<path
inkscape:connector-curvature="0"
d="m 412.66183,380.36574 c -4.45963,0 -7.40966,1.319 -10.01391,4.62956 l -0.24036,-1.53995 v 0 c -0.20198,-1.60743 -1.57326,-2.84926 -3.23382,-2.84926 -1.80139,0 -3.26206,1.459 -3.26206,3.26081 0,0.003 0,0.005 0,0.008 v 0 0.003 0 23.40712 c 0,1.79464 1.46194,3.25743 3.257,3.25743 1.79465,0 3.25744,-1.46279 3.25744,-3.25743 v -12.56209 c 0,-5.71621 4.98502,-8.57432 10.23613,-8.57432 1.59519,0 2.85726,-1.32953 2.85726,-2.92515 0,-1.59561 -1.26207,-2.85726 -2.85768,-2.85726 z"
id="path15"
style="fill:#3c6eb4" />
<path
inkscape:connector-curvature="0"
d="m 447.02614,395.58648 c 0.0666,-8.17541 -5.78326,-15.22074 -15.222,-15.22074 -8.44192,0 -15.28779,6.77925 -15.28779,15.22074 0,8.44191 6.64684,15.22159 14.68985,15.22159 4.01434,0 7.62682,-2.06621 9.23846,-4.22518 l 0.79359,2.01434 v 0 c 0.42589,1.13177 1.5176,1.93717 2.7978,1.93717 1.65001,0 2.98756,-1.33671 2.99009,-2.98545 v 0 -7.80687 0 z m -15.222,9.43833 c -5.31773,0 -8.77419,-4.25469 -8.77419,-9.43833 0,-5.18406 3.45604,-9.43833 8.77419,-9.43833 5.3173,0 8.77419,4.25427 8.77419,9.43833 0,5.18364 -3.45689,9.43833 -8.77419,9.43833 z"
id="path17"
style="fill:#3c6eb4" />
<path
inkscape:connector-curvature="0"
d="m 355.01479,368.3337 c 0,-1.7938 -1.46194,-3.18997 -3.25659,-3.18997 -1.79422,0 -3.25743,1.39659 -3.25743,3.18997 v 17.1499 c -1.66097,-3.05756 -5.25026,-5.11786 -9.50495,-5.11786 -8.64052,0 -14.42336,6.51318 -14.42336,15.22074 0,8.70757 5.98229,15.22159 14.42336,15.22159 3.76555,0 7.03057,-1.55429 8.98587,-4.25554 l 0.72317,1.83428 c 0.44782,1.25912 1.64917,2.16024 3.06051,2.16024 1.78621,0 3.24984,-1.45435 3.24984,-3.24815 0,-0.005 0,-0.009 0,-0.0139 v 0 -38.95128 h -4.2e-4 z m -15.22116,36.69111 c -5.31731,0 -8.70715,-4.25469 -8.70715,-9.43833 0,-5.18406 3.38984,-9.43833 8.70715,-9.43833 5.31773,0 8.70714,4.0544 8.70714,9.43833 0,5.38309 -3.38941,9.43833 -8.70714,9.43833 z"
id="path19"
style="fill:#3c6eb4" />
<path
inkscape:connector-curvature="0"
d="m 287.21553,365.34023 c -0.59414,-0.0877 -1.19966,-0.13198 -1.80097,-0.13198 -6.73118,0 -12.20746,5.4767 -12.20746,12.20788 v 3.8132 h -3.98903 c -1.46237,0 -2.65908,1.19671 -2.65908,2.65781 0,1.46321 1.19671,2.93738 2.65908,2.93738 h 3.98819 v 20.46004 c 0,1.79464 1.46236,3.25743 3.25658,3.25743 1.79507,0 3.25744,-1.46279 3.25744,-3.25743 v -20.46004 h 4.40986 c 1.46194,0 2.65823,-1.47417 2.65823,-2.93738 0,-1.46152 -1.19629,-2.65823 -2.65823,-2.65823 h -4.40733 v -3.8132 c 0,-3.13852 2.55323,-6.11469 5.69175,-6.11469 0.28294,0 0.56757,0.0211 0.84672,0.062 1.78031,0.26355 3.4358,-0.54269 3.70019,-2.32342 0.2627,-1.77904 -0.96606,-3.43538 -2.74594,-3.69935 z"
id="path21"
style="fill:#3c6eb4" />
</g>
<path
inkscape:connector-curvature="0"
d="m 181.98344,61.675273 h 2.81558 v 0.37898 h -1.18152 v 2.94935 h -0.45254 v -2.94935 h -1.18152 v -0.37898 m 3.26144,0 h 0.67101 l 0.84937,2.26496 0.85381,-2.26496 h 0.67102 v 3.32833 h -0.43917 v -2.9226 l -0.85828,2.28279 h -0.45255 l -0.85827,-2.28279 v 2.9226 h -0.43694 v -3.32833"
id="path2391"
style="fill:#294172;enable-background:new" />
</g>
<g
id="g5902"
transform="translate(0,4.7546837)" />
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 8 KiB

View file

@ -0,0 +1,115 @@
.tipue_search_content_title{
margin-top:1em;
}
.tipue_search_content_url{
display:none;
}
.tipue_search_content_text{
font-size:0.8em;
}
.tipue_search_content_bold{
font-weight:bold;
background-color: #4fcafa
}
.entry-content img {max-width:100%;}
.entry-content h1 {font-size:1.3em; font-weight: bold;}
.bodycontent-sidebar{
background: linear-gradient(90deg, #FFF 50%, #EEE 50%);
}
.bodycontent, .left-pane{
min-height:500px;
}
.badge-sidebar{
width:100%;
font-size:1em;
margin-top:0.3em;
text-align:left;
}
.badge-tagfilter{
font-size:0.9em;
margin:0.1em;
}
.badge-default{
color: #666;
}
.badge{
padding: 0.5em;
}
.sidebar{
font-size:0.8em;
}
.header-sidebar{
font-weight:bold;
color:#555;
}
.notblue, .entry-title a{
color:inherit;
}
.entry-title{
font-weight:bold;
}
.tagsort-active{
background-color: #5cb85c;
color: white;
}
.tagsort-tag{
cursor:pointer;
}
.footer a{
color:#aaa
}
.footer{
font-size:0.8em;
}
.footer h3{
font-size:1.3em;
font-weight: bold;
text-transform: uppercase;
}
nav .breadcrumb{
background: none;
font-size:0.8em;
padding-left:10px;
padding-bottom:0px;
}
.nav > li > a.hover{
background-color: none;
}
.breadcrumb-item + .breadcrumb-item::before{
content: '\f054';
font-family: FontAwesome;
font-size: 0.8em;
color: #868e96;
}
.qd-toc li{
line-height:1em;
padding-top: 0.6em;
}
.qd-toc li a{
color:#444;
font-weight: 400;
}

BIN
theme/static/docs_logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

6
theme/static/fedora-bootstrap.min.css vendored Normal file

File diff suppressed because one or more lines are too long

8
theme/static/fedora-bootstrap.min.js vendored Normal file

File diff suppressed because one or more lines are too long

205
theme/static/pygment.css Normal file
View file

@ -0,0 +1,205 @@
.hll {
background-color:#eee;
}
.c {
color:#408090;
font-style:italic;
}
.err {
border:1px solid #FF0000;
}
.k {
color:#007020;
font-weight:bold;
}
.o {
color:#666666;
}
.cm {
color:#408090;
font-style:italic;
}
.cp {
color:#007020;
}
.c1 {
color:#408090;
font-style:italic;
}
.cs {
background-color:#FFF0F0;
color:#408090;
}
.gd {
color:#A00000;
}
.ge {
font-style:italic;
}
.gr {
color:#FF0000;
}
.gh {
color:#000080;
font-weight:bold;
}
.gi {
color:#00A000;
}
.go {
color:#303030;
}
.gp {
color:#C65D09;
font-weight:bold;
}
.gs {
font-weight:bold;
}
.gu {
color:#800080;
font-weight:bold;
}
.gt {
color:#0040D0;
}
.kc {
color:#007020;
font-weight:bold;
}
.kd {
color:#007020;
font-weight:bold;
}
.kn {
color:#007020;
font-weight:bold;
}
.kp {
color:#007020;
}
.kr {
color:#007020;
font-weight:bold;
}
.kt {
color:#902000;
}
.m {
color:#208050;
}
.s {
color:#4070A0;
}
.na {
color:#4070A0;
}
.nb {
color:#007020;
}
.nc {
color:#0E84B5;
font-weight:bold;
}
.no {
color:#60ADD5;
}
.nd {
color:#555555;
font-weight:bold;
}
.ni {
color:#D55537;
font-weight:bold;
}
.ne {
color:#007020;
}
.nf {
color:#06287E;
}
.nl {
color:#002070;
font-weight:bold;
}
.nn {
color:#0E84B5;
font-weight:bold;
}
.nt {
color:#062873;
font-weight:bold;
}
.nv {
color:#BB60D5;
}
.ow {
color:#007020;
font-weight:bold;
}
.w {
color:#BBBBBB;
}
.mf {
color:#208050;
}
.mh {
color:#208050;
}
.mi {
color:#208050;
}
.mo {
color:#208050;
}
.sb {
color:#4070A0;
}
.sc {
color:#4070A0;
}
.sd {
color:#4070A0;
font-style:italic;
}
.s2 {
color:#4070A0;
}
.se {
color:#4070A0;
font-weight:bold;
}
.sh {
color:#4070A0;
}
.si {
color:#70A0D0;
font-style:italic;
}
.sx {
color:#C65D09;
}
.sr {
color:#235388;
}
.s1 {
color:#4070A0;
}
.ss {
color:#517918;
}
.bp {
color:#007020;
}
.vc {
color:#BB60D5;
}
.vg {
color:#BB60D5;
}
.vi {
color:#BB60D5;
}
.il {
color:#208050;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

1
theme/static/tagsort.min.js vendored Normal file
View file

@ -0,0 +1 @@
!function(e){e.fn.tagSort=function(t){var s={items:".item-tagsort",tagElement:"span",tagClassPrefix:!1,itemTagsView:!1,itemTagsSeperator:" ",itemTagsElement:!1,sortType:"exclusive",fadeTime:0,reset:!1};t=e.extend(s,t);var i={generateTags:function(s){var a={},n={pointers:[],tags:[]},o=e(document.createElement(t.tagElement));return s.each(function(s){$element=e(this);var r=$element.data("item-tags"),c=r.match(/,\s+/)?r.split(", "):r.split(",");e.each(c,function(n,r){var c=r.toLowerCase();a[c]||(a[c]=[],i.container.append(t.tagClassPrefix!==!1?o.clone().text(r).addClass((t.tagClassPrefix+r.toLowerCase()).replace(/[!\"#$%&'\(\)\*\+,\.\/:;<=>\?\@\[\\\]\^`\{\|\}~]/g,"")):o.clone().text(r))),t.itemTagsView!==!1&&(t.itemTagsElement!==!1?$element.find(t.itemTagsView).append(e(document.createElement(t.itemTagsElement)).clone().text(r)):$element.find(t.itemTagsView).append(n>0?t.itemTagsSeperator+r:r)),a[c].push(s)}),"exclusive"==t.sortType&&(n.pointers.push(s),n.tags.push(c))}),"inclusive"==t.sortType||"single"==t.sortType?a:"exclusive"==t.sortType?n:void 0},exclusiveSort:function(t){var s=[[],[]];return e.each(t.pointers,function(a,n){var o=!0;i.container.find(".tagsort-active").each(function(i){-1==t.tags[a].indexOf(e(this).text())&&(o=!1,s[0].push(n))}),1==o&&s[1].push(n)}),s},inclusiveSort:function(t,s){var a=[s,[]];return i.container.find(".tagsort-active").each(function(s){e.each(t[e(this).text().toLowerCase()],function(e,t){a[0].splice(a[0].indexOf(t),1),a[1].push(t)})}),a},showElements:function(s,i){e.each(s,function(e,s){i.eq(s).fadeIn(t.fadeTime)})},hideElements:function(s,i){e.each(s,function(e,s){i.eq(s).fadeOut(t.fadeTime)})},inititalize:function(s){i.container=s;for(var a,n=e(t.items),o=[],r=t.reset,c=0;c<n.length;c++)o.push(c);i.tags=i.generateTags(n,i.container);var l=i.container.find(t.tagElement);l.click(function(){"single"==t.sortType?e(this).hasClass("tagsort-active")?e(this).toggleClass("tagsort-active"):(e(".tagsort-active").removeClass("tagsort-active"),e(this).toggleClass("tagsort-active"),a=i.inclusiveSort(i.tags,o.slice())):(e(this).toggleClass("tagsort-active"),a="inclusive"==t.sortType?i.inclusiveSort(i.tags,o.slice()):i.exclusiveSort(i.tags)),l.hasClass("tagsort-active")||(a=[[],o.slice()]),a[0].length>0&&i.hideElements(a[0],n),a[1].length>0&&i.showElements(a[1],n)}),r&&e(r).click(function(){e(".tagsort-active").removeClass("tagsort-active"),a=[[],o.slice()],i.showElements(a[1],n)})}};return i.inititalize(this),e(this)}}(jQuery);

View file

@ -0,0 +1,461 @@
/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */
/**
* 1. Change the default font family in all browsers (opinionated).
* 2. Correct the line height in all browsers.
* 3. Prevent adjustments of font size after orientation changes in
* IE on Windows Phone and in iOS.
*/
/* Document
========================================================================== */
html {
font-family: sans-serif; /* 1 */
line-height: 1.15; /* 2 */
-ms-text-size-adjust: 100%; /* 3 */
-webkit-text-size-adjust: 100%; /* 3 */
}
/* Sections
========================================================================== */
/**
* Remove the margin in all browsers (opinionated).
*/
body {
margin: 0;
}
/**
* Add the correct display in IE 9-.
*/
article,
aside,
footer,
header,
nav,
section {
display: block;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/* Grouping content
========================================================================== */
/**
* Add the correct display in IE 9-.
* 1. Add the correct display in IE.
*/
figcaption,
figure,
main { /* 1 */
display: block;
}
/**
* Add the correct margin in IE 8.
*/
figure {
margin: 1em 40px;
}
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box; /* 1 */
height: 0; /* 1 */
overflow: visible; /* 2 */
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/* Text-level semantics
========================================================================== */
/**
* 1. Remove the gray background on active links in IE 10.
* 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
*/
a {
background-color: transparent; /* 1 */
-webkit-text-decoration-skip: objects; /* 2 */
}
/**
* Remove the outline on focused links when they are also active or hovered
* in all browsers (opinionated).
*/
a:active,
a:hover {
outline-width: 0;
}
/**
* 1. Remove the bottom border in Firefox 39-.
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none; /* 1 */
text-decoration: underline; /* 2 */
text-decoration: underline dotted; /* 2 */
}
/**
* Prevent the duplicate application of `bolder` by the next rule in Safari 6.
*/
b,
strong {
font-weight: inherit;
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/**
* Add the correct font style in Android 4.3-.
*/
dfn {
font-style: italic;
}
/**
* Add the correct background and color in IE 9-.
*/
mark {
background-color: #ff0;
color: #000;
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* Add the correct display in IE 9-.
*/
audio,
video {
display: inline-block;
}
/**
* Add the correct display in iOS 4-7.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Remove the border on images inside links in IE 10-.
*/
img {
border-style: none;
}
/**
* Hide the overflow in IE.
*/
svg:not(:root) {
overflow: hidden;
}
/* Forms
========================================================================== */
/**
* 1. Change the font styles in all browsers (opinionated).
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
optgroup,
select,
textarea {
font-family: sans-serif; /* 1 */
font-size: 100%; /* 1 */
line-height: 1.15; /* 1 */
margin: 0; /* 2 */
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input { /* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select { /* 1 */
text-transform: none;
}
/**
* 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
* controls in Android 4.
* 2. Correct the inability to style clickable types in iOS and Safari.
*/
button,
html [type="button"], /* 1 */
[type="reset"],
[type="submit"] {
-webkit-appearance: button; /* 2 */
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* Change the border, margin, and padding in all browsers (opinionated).
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
box-sizing: border-box; /* 1 */
color: inherit; /* 2 */
display: table; /* 1 */
max-width: 100%; /* 1 */
padding: 0; /* 3 */
white-space: normal; /* 1 */
}
/**
* 1. Add the correct display in IE 9-.
* 2. Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
display: inline-block; /* 1 */
vertical-align: baseline; /* 2 */
}
/**
* Remove the default vertical scrollbar in IE.
*/
textarea {
overflow: auto;
}
/**
* 1. Add the correct box sizing in IE 10-.
* 2. Remove the padding in IE 10-.
*/
[type="checkbox"],
[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type="search"] {
-webkit-appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */
}
/**
* Remove the inner padding and cancel buttons in Chrome and Safari on macOS.
*/
[type="search"]::-webkit-search-cancel-button,
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button; /* 1 */
font: inherit; /* 2 */
}
/* Interactive
========================================================================== */
/*
* Add the correct display in IE 9-.
* 1. Add the correct display in Edge, IE, and Firefox.
*/
details, /* 1 */
menu {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
/* Scripting
========================================================================== */
/**
* Add the correct display in IE 9-.
*/
canvas {
display: inline-block;
}
/**
* Add the correct display in IE.
*/
template {
display: none;
}
/* Hidden
========================================================================== */
/**
* Add the correct display in IE 10-.
*/
[hidden] {
display: none;
}

View file

@ -0,0 +1,182 @@
/*
Tipue Search 6.0
Copyright (c) 2017 Tipue
Tipue Search is released under the MIT License
http://www.tipue.com/search
*/
/* fonts */
/* search results */
#tipue_search_results_count
{
color: #333;
}
#tipue_search_warning
{
color: #333;
margin: 7px 0;
}
#tipue_search_warning a
{
color: #5396ea;
text-decoration: none;
}
.tipue_search_content_title
{
color: #666;
margin-top: 21px;
}
.tipue_search_content_title a
{
text-decoration: none;
font-weight:bold;
}
.tipue_search_content_url
{
word-wrap: break-word;
hyphens: auto;
}
.tipue_search_content_url a, .tipue_search_related_text a
{
color: #5396ea;
text-decoration: none;
}
.tipue_search_content_text
{
color: #333;
word-wrap: break-word;
hyphens: auto;
margin-top: 5px;
}
.tipue_search_content_bold
{
color: #333;
}
.tipue_search_content_debug
{
color: #333;
margin: 5px 0;
}
.tipue_search_related_title
{
color: #333;
margin: 26px 0 7px 0;
}
.tipue_search_related_cols
{
-webkit-columns: 230px 2;
-moz-columns: 230px 2;
columns: 230px 2;
}
#tipue_search_foot
{
margin: 51px 0 21px 0;
height: 50px;
}
#tipue_search_foot_boxes
{
padding: 0;
margin: 0;
cursor: pointer;
}
#tipue_search_foot_boxes li
{
list-style: none;
margin: 0;
padding: 0;
display: inline;
}
#tipue_search_foot_boxes li a
{
padding: 10px 17px 11px 17px;
background-color: #fff;
border: 1px solid #e3e3e3;
border-radius: 1px;
color: #333;
margin-right: 7px;
text-decoration: none;
text-align: center;
}
#tipue_search_foot_boxes li.current
{
padding: 10px 17px 11px 17px;
background: #f6f6f6;
border: 1px solid #e3e3e3;
border-radius: 1px;
color: #333;
margin-right: 7px;
text-align: center;
}
#tipue_search_foot_boxes li a:hover
{
background: #f6f6f6;
}
/* spinner */
.tipue_search_spinner
{
width: 50px;
height: 28px;
}
.tipue_search_spinner > div
{
background-color: #e3e3e3;
height: 100%;
width: 2px;
display: inline-block;
margin-right: 2px;
-webkit-animation: stretchdelay 1.2s infinite ease-in-out;
animation: stretchdelay 1.2s infinite ease-in-out;
}
.tipue_search_spinner .tipue_search_rect2
{
-webkit-animation-delay: -1.1s;
animation-delay: -1.1s;
}
.tipue_search_spinner .tipue_search_rect3
{
-webkit-animation-delay: -1.0s;
animation-delay: -1.0s;
}
@-webkit-keyframes stretchdelay
{
0%, 40%, 100%
{
-webkit-transform: scaleY(0.4)
}
20%
{
-webkit-transform: scaleY(1.0)
}
}
@keyframes stretchdelay
{
0%, 40%, 100%
{
transform: scaleY(0.4);
-webkit-transform: scaleY(0.4);
}
20%
{
transform: scaleY(1.0);
-webkit-transform: scaleY(1.0);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -0,0 +1,605 @@
/*
Tipue Search 6.0
Copyright (c) 2017 Tipue
Tipue Search is released under the MIT License
http://www.tipue.com/search
*/
(function($) {
$.fn.tipuesearch = function(options) {
var set = $.extend( {
'contentLocation' : 'tipuesearch/tipuesearch_content.json',
'contextBuffer' : 60,
'contextLength' : 60,
'contextStart' : 90,
'debug' : false,
'descriptiveWords' : 25,
'highlightTerms' : true,
'liveContent' : '*',
'liveDescription' : '*',
'minimumLength' : 3,
'mode' : 'static',
'newWindow' : false,
'show' : 9,
'showContext' : true,
'showRelated' : true,
'showTime' : true,
'showTitleCount' : true,
'showURL' : true,
'wholeWords' : true
}, options);
return this.each(function() {
var tipuesearch_in = {
pages: []
};
$.ajaxSetup({
async: false
});
var tipuesearch_t_c = 0;
$('#tipue_search_content').hide().html('<div class="tipue_search_spinner"><div class="tipue_search_rect1"></div><div class="tipue_search_rect2"></div><div class="rect3"></div></div>').show();
if (set.mode == 'live')
{
for (var i = 0; i < tipuesearch_pages.length; i++)
{
$.get(tipuesearch_pages[i]).done(function(html)
{
var cont = $(set.liveContent, html).text();
cont = cont.replace(/\s+/g, ' ');
var desc = $(set.liveDescription, html).text();
desc = desc.replace(/\s+/g, ' ');
var t_1 = html.toLowerCase().indexOf('<title>');
var t_2 = html.toLowerCase().indexOf('</title>', t_1 + 7);
if (t_1 != -1 && t_2 != -1)
{
var tit = html.slice(t_1 + 7, t_2);
}
else
{
var tit = tipuesearch_string_1;
}
tipuesearch_in.pages.push(
{
"title": tit,
"text": desc,
"tags": cont,
"url": tipuesearch_pages[i]
});
});
}
}
if (set.mode == 'json')
{
$.getJSON(set.contentLocation).done(function(json)
{
tipuesearch_in = $.extend({}, json);
});
}
if (set.mode == 'static')
{
tipuesearch_in = $.extend({}, tipuesearch);
}
var tipue_search_w = '';
if (set.newWindow)
{
tipue_search_w = ' target="_blank"';
}
function getURLP(name)
{
var _locSearch = location.search;
var _splitted = (new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(_locSearch)||[,""]);
var searchString = _splitted[1].replace(/\+/g, '%20');
try
{
searchString = decodeURIComponent(searchString);
}
catch(e)
{
searchString = unescape(searchString);
}
return searchString || null;
}
if (getURLP('q'))
{
$('#tipue_search_input').val(getURLP('q'));
getTipueSearch(0, true);
}
$(this).keyup(function(event)
{
if(event.keyCode == '13')
{
getTipueSearch(0, true);
}
});
function getTipueSearch(start, replace)
{
var out = '';
var results = '';
var show_replace = false;
var show_stop = false;
var standard = true;
var c = 0;
found = [];
var d_o = $('#tipue_search_input').val();
var d = d_o.toLowerCase();
d = $.trim(d);
if ((d.match("^\"") && d.match("\"$")) || (d.match("^'") && d.match("'$")))
{
standard = false;
}
var d_w = d.split(' ');
if (standard)
{
d = '';
for (var i = 0; i < d_w.length; i++)
{
var a_w = true;
for (var f = 0; f < tipuesearch_stop_words.length; f++)
{
if (d_w[i] == tipuesearch_stop_words[f])
{
a_w = false;
show_stop = true;
}
}
if (a_w)
{
d = d + ' ' + d_w[i];
}
}
d = $.trim(d);
d_w = d.split(' ');
}
else
{
d = d.substring(1, d.length - 1);
}
if (d.length >= set.minimumLength)
{
if (standard)
{
if (replace)
{
var d_r = d;
for (var i = 0; i < d_w.length; i++)
{
for (var f = 0; f < tipuesearch_replace.words.length; f++)
{
if (d_w[i] == tipuesearch_replace.words[f].word)
{
d = d.replace(d_w[i], tipuesearch_replace.words[f].replace_with);
show_replace = true;
}
}
}
d_w = d.split(' ');
}
var d_t = d;
for (var i = 0; i < d_w.length; i++)
{
for (var f = 0; f < tipuesearch_stem.words.length; f++)
{
if (d_w[i] == tipuesearch_stem.words[f].word)
{
d_t = d_t + ' ' + tipuesearch_stem.words[f].stem;
}
}
}
d_w = d_t.split(' ');
for (var i = 0; i < tipuesearch_in.pages.length; i++)
{
var score = 0;
var s_t = tipuesearch_in.pages[i].text;
for (var f = 0; f < d_w.length; f++)
{
if (set.wholeWords)
{
var pat = new RegExp('\\b' + d_w[f] + '\\b', 'gi');
}
else
{
var pat = new RegExp(d_w[f], 'gi');
}
if (tipuesearch_in.pages[i].title.search(pat) != -1)
{
var m_c = tipuesearch_in.pages[i].title.match(pat).length;
score += (20 * m_c);
}
if (tipuesearch_in.pages[i].text.search(pat) != -1)
{
var m_c = tipuesearch_in.pages[i].text.match(pat).length;
score += (20 * m_c);
}
if (tipuesearch_in.pages[i].tags.search(pat) != -1)
{
var m_c = tipuesearch_in.pages[i].tags.match(pat).length;
score += (10 * m_c);
}
if (tipuesearch_in.pages[i].url.search(pat) != -1)
{
score += 20;
}
if (score != 0)
{
for (var e = 0; e < tipuesearch_weight.weight.length; e++)
{
if (tipuesearch_in.pages[i].url == tipuesearch_weight.weight[e].url)
{
score += tipuesearch_weight.weight[e].score;
}
}
}
if (d_w[f].match('^-'))
{
pat = new RegExp(d_w[f].substring(1), 'i');
if (tipuesearch_in.pages[i].title.search(pat) != -1 || tipuesearch_in.pages[i].text.search(pat) != -1 || tipuesearch_in.pages[i].tags.search(pat) != -1)
{
score = 0;
}
}
}
if (score != 0)
{
found.push(
{
"score": score,
"title": tipuesearch_in.pages[i].title,
"desc": s_t,
"url": tipuesearch_in.pages[i].url
});
c++;
}
}
}
else
{
for (var i = 0; i < tipuesearch_in.pages.length; i++)
{
var score = 0;
var s_t = tipuesearch_in.pages[i].text;
var pat = new RegExp(d, 'gi');
if (tipuesearch_in.pages[i].title.search(pat) != -1)
{
var m_c = tipuesearch_in.pages[i].title.match(pat).length;
score += (20 * m_c);
}
if (tipuesearch_in.pages[i].text.search(pat) != -1)
{
var m_c = tipuesearch_in.pages[i].text.match(pat).length;
score += (20 * m_c);
}
if (tipuesearch_in.pages[i].tags.search(pat) != -1)
{
var m_c = tipuesearch_in.pages[i].tags.match(pat).length;
score += (10 * m_c);
}
if (tipuesearch_in.pages[i].url.search(pat) != -1)
{
score += 20;
}
if (score != 0)
{
for (var e = 0; e < tipuesearch_weight.weight.length; e++)
{
if (tipuesearch_in.pages[i].url == tipuesearch_weight.weight[e].url)
{
score += tipuesearch_weight.weight[e].score;
}
}
}
if (score != 0)
{
found.push(
{
"score": score,
"title": tipuesearch_in.pages[i].title,
"desc": s_t,
"url": tipuesearch_in.pages[i].url
});
c++;
}
}
}
if (c != 0)
{
if (set.showTitleCount && tipuesearch_t_c == 0)
{
var title = document.title;
document.title = '(' + c + ') ' + title;
tipuesearch_t_c++;
}
if (show_replace)
{
out += '<div id="tipue_search_warning">' + tipuesearch_string_2 + ' ' + d + '. ' + tipuesearch_string_3 + ' <a id="tipue_search_replaced">' + d_r + '</a></div>';
}
if (c == 1)
{
out += '<div id="tipue_search_results_count">' + tipuesearch_string_4;
}
else
{
c_c = c.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
out += '<div id="tipue_search_results_count">' + c_c + ' ' + tipuesearch_string_5;
}
if (set.showTime)
{
var endTimer = new Date().getTime();
var time = (endTimer - startTimer) / 1000;
out += ' (' + time.toFixed(2) + ' ' + tipuesearch_string_14 + ')';
set.showTime = false;
}
out += '</div>';
found.sort(function(a, b) { return b.score - a.score } );
var l_o = 0;
for (var i = 0; i < found.length; i++)
{
if (l_o >= start && l_o < set.show + start)
{
out += '<div class="tipue_search_content_title"><a href="' + found[i].url + '"' + tipue_search_w + '>' + found[i].title + '</a></div>';
if (set.debug)
{
out += '<div class="tipue_search_content_debug">Score: ' + found[i].score + '</div>';
}
if (set.showURL)
{
var s_u = found[i].url.toLowerCase();
if (s_u.indexOf('http://') == 0)
{
s_u = s_u.slice(7);
}
out += '<div class="tipue_search_content_url"><a href="' + found[i].url + '"' + tipue_search_w + '>' + s_u + '</a></div>';
}
if (found[i].desc)
{
var t = found[i].desc;
if (set.showContext)
{
d_w = d.split(' ');
var s_1 = found[i].desc.toLowerCase().indexOf(d_w[0]);
if (s_1 > set.contextStart)
{
var t_1 = t.substr(s_1 - set.contextBuffer);
var s_2 = t_1.indexOf(' ');
t_1 = t.substr(s_1 - set.contextBuffer + s_2);
t_1 = $.trim(t_1);
if (t_1.length > set.contextLength)
{
t = '... ' + t_1;
}
}
}
if (standard)
{
d_w = d.split(' ');
for (var f = 0; f < d_w.length; f++)
{
if (set.highlightTerms)
{
var patr = new RegExp('(' + d_w[f] + ')', 'gi');
t = t.replace(patr, "<span class=\"h0011\">$1</span>");
}
}
}
else if (set.highlightTerms)
{
var patr = new RegExp('(' + d + ')', 'gi');
t = t.replace(patr, "<span class=\"h0011\">$1</span>");
}
var t_d = '';
var t_w = t.split(' ');
if (t_w.length < set.descriptiveWords)
{
t_d = t;
}
else
{
for (var f = 0; f < set.descriptiveWords; f++)
{
t_d += t_w[f] + ' ';
}
}
t_d = $.trim(t_d);
if (t_d.charAt(t_d.length - 1) != '.')
{
t_d += ' ...';
}
t_d = t_d.replace(/h0011/g, 'tipue_search_content_bold');
out += '<div class="tipue_search_content_text">' + t_d + '</div>';
}
}
l_o++;
}
if (set.showRelated && standard)
{
f = 0;
for (var i = 0; i < tipuesearch_related.searches.length; i++)
{
if (d == tipuesearch_related.searches[i].search)
{
if (show_replace)
{
d_o = d;
}
if (!f)
{
out += '<div class="tipue_search_related_title">' + tipuesearch_string_15 + ' <span class="tipue_search_related_bold">' + d_o + '</span></div><div class="tipue_search_related_cols">';
}
out += '<div class="tipue_search_related_text"><a class="tipue_search_related" id="' + tipuesearch_related.searches[i].related + '">';
if (tipuesearch_related.searches[i].before)
{
out += '<span class="tipue_search_related_before">' + tipuesearch_related.searches[i].before + '</span> ';
}
out += tipuesearch_related.searches[i].related;
if (tipuesearch_related.searches[i].after)
{
out += ' <span class="tipue_search_related_after">' + tipuesearch_related.searches[i].after + '</span>';
}
out += '</a></div>';
f++;
}
}
if (f)
{
out += '</div>';
}
}
if (c > set.show)
{
var pages = Math.ceil(c / set.show);
var page = (start / set.show);
out += '<nav><div id="tipue_search_foot"><ul id="tipue_search_foot_boxes">';
if (start > 0)
{
out += '<li role="navigation"><a class="tipue_search_foot_box" accesskey="b" id="' + (start - set.show) + '_' + replace + '">' + tipuesearch_string_6 + '</a></li>';
}
if (page <= 2)
{
var p_b = pages;
if (pages > 3)
{
p_b = 3;
}
for (var f = 0; f < p_b; f++)
{
if (f == page)
{
out += '<li class="current" role="navigation">' + (f + 1) + '</li>';
}
else
{
out += '<li role="navigation"><a class="tipue_search_foot_box" id="' + (f * set.show) + '_' + replace + '">' + (f + 1) + '</a></li>';
}
}
}
else
{
var p_b = page + 2;
if (p_b > pages)
{
p_b = pages;
}
for (var f = page - 1; f < p_b; f++)
{
if (f == page)
{
out += '<li class="current" role="navigation">' + (f + 1) + '</li>';
}
else
{
out += '<li role="navigation"><a class="tipue_search_foot_box" id="' + (f * set.show) + '_' + replace + '">' + (f + 1) + '</a></li>';
}
}
}
if (page + 1 != pages)
{
out += '<li role="navigation"><a class="tipue_search_foot_box" accesskey="m" id="' + (start + set.show) + '_' + replace + '">' + tipuesearch_string_7 + '</a></li>';
}
out += '</ul></div></nav>';
}
}
else
{
out += '<div id="tipue_search_warning">' + tipuesearch_string_8 + '</div>';
}
}
else
{
if (show_stop)
{
out += '<div id="tipue_search_warning">' + tipuesearch_string_8 + '. ' + tipuesearch_string_9 + '</div>';
}
else
{
out += '<div id="tipue_search_warning">' + tipuesearch_string_10 + '</div>';
if (set.minimumLength == 1)
{
out += '<div id="tipue_search_warning">' + tipuesearch_string_11 + '</div>';
}
else
{
out += '<div id="tipue_search_warning">' + tipuesearch_string_12 + ' ' + set.minimumLength + ' ' + tipuesearch_string_13 + '</div>';
}
}
}
$('#tipue_search_content').hide().html(out).slideDown(200);
$('#tipue_search_replaced').click(function()
{
getTipueSearch(0, false);
});
$('.tipue_search_related').click(function()
{
$('#tipue_search_input').val($(this).attr('id'));
getTipueSearch(0, true);
});
$('.tipue_search_foot_box').click(function()
{
var id_v = $(this).attr('id');
var id_a = id_v.split('_');
getTipueSearch(parseInt(id_a[0]), id_a[1]);
});
}
});
};
})(jQuery);

View file

@ -0,0 +1,178 @@
(function($){$.fn.tipuesearch=function(options){var set=$.extend({'contentLocation':'tipuesearch/tipuesearch_content.json','contextBuffer':60,'contextLength':60,'contextStart':90,'debug':false,'descriptiveWords':25,'highlightTerms':true,'liveContent':'*','liveDescription':'*','minimumLength':3,'mode':'static','newWindow':false,'show':9,'showContext':true,'showRelated':true,'showTime':true,'showTitleCount':true,'showURL':true,'wholeWords':true},options);return this.each(function(){var tipuesearch_in={pages:[]};$.ajaxSetup({async:false});var tipuesearch_t_c=0;$('#tipue_search_content').hide().html('<div class="tipue_search_spinner"><div class="tipue_search_rect1"></div><div class="tipue_search_rect2"></div><div class="rect3"></div></div>').show();if(set.mode=='live')
{for(var i=0;i<tipuesearch_pages.length;i++)
{$.get(tipuesearch_pages[i]).done(function(html)
{var cont=$(set.liveContent,html).text();cont=cont.replace(/\s+/g,' ');var desc=$(set.liveDescription,html).text();desc=desc.replace(/\s+/g,' ');var t_1=html.toLowerCase().indexOf('<title>');var t_2=html.toLowerCase().indexOf('</title>',t_1+7);if(t_1!=-1&&t_2!=-1)
{var tit=html.slice(t_1+7,t_2);}
else
{var tit=tipuesearch_string_1;}
tipuesearch_in.pages.push({"title":tit,"text":desc,"tags":cont,"url":tipuesearch_pages[i]});});}}
if(set.mode=='json')
{$.getJSON(set.contentLocation).done(function(json)
{tipuesearch_in=$.extend({},json);});}
if(set.mode=='static')
{tipuesearch_in=$.extend({},tipuesearch);}
var tipue_search_w='';if(set.newWindow)
{tipue_search_w=' target="_blank"';}
function getURLP(name)
{var _locSearch=location.search;var _splitted=(new RegExp('[?|&]'+name+'='+'([^&;]+?)(&|#|;|$)').exec(_locSearch)||[,""]);var searchString=_splitted[1].replace(/\+/g,'%20');try
{searchString=decodeURIComponent(searchString);}
catch(e)
{searchString=unescape(searchString);}
return searchString||null;}
if(getURLP('q'))
{$('#tipue_search_input').val(getURLP('q'));getTipueSearch(0,true);}
$(this).keyup(function(event)
{if(event.keyCode=='13')
{getTipueSearch(0,true);}});function getTipueSearch(start,replace)
{var out='';var results='';var show_replace=false;var show_stop=false;var standard=true;var c=0;found=[];var d_o=$('#tipue_search_input').val();var d=d_o.toLowerCase();d=$.trim(d);if((d.match("^\"")&&d.match("\"$"))||(d.match("^'")&&d.match("'$")))
{standard=false;}
var d_w=d.split(' ');if(standard)
{d='';for(var i=0;i<d_w.length;i++)
{var a_w=true;for(var f=0;f<tipuesearch_stop_words.length;f++)
{if(d_w[i]==tipuesearch_stop_words[f])
{a_w=false;show_stop=true;}}
if(a_w)
{d=d+' '+d_w[i];}}
d=$.trim(d);d_w=d.split(' ');}
else
{d=d.substring(1,d.length-1);}
if(d.length>=set.minimumLength)
{if(standard)
{if(replace)
{var d_r=d;for(var i=0;i<d_w.length;i++)
{for(var f=0;f<tipuesearch_replace.words.length;f++)
{if(d_w[i]==tipuesearch_replace.words[f].word)
{d=d.replace(d_w[i],tipuesearch_replace.words[f].replace_with);show_replace=true;}}}
d_w=d.split(' ');}
var d_t=d;for(var i=0;i<d_w.length;i++)
{for(var f=0;f<tipuesearch_stem.words.length;f++)
{if(d_w[i]==tipuesearch_stem.words[f].word)
{d_t=d_t+' '+tipuesearch_stem.words[f].stem;}}}
d_w=d_t.split(' ');for(var i=0;i<tipuesearch_in.pages.length;i++)
{var score=0;var s_t=tipuesearch_in.pages[i].text;for(var f=0;f<d_w.length;f++)
{if(set.wholeWords)
{var pat=new RegExp('\\b'+d_w[f]+'\\b','gi');}
else
{var pat=new RegExp(d_w[f],'gi');}
if(tipuesearch_in.pages[i].title.search(pat)!=-1)
{var m_c=tipuesearch_in.pages[i].title.match(pat).length;score+=(20*m_c);}
if(tipuesearch_in.pages[i].text.search(pat)!=-1)
{var m_c=tipuesearch_in.pages[i].text.match(pat).length;score+=(20*m_c);}
if(tipuesearch_in.pages[i].tags.search(pat)!=-1)
{var m_c=tipuesearch_in.pages[i].tags.match(pat).length;score+=(10*m_c);}
if(tipuesearch_in.pages[i].url.search(pat)!=-1)
{score+=20;}
if(score!=0)
{for(var e=0;e<tipuesearch_weight.weight.length;e++)
{if(tipuesearch_in.pages[i].url==tipuesearch_weight.weight[e].url)
{score+=tipuesearch_weight.weight[e].score;}}}
if(d_w[f].match('^-'))
{pat=new RegExp(d_w[f].substring(1),'i');if(tipuesearch_in.pages[i].title.search(pat)!=-1||tipuesearch_in.pages[i].text.search(pat)!=-1||tipuesearch_in.pages[i].tags.search(pat)!=-1)
{score=0;}}}
if(score!=0)
{found.push({"score":score,"title":tipuesearch_in.pages[i].title,"desc":s_t,"url":tipuesearch_in.pages[i].url});c++;}}}
else
{for(var i=0;i<tipuesearch_in.pages.length;i++)
{var score=0;var s_t=tipuesearch_in.pages[i].text;var pat=new RegExp(d,'gi');if(tipuesearch_in.pages[i].title.search(pat)!=-1)
{var m_c=tipuesearch_in.pages[i].title.match(pat).length;score+=(20*m_c);}
if(tipuesearch_in.pages[i].text.search(pat)!=-1)
{var m_c=tipuesearch_in.pages[i].text.match(pat).length;score+=(20*m_c);}
if(tipuesearch_in.pages[i].tags.search(pat)!=-1)
{var m_c=tipuesearch_in.pages[i].tags.match(pat).length;score+=(10*m_c);}
if(tipuesearch_in.pages[i].url.search(pat)!=-1)
{score+=20;}
if(score!=0)
{for(var e=0;e<tipuesearch_weight.weight.length;e++)
{if(tipuesearch_in.pages[i].url==tipuesearch_weight.weight[e].url)
{score+=tipuesearch_weight.weight[e].score;}}}
if(score!=0)
{found.push({"score":score,"title":tipuesearch_in.pages[i].title,"desc":s_t,"url":tipuesearch_in.pages[i].url});c++;}}}
if(c!=0)
{if(set.showTitleCount&&tipuesearch_t_c==0)
{var title=document.title;document.title='('+c+') '+title;tipuesearch_t_c++;}
if(show_replace)
{out+='<div id="tipue_search_warning">'+tipuesearch_string_2+' '+d+'. '+tipuesearch_string_3+' <a id="tipue_search_replaced">'+d_r+'</a></div>';}
if(c==1)
{out+='<div id="tipue_search_results_count">'+tipuesearch_string_4;}
else
{c_c=c.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",");out+='<div id="tipue_search_results_count">'+c_c+' '+tipuesearch_string_5;}
if(set.showTime)
{var endTimer=new Date().getTime();var time=(endTimer-startTimer)/ 1000;out+=' ('+time.toFixed(2)+' '+tipuesearch_string_14+')';set.showTime=false;}
out+='</div>';found.sort(function(a,b){return b.score-a.score});var l_o=0;for(var i=0;i<found.length;i++)
{if(l_o>=start&&l_o<set.show+start)
{out+='<div class="tipue_search_content_title"><a href="'+found[i].url+'"'+tipue_search_w+'>'+found[i].title+'</a></div>';if(set.debug)
{out+='<div class="tipue_search_content_debug">Score: '+found[i].score+'</div>';}
if(set.showURL)
{var s_u=found[i].url.toLowerCase();if(s_u.indexOf('http://')==0)
{s_u=s_u.slice(7);}
out+='<div class="tipue_search_content_url"><a href="'+found[i].url+'"'+tipue_search_w+'>'+s_u+'</a></div>';}
if(found[i].desc)
{var t=found[i].desc;if(set.showContext)
{d_w=d.split(' ');var s_1=found[i].desc.toLowerCase().indexOf(d_w[0]);if(s_1>set.contextStart)
{var t_1=t.substr(s_1-set.contextBuffer);var s_2=t_1.indexOf(' ');t_1=t.substr(s_1-set.contextBuffer+s_2);t_1=$.trim(t_1);if(t_1.length>set.contextLength)
{t='... '+t_1;}}}
if(standard)
{d_w=d.split(' ');for(var f=0;f<d_w.length;f++)
{if(set.highlightTerms)
{var patr=new RegExp('('+d_w[f]+')','gi');t=t.replace(patr,"<span class=\"h0011\">$1</span>");}}}
else if(set.highlightTerms)
{var patr=new RegExp('('+d+')','gi');t=t.replace(patr,"<span class=\"h0011\">$1</span>");}
var t_d='';var t_w=t.split(' ');if(t_w.length<set.descriptiveWords)
{t_d=t;}
else
{for(var f=0;f<set.descriptiveWords;f++)
{t_d+=t_w[f]+' ';}}
t_d=$.trim(t_d);if(t_d.charAt(t_d.length-1)!='.')
{t_d+=' ...';}
t_d=t_d.replace(/h0011/g,'tipue_search_content_bold');out+='<div class="tipue_search_content_text">'+t_d+'</div>';}}
l_o++;}
if(set.showRelated&&standard)
{f=0;for(var i=0;i<tipuesearch_related.searches.length;i++)
{if(d==tipuesearch_related.searches[i].search)
{if(show_replace)
{d_o=d;}
if(!f)
{out+='<div class="tipue_search_related_title">Searches related to <span class="tipue_search_related_bold">'+d_o+'</span></div><div class="tipue_search_related_cols">';}
out+='<div class="tipue_search_related_text"><a class="tipue_search_related" id="'+tipuesearch_related.searches[i].related+'">';if(tipuesearch_related.searches[i].before)
{out+='<span class="tipue_search_related_before">'+tipuesearch_related.searches[i].before+'</span> ';}
out+=tipuesearch_related.searches[i].related;if(tipuesearch_related.searches[i].after)
{out+=' <span class="tipue_search_related_after">'+tipuesearch_related.searches[i].after+'</span>';}
out+='</a></div>';f++;}}
if(f)
{out+='</div>';}}
if(c>set.show)
{var pages=Math.ceil(c / set.show);var page=(start / set.show);out+='<nav><div id="tipue_search_foot"><ul id="tipue_search_foot_boxes">';if(start>0)
{out+='<li role="navigation"><a class="tipue_search_foot_box" accesskey="b" id="'+(start-set.show)+'_'+replace+'">'+tipuesearch_string_6+'</a></li>';}
if(page<=2)
{var p_b=pages;if(pages>3)
{p_b=3;}
for(var f=0;f<p_b;f++)
{if(f==page)
{out+='<li class="current" role="navigation">'+(f+1)+'</li>';}
else
{out+='<li role="navigation"><a class="tipue_search_foot_box" id="'+(f*set.show)+'_'+replace+'">'+(f+1)+'</a></li>';}}}
else
{var p_b=page+2;if(p_b>pages)
{p_b=pages;}
for(var f=page-1;f<p_b;f++)
{if(f==page)
{out+='<li class="current" role="navigation">'+(f+1)+'</li>';}
else
{out+='<li role="navigation"><a class="tipue_search_foot_box" id="'+(f*set.show)+'_'+replace+'">'+(f+1)+'</a></li>';}}}
if(page+1!=pages)
{out+='<li role="navigation"><a class="tipue_search_foot_box" accesskey="m" id="'+(start+set.show)+'_'+replace+'">'+tipuesearch_string_7+'</a></li>';}
out+='</ul></div></nav>';}}
else
{out+='<div id="tipue_search_warning">'+tipuesearch_string_8+'</div>';}}
else
{if(show_stop)
{out+='<div id="tipue_search_warning">'+tipuesearch_string_8+'. '+tipuesearch_string_9+'</div>';}
else
{out+='<div id="tipue_search_warning">'+tipuesearch_string_10+'</div>';if(set.minimumLength==1)
{out+='<div id="tipue_search_warning">'+tipuesearch_string_11+'</div>';}
else
{out+='<div id="tipue_search_warning">'+tipuesearch_string_12+' '+set.minimumLength+' '+tipuesearch_string_13+'</div>';}}}
$('#tipue_search_content').hide().html(out).slideDown(200);$('#tipue_search_replaced').click(function()
{getTipueSearch(0,false);});$('.tipue_search_related').click(function()
{$('#tipue_search_input').val($(this).attr('id'));getTipueSearch(0,true);});$('.tipue_search_foot_box').click(function()
{var id_v=$(this).attr('id');var id_a=id_v.split('_');getTipueSearch(parseInt(id_a[0]),id_a[1]);});}});};})(jQuery);

View file

@ -0,0 +1,19 @@
var tipuesearch = {"pages": [
{"title": "Tipue", "text": "Tipue is a small web development studio based in North London.", "tags": "jQuery HTML5 CSS", "url": "http://www.tipue.com"},
{"title": "Tipue Search, a site search engine jQuery plugin", "text": "Tipue Search is a site search engine jQuery plugin. It's free, open source, responsive and fast. Tipue Search only needs a browser that supports jQuery. It doesn't need MySQL or similar. In Static mode it doesn't even need a web server.", "tags": "JavaScript", "url": "http://www.tipue.com/search"},
{"title": "Getting Started with Tipue Search", "text": "Tipue Search usually consists of two parts, the search box and the results page. The results page displays the search results.", "tags": "", "url": "http://www.tipue.com/search/docs/?d=1"},
{"title": "Tipue Search Documentation", "text": "Tipue Search is a site search engine jQuery plugin. It's free, open source and responsive. Like jQuery, Tipue Search is released under the MIT License. It's free for both commercial and non-commercial use. Tipue Search uses various modes for loading content. Static mode uses a JavaScript object, while JSON mode uses JSON. Live mode grabs content from a list of pages dynamically.", "tags": "docs help", "url": "http://www.tipue.com/search/docs"},
{"title": "Tipue Search Static mode demo", "text": "Tipue Search is a site search engine jQuery plugin. This is a demo of Static mode. Enter tipue into the search box above.", "tags": "", "url": "http://www.tipue.com/search/demos/static"},
{"title": "Tipue Search Live mode demo", "text": "Tipue Search is a site search engine jQuery plugin. This is a demo of Live mode. Enter tipue into the search box above.", "tags": "", "url": "http://www.tipue.com/search/demos/live"},
{"title": "Tipue jQuery plugin support", "text": "We offer a range of flexible support plans for our jQuery plugins. We hope to continue offering excellent free support. Get it on Howwl using the hashtag #Tipue or #TipueSupport.", "tags": "", "url": "http://www.tipue.com/support"},
{"title": "Tipr, a small and simple jQuery tooltip plugin", "text": "Tipr is a small and simple jQuery tooltip plugin. It works on almost any element, and it's free and open source. Tipr displays attractive tooltips, and it's around 2KB, CSS included. The tooltips can appear above or below almost any HTML element. It also reacts to the size of the viewport.", "tags": "JavaScript", "url": "http://www.tipue.com/tipr"},
{"title": "The Tipue blog", "text": "A sporadic blog mostly about CSS, jQuery or HTML5.", "tags": "", "url": "http://www.tipue.com/blog"},
{"title": "About Tipue", "text": "Tipue is a small web development studio based in North London, founded in 2001. We design innovative web page add ins and features, more often than not with jQuery. We talk to servers with heavy-duty Perl.", "tags": "", "url": "http://www.tipue.com/is"},
{"title": "The Tipue blog - The complete guide to centering a div", "text": "Every new developer inevitably finds that centering a div isn't as obvious as you'd expect. Centering what's inside a div is easy enough by giving the text-align property a value of center, but then things tend to get a bit sticky. When you get to centering a div vertically, you can end up in a world of CSS hurt.", "tags": "HTML", "url": "http://www.tipue.com/blog/center-a-div"},
{"title": "The Tipue blog - Native HTML5 autocomplete with datalist", "text": "This article shows how with the HTML5 datalist element and input list attribute you can easily set up an input box with a custom autocomplete without jQuery, JavaScript or similar.", "tags": "", "url": "http://www.tipue.com/blog/input-list"},
{"title": "The Tipue blog - The really simple guide to z-index", "text": "The CSS z-index property often trips up new and even experienced developers. The aim of this article is to boil down a somewhat-complex specification to 3 major points, which should ease most z-index pain.", "tags": "", "url": "http://www.tipue.com/z-index"}
]};

View file

@ -0,0 +1,80 @@
/*
Tipue Search 6.0
Copyright (c) 2017 Tipue
Tipue Search is released under the MIT License
http://www.tipue.com/search
*/
/*
Stop words
Stop words list from http://www.ranks.nl/stopwords
*/
var tipuesearch_stop_words = ["a", "about", "above", "after", "again", "against", "all", "am", "an", "and", "any", "are", "aren't", "as", "at", "be", "because", "been", "before", "being", "below", "between", "both", "but", "by", "can't", "cannot", "could", "couldn't", "did", "didn't", "do", "does", "doesn't", "doing", "don't", "down", "during", "each", "few", "for", "from", "further", "had", "hadn't", "has", "hasn't", "have", "haven't", "having", "he", "he'd", "he'll", "he's", "her", "here", "here's", "hers", "herself", "him", "himself", "his", "how", "how's", "i", "i'd", "i'll", "i'm", "i've", "if", "in", "into", "is", "isn't", "it", "it's", "its", "itself", "let's", "me", "more", "most", "mustn't", "my", "myself", "no", "nor", "not", "of", "off", "on", "once", "only", "or", "other", "ought", "our", "ours", "ourselves", "out", "over", "own", "same", "shan't", "she", "she'd", "she'll", "she's", "should", "shouldn't", "so", "some", "such", "than", "that", "that's", "the", "their", "theirs", "them", "themselves", "then", "there", "there's", "these", "they", "they'd", "they'll", "they're", "they've", "this", "those", "through", "to", "too", "under", "until", "up", "very", "was", "wasn't", "we", "we'd", "we'll", "we're", "we've", "were", "weren't", "what", "what's", "when", "when's", "where", "where's", "which", "while", "who", "who's", "whom", "why", "why's", "with", "won't", "would", "wouldn't", "you", "you'd", "you'll", "you're", "you've", "your", "yours", "yourself", "yourselves"];
// Word replace
var tipuesearch_replace = {'words': [
{'word': 'tip', 'replace_with': 'tipue'},
{'word': 'javscript', 'replace_with': 'javascript'},
{'word': 'jqeury', 'replace_with': 'jquery'}
]};
// Weighting
var tipuesearch_weight = {'weight': [
{'url': 'http://www.tipue.com', 'score': 20},
{'url': 'http://www.tipue.com/search', 'score': 30},
{'url': 'http://www.tipue.com/is', 'score': 10}
]};
// Illogical stemming
var tipuesearch_stem = {'words': [
{'word': 'e-mail', 'stem': 'email'},
{'word': 'javascript', 'stem': 'jquery'},
{'word': 'javascript', 'stem': 'js'}
]};
// Related searches
var tipuesearch_related = {'searches': [
{'search': 'tipue', 'related': 'Tipue Search'},
{'search': 'tipue', 'before': 'Tipue Search', 'related': 'Getting Started'},
{'search': 'tipue', 'before': 'Tipue', 'related': 'jQuery'},
{'search': 'tipue', 'before': 'Tipue', 'related': 'Blog'}
]};
// Internal strings
var tipuesearch_string_1 = 'No title';
var tipuesearch_string_2 = 'Showing results for';
var tipuesearch_string_3 = 'Search instead for';
var tipuesearch_string_4 = '1 result';
var tipuesearch_string_5 = 'results';
var tipuesearch_string_6 = 'Back';
var tipuesearch_string_7 = 'More';
var tipuesearch_string_8 = 'Nothing found.';
var tipuesearch_string_9 = 'Common words are largely ignored.';
var tipuesearch_string_10 = 'Search too short';
var tipuesearch_string_11 = 'Should be one character or more.';
var tipuesearch_string_12 = 'Should be';
var tipuesearch_string_13 = 'characters or more.';
var tipuesearch_string_14 = 'seconds';
var tipuesearch_string_15 = 'Searches related to';
// Internals
// Timer for showTime
var startTimer = new Date().getTime();

View file

@ -0,0 +1 @@
{% extends "article_list.html" %}

View file

@ -0,0 +1,11 @@
{% extends "base.html" %}
{% block content %}
<h1>Archives for {{ SITENAME }}</h1>
<dl>
{% for article in dates %}
<dt>{{ article.locale_date }}</dt>
<dd><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></dd>
{% endfor %}
</dl>
{% endblock %}

View file

@ -0,0 +1,98 @@
{% extends "base.html" %}
{% block head %}
{{ super() }}
{% if article.description %}
<meta name="description" content="{{article.description}}" />
{% endif %}
{% for tag in article.tags %}
<meta name="tags" content="{{tag}}" />
{% endfor %}
{% endblock %}
{% block title %}
{{article.title}} - {{ super() }}
{% endblock %}
{% block breadcrumb_item %}
<li class="breadcrumb-item">
<span>{{article.title}}</span>
</li>
{% endblock %}
{% block content %}
<div class="bodycontent bodycontent-sidebar">
<div class="container">
<div class="row">
<div class="col-sm-9 pr-5 py-4 left-pane" style="background: #FFF;">
<section id="content" class="body docs-content">
<header>
<h2 class="entry-title">
<a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark"
title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a></h2>
</header>
<footer class="post-info">
{#{% if article.authors %}
<address class="vcard author">
By {% for author in article.authors %}
<a class="url fn" href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a>
{% endfor %}
</address>
{% endif %}#}
</footer><!-- /.post-info -->
<div class="entry-content">
{{ article.content }}
</div><!-- /.entry-content -->
</section>
</div>
<div class="col-sm-3 py-3 sidebar">
<div class="header-sidebar">
Last Updated
</div>
<div>
{% if article.modified %}
<time datetime="{{ article.modified.isoformat() }}">
{{ article.locale_modified }}
</time>
{% else %}
<time datetime="{{ article.date.isoformat() }}">
{{ article.locale_date }}
</time>
{% endif %}
</div>
{% if article.fedoraversions %}
<div class="header-sidebar mt-3">
Versions
</div>
<div>
{% for version in article.fedoraversions %}
<span class="badge badge-primary badge-sidebar"><span class="fa fa-bullseye"></span> Fedora {{version}}</span>
{% endfor %}
</div>
{% endif %}
<div class="header-sidebar mt-3">
Tags
</div>
<div>
{% for tag in article.tags %}
<a href="{{ SITEURL }}/{{ tag.url }}" class="badge badge-sidebar badge-default"><span class="fa fa-tag"></span> {{tag}}</a>
{% endfor %}
</div>
{% if article.related_posts %}
<div class="header-sidebar mt-3">
Related Articles
</div>
{% for related_post in article.related_posts %}
<div><span class="fa fa-file-text-o"></span> <a href="{{ SITEURL }}/{{ related_post.url }}">{{ related_post.title }}</a></div>
{% endfor %}
{% endif %}
{% import 'translations.html' as translations with context %}
{{ translations.translations_for(article) }}
</div>
</div>
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,55 @@
{% extends "base.html" %}
{% block breadcrumb_item %}
<li class="breadcrumb-item">
<span>All Articles</span>
</li>
{% endblock %}
{% block content %}
<div class="bodycontent bodycontent-sidebar">
<div class="container">
<div class="row">
<div class="col-sm-9 pr-5 py-4 left-pane" style="background: #FFF;">
{% block content_title %}
<h2>All articles</h2>
{% endblock %}
{% for article in articles_page.object_list | sort %}
<div class="item-to-filter"
data-item-tags="{% for tag in article.tags %}{{tag}},{% endfor %}">
<div class="px-1 pb-4">
<div class="row px-0 mx-0 justify-content-between">
<a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">
<strong>{{ article.title }}</strong>
</a>
<small><time class="published" datetime="{{ article.date.isoformat() }}"> {{ article.locale_date }} </time></small>
</div>
<div class="row px-0 mx-0 justify-content-between">
<span>
<!--<span class="badge badge-default"><span class="fa fa-folder"></span> {{article.category}}</span>-->
{% for tag in article.tags %}
<a href="{{ SITEURL }}/{{ tag.url }}" class="badge badge-default"><span class="fa fa-tag"></span> {{tag}}</a>
{% endfor %}
{% for version in article.fedoraversions %}
<span class="badge badge-primary"><span class="fa fa-bullseye"></span> Fedora {{version}}</span>
{% endfor %}
</span>
</div>
</div>
</div>
{% endfor %}
</div>
<div class="col-sm-3 py-3 sidebar">
<div class="header-sidebar">
Filter by Tag
</div>
<div>
<div class="tagsort-taglist"> </div>
</div>
</div>
</div>
{% if articles_page.has_other_pages() %}
{% include 'pagination.html' %}
{% endif %}
</div>
</div>
{% endblock content %}

View file

@ -0,0 +1,7 @@
{% extends "index.html" %}
{% block title %}{{ SITENAME }} - Articles by {{ author }}{% endblock %}
{% block content_title %}
<h2>Articles by {{ author }}</h2>
{% endblock %}

View file

@ -0,0 +1,13 @@
{% extends "article_list.html" %}
{% block title %}{{ SITENAME }} - Authors{% endblock %}
{% block content %}
<h1>Authors on {{ SITENAME }}</h1>
<ul>
{%- for author, articles in authors|sort %}
<li><a href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a> ({{ articles|count }})</li>
{% endfor %}
</ul>
{% endblock %}

179
theme/templates/base.html Normal file
View file

@ -0,0 +1,179 @@
<!DOCTYPE html>
<html lang="{{ DEFAULT_LANG }}">
<head>
{% block head %}
<title>{% block title %}{{ SITENAME }} Quick Docs{% endblock title %}</title>
<meta charset="utf-8" />
{% if FEED_ALL_ATOM %}
<link href="{{ FEED_DOMAIN }}/{{ FEED_ALL_ATOM }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Full Atom Feed" />
{% endif %}
{% if FEED_ALL_RSS %}
<link href="{{ FEED_DOMAIN }}/{{ FEED_ALL_RSS }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Full RSS Feed" />
{% endif %}
{% if FEED_ATOM %}
<link href="{{ FEED_DOMAIN }}/{{ FEED_ATOM }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Atom Feed" />
{% endif %}
{% if FEED_RSS %}
<link href="{{ FEED_DOMAIN }}/{{ FEED_RSS }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} RSS Feed" />
{% endif %}
{% if CATEGORY_FEED_ATOM and category %}
<link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_ATOM|format(category.slug) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Categories Atom Feed" />
{% endif %}
{% if CATEGORY_FEED_RSS and category %}
<link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_RSS|format(category.slug) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Categories RSS Feed" />
{% endif %}
{% if TAG_FEED_ATOM and tag %}
<link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_ATOM|format(tag.slug) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Tags Atom Feed" />
{% endif %}
{% if TAG_FEED_RSS and tag %}
<link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_RSS|format(tag.slug) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Tags RSS Feed" />
{% endif %}
<link href="{{ SITEURL }}/theme/fedora-bootstrap.css" type="text/css" rel="stylesheet" />
<link href="{{ SITEURL }}/theme/asciibinder.css" type="text/css" rel="stylesheet" />
<link href="{{ SITEURL }}/theme/docs-fedora.css" type="text/css" rel="stylesheet" />
<link href="{{ SITEURL }}/theme/pygment.css" type="text/css" rel="stylesheet" />
<link href="https://apps.fedoraproject.org/global/fedora-bootstrap-fonts/hack.css" type="text/css" rel="stylesheet" />
<link href="https://apps.fedoraproject.org/global/fedora-bootstrap-fonts/open-sans.css" type="text/css" rel="stylesheet" />
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js">
</script>
<script type="text/javascript" src="{{ SITEURL }}/theme/fedora-bootstrap.js"></script>
<script type="text/javascript" src="{{ SITEURL }}/theme/tagsort.min.js"></script>
{% endblock head %}
</head>
<body id="index" class="home">
<div class="masthead">
<div class="container">
<div><a href="http://docs.fedoraproject.org/"><img src="{{ SITEURL }}/theme/docs_logo.png" height="40px" alt="Fedora Docs"/></a>
<!--<div class="float-right">
<form id="searchform" action="{{ SITEURL }}/search.html" onsubmit="return (this.elements['q'].value.length > 0)">
<input id="searchbox" type="text" name="q" size="12" placeholder="Search" class="form-control">
</form>
</div>-->
</div>
<nav aria-label="breadcrumb">
<ol class="breadcrumb mb-0">
<li class="breadcrumb-item active">
<a href="http://docs.fedoraproject.org">Home</a>
</li>
<li class="breadcrumb-item active">
<a href="{{ SITEURL }}">Fedora Quick Docs</a>
</li>
{% block breadcrumb_item %}{% endblock %}
</ol>
</nav>
</div>
</div>
{#
<nav id="menu"><ul>
{% for title, link in MENUITEMS %}
<li><a href="{{ link }}">{{ title }}</a></li>
{% endfor %}
{% if DISPLAY_PAGES_ON_MENU %}
{% for p in pages %}
<li{% if p == page %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ p.url }}">{{ p.title }}</a></li>
{% endfor %}
{% else %}
{% if DISPLAY_CATEGORIES_ON_MENU %}
{% for cat, null in categories %}
<li{% if cat == category %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ cat.url }}">{{ cat }}</a></li>
{% endfor %}
{% endif %}
{% endif %}
</ul></nav><!-- /#menu -->
#}
{% block content %}
{% endblock %}
<div class="footer text-white" >
<div class="foot">
<div class="container py-4">
<div class="row footerlinks">
<div class="col-sm-2 col-xs-4 mt-3 widget">
<h3 class="widget-title">About</h3>
<div class="widget-body">
<dl>
<dd><a href="https://getfedora.org/">Get Fedora</a></dd>
<dd><a href="https://getfedora.org/en/sponsors">Sponsors</a></dd>
<dd><a href="https://fedoramagazine.org">Fedora Magazine</a></dd>
<dd><a href="https://fedoraproject.org/wiki/Legal:Main#Legal">Legal</a></dd>
</dl>
</div>
</div>
<div class="col-sm-2 col-xs-4 mt-3 widget">
<h3 class="widget-title">Support</h3>
<div class="widget-body">
<dl>
<dd><a href="https://fedoraproject.org/wiki/Communicating_and_getting_help">Get Help</a></dd>
<dd><a href="https://ask.fedoraproject.org/">Ask Fedora</a></dd>
<dd><a href="https://fedoraproject.org/wiki/Common_F27_bugs">Common Bugs</a></dd>
<dd><a href="https://developer.fedoraproject.org/">Fedora Developer Portal</a></dd>
</dl>
</div>
</div>
<div class="col-sm-2 col-xs-4 mt-3 widget">
<h3 class="widget-title">Community</h3>
<div class="widget-body">
<dl>
<dd><a href="https://fedoraproject.org/wiki/Join">Join Fedora</a></dd>
<dd><a href="https://fedoraproject.org/wiki/Overview">About Fedora</a></dd>
<dd><a href="http://fedoraplanet.org">Planet Fedora</a></dd>
<dd><a href="https://admin.fedoraproject.org/accounts/">Fedora Account System</a></dd>
</dl>
</div>
</div>
<div class="col-sm-6 col-xs-12 widget text-right">
<a href="https://www.facebook.com/TheFedoraProject" class="btn-social btn-outline"><i class="fa fa-fw fa-2x fa-facebook"></i></a>
<a href="https://plus.google.com/112917221531140868607" class="btn-social btn-outline"><i class="fa fa-fw fa-2x fa-google-plus"></i></a>
<a href="https://twitter.com/fedora" class="btn-social btn-outline"><i class="fa fa-fw fa-2x fa-twitter"></i></a>
<p class="pt-3">
&copy; 2018 Red Hat, Inc. and others. <br/>Please send any comments or corrections
to the <a href="https://pagure.io/fedora-docs/docs-fp-o">documentation team</a>
</p>
<p>
Fedora is sponsored by Red Hat. <br/>
<a href="https://www.redhat.com/en/technologies/linux-platforms/articles/relationship-between-fedora-and-rhel">Learn more about the relationship between Red Hat and Fedora &raquo;</a>
</p>
<div class="widget-body">
<a href="https://www.redhat.com/"><img height="50px" class="rh-logo" src="{{ SITEURL }}/theme/redhat-logo.png" alt="Red Hat Logo" /></a>
</div>
</div>
</div> <!-- /row of widgets -->
</div>
</div>
<script>
$( document ).ready(function() {
$('div.tagsort-taglist').tagSort({
items:'.item-to-filter',
tagClassPrefix: 'badge badge-default badge-tagfilter tagsort-tag '
});
if ($('.docs-content').length){
var TOC = "<div class='header-sidebar mt-3'>Table of Contents</div><ul class='list-unstyled qd-toc'>";
$('.docs-content div.sect1 > h2').each(function(){
var element = $(this);
var text = element.text();
var link = '#'+element.attr("id");
TOC += "<li class='pl-1'><a href='"+link+"'>"+text+"</a></li>"
});
TOC += "</ul>";
$(".sidebar").prepend(TOC);
}
});
</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
{% extends "base.html" %}
{% block content %}
<ul>
{{categories}}
{% for category, articles in categories %}
{% for article in articles %}
<li><a href="{{ SITEURL }}/{{ category.url }}">{{ category }} {{article}}</a></li>
{% endfor %}
{% endfor %}
</ul>
{% endblock %}

View file

@ -0,0 +1,7 @@
{% extends "article_list.html" %}
{% block content_title %}
<h3>{{ category.name }} <span class="badge badge-default">{{articles_page.object_list|count}} articles</span></h3>
<p>
{{category.description}}
</p>
{% endblock %}

View file

@ -0,0 +1,69 @@
{% extends "base.html" %}
{% block content %}
<div class="bodycontent">
<div class="jumbotron py-4">
<div class="container">
<div class="row">
<div class="col-12">
<h1 class="display-5 text-center">Fedora Quick Docs</h1>
<p class="text-center">Quick, article style documentation on how to do things with Fedora</p>
<div class="row">
<div class="col-8 offset-2">
<form id="searchform" action="{{ SITEURL }}/search.html" onsubmit="return (this.elements['q'].value.length > 0)">
<div class="input-group">
<input class="form-control" id="searchbox" type="text" name="q" size="12" placeholder="Search Quick Docs" class="form-control">
<div class="input-group-btn">
<button class="btn btn-primary" type="submit"><span class="fa fa-search"></span></button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-10 offset-1 mb-4">
<h3 class="display-5 text-center">Browse</h3>
<a class="badge badge-success" href="{{ SITEURL }}/all_articles.html"><span class="fa fa-list"></span> All Articles</a>&nbsp;&nbsp;
{%- for tag, articles in tags|sort %}
<a class="badge badge-default" href="{{ SITEURL }}/{{ tag.url }}"><span class="fa fa-tag"></span> {{ tag }} {# {{ articles|count }} #}</a>
{% endfor %}
</div>
<div class="col-10 offset-1 mb-4">
<h3 class="display-5 text-center">Recently updated articles</h3>
{% for article in articles_page.object_list[:5] %}
<div class="item-to-filter"
data-item-tags="{% for tag in article.tags %}{{tag}},{% endfor %}">
<div class="px-1 pb-4">
<div class="row px-0 mx-0 justify-content-between">
<a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">
<strong>{{ article.title }}</strong>
</a>
<small><time class="published" datetime="{{ article.date.isoformat() }}"> {{ article.locale_date }} </time></small>
</div>
<div class="row px-0 mx-0 justify-content-between">
<span>
<!--<span class="badge badge-default"><span class="fa fa-folder"></span> {{article.category}}</span>-->
{% for tag in article.tags %}
<a href="{{ SITEURL }}/{{ tag.url }}" class="badge badge-default"><span class="fa fa-tag"></span> {{tag}}</a>
{% endfor %}
{#{% for version in article.fedoraversions %}
<span class="badge badge-default"><span class="fa fa-bullseye"></span> Fedora {{version}}</span>
{% endfor %}#}
</span>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
{% if articles_page.has_other_pages() %}
{% include 'pagination.html' %}
{% endif %}
</div>
</div>
{% endblock content %}

15
theme/templates/page.html Normal file
View file

@ -0,0 +1,15 @@
{% extends "base.html" %}
{% block title %}{{ page.title }}{%endblock%}
{% block content %}
<h1>{{ page.title }}</h1>
{% import 'translations.html' as translations with context %}
{{ translations.translations_for(page) }}
{{ page.content }}
{% if page.modified %}
<p>
Last updated: {{ page.locale_modified }}
</p>
{% endif %}
{% endblock %}

View file

@ -0,0 +1,11 @@
{% if DEFAULT_PAGINATION %}
<p class="paginator">
{% if articles_page.has_previous() %}
<a href="{{ SITEURL }}/{{ articles_previous_page.url }}">&laquo;</a>
{% endif %}
Page {{ articles_page.number }} / {{ articles_paginator.num_pages }}
{% if articles_page.has_next() %}
<a href="{{ SITEURL }}/{{ articles_next_page.url }}">&raquo;</a>
{% endif %}
</p>
{% endif %}

View file

@ -0,0 +1,11 @@
{% extends "base.html" %}
{% block content %}
<h1>Archives for {{ period | reverse | join(' ') }}</h1>
<dl>
{% for article in dates %}
<dt>{{ article.locale_date }}</dt>
<dd><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></dd>
{% endfor %}
</dl>
{% endblock %}

View file

@ -0,0 +1,47 @@
{% extends 'base.html' %}
{% block title %}
Search - {{ SITENAME|striptags }}
{% endblock title %}
{% block head %}
{{ super() }}
<link href="{{ SITEURL }}/theme/tipuesearch/css/tipuesearch.css" type="text/css" rel="stylesheet" />
{% endblock %}
{% block breadcrumb_item %}
<li class="breadcrumb-item">
<span>Search</span>
</li>
{% endblock %}
{% block content %}
<script type="text/javascript" src="{{ SITEURL }}/theme/tipuesearch/tipuesearch_set.js"></script>
<script type="text/javascript" src="{{ SITEURL }}/theme/tipuesearch/tipuesearch.min.js"></script>
<script>
$(document).ready(function() {
$('#tipue_search_input').tipuesearch({
'show': 10,
'mode': 'json',
'contentLocation': '{{ SITEURL }}/tipuesearch_content.json'
});
});
</script>
<div class="bodycontent">
<div class="container">
<div class="row">
<div class="col-10 offset-1">
<div class="input-group my-3">
<input class="form-control" id="tipue_search_input" type="text" name="q" size="12" placeholder="Search Quick Docs" class="form-control">
<div class="input-group-btn">
<button id="tipue_search_button" class="btn btn-primary" type="submit"><span class="fa fa-search"></span></button>
</div>
</div>
<div id="tipue_search_content"></div>
</div>
</div>
</div>
</div>
{% endblock content %}

13
theme/templates/tag.html Normal file
View file

@ -0,0 +1,13 @@
{% extends "article_list.html" %}
{% block content_title %}
<h3>{{ tag.name }} <span class="badge badge-default">{{articles_page.object_list|count}} articles</span></h3>
<p>
{{tag.description}}
</p>
{% endblock %}
{% block breadcrumb_item %}
<li class="breadcrumb-item">
<span>Browsing Tag <span class="badge badge-default">{{tag}}</span></span>
</li>
{% endblock %}

10
theme/templates/tags.html Normal file
View file

@ -0,0 +1,10 @@
{% extends "base.html" %}
{% block title %}{{ SITENAME }} - Tags{% endblock %}
{% block content %}
<h1>Tags for {{ SITENAME }}</h1>
{%- for tag, articles in tags|sort %}
<li><a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a> ({{ articles|count }})</li>
{% endfor %}
{% endblock %}

View file

@ -0,0 +1,12 @@
{% macro translations_for(article) %}
{% if article.translations %}
<div class="header-sidebar mt-3">
Other Languages
</div>
<ul>
{% for translation in article.translations %}
<li><a href="{{ SITEURL }}/{{ translation.url }}">{{ translation.lang }}</a></li>
{% endfor %}
</ul>
{% endif %}
{% endmacro %}