├── .coveragerc ├── .gitignore ├── .gitmodules ├── .travis.yml ├── .venv └── pyvenv.cfg ├── .vscode └── settings.json ├── LICENSE ├── MANIFEST.in ├── README.rst ├── catsup ├── __init__.py ├── cli.py ├── deploy.py ├── generator │ ├── __init__.py │ ├── renderer.py │ └── utils.py ├── logger.py ├── models.py ├── options.py ├── parser │ ├── __init__.py │ ├── config.py │ ├── themes.py │ └── utils.py ├── reader │ ├── __init__.py │ ├── html.py │ ├── markdown.py │ ├── meta.py │ ├── txt.py │ └── utils.py ├── server.py ├── templates │ ├── config.json │ ├── feed.xml │ ├── filters.py │ └── utils.html ├── themes │ ├── __init__.py │ ├── install.py │ └── utils.py └── utils.py ├── conf ├── README.md ├── nginx.conf └── supervisord.conf ├── docs ├── .gitignore ├── Makefile ├── _templates │ └── sidebarintro.html ├── changelog.rst ├── conf.py ├── config.json ├── config.rst ├── goodies.rst ├── index.rst ├── install.rst ├── make.bat ├── post.rst ├── start.rst ├── theme.rst └── upgrading.rst ├── example ├── .gitignore ├── config.json └── posts │ └── hello_world.md ├── poetry.lock ├── pyproject.toml ├── renovate.json └── tests ├── .gitignore ├── 2013-02-11-test.md ├── config.json ├── conftest.py ├── no_meta.txt ├── post.txt ├── site ├── config.json ├── config2.json ├── noposts │ └── .gitkeep ├── posts │ ├── .should-not-exist │ ├── 2013-12-12-html.html │ ├── hh.txt │ ├── page.markdown │ └── should-exist └── themes │ └── test │ ├── templates │ ├── page.html │ └── post.html │ └── theme.py ├── test_meta_parser.py ├── test_parser.py ├── test_permalink.py ├── test_reader.py ├── test_theme_utils.py └── test_with_cli.py /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | include = catsup/* 3 | omit = 4 | deploy 5 | server 6 | logger 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | #catsup 2 | _posts 3 | _posts/* 4 | deploy/* 5 | 6 | #PyCharm 7 | .idea 8 | 9 | *.py[co] 10 | 11 | # Packages 12 | *.egg 13 | *.egg-info 14 | dist 15 | build 16 | eggs 17 | parts 18 | bin 19 | var 20 | sdist 21 | develop-eggs 22 | .installed.cfg 23 | 24 | # Installer logs 25 | pip-log.txt 26 | 27 | # Unit test / coverage reports 28 | .coverage 29 | .tox 30 | 31 | #Translations 32 | *.mo 33 | 34 | #Mr Developer 35 | .mr.developer.cfg 36 | 37 | #OS X 38 | .DS_Store 39 | 40 | #Sphinx 41 | docs/_build/ 42 | 43 | #Virtualenv 44 | .Python 45 | lib/ 46 | include/ 47 | htmlcov 48 | tests/site/deploy 49 | 50 | venv/ 51 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "catsup/themes/sealscript"] 2 | path = catsup/themes/sealscript 3 | url = git://github.com/whtsky/catsup-theme-sealscript.git 4 | [submodule "docs/_themes"] 5 | path = docs/_themes 6 | url = git://github.com/lepture/flask-sphinx-themes.git 7 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | python: 3 | - 3.5 4 | - 3.6 5 | - 3.7 6 | - 3.8 7 | - nightly 8 | 9 | cache: pip 10 | 11 | install: 12 | - python -m pip install -U pip wheel setuptools 13 | - python -m pip install poetry 14 | - poetry install 15 | 16 | script: poetry run pytest --cov=catsup --cov-report xml --cov-report term-missing 17 | 18 | after_success: poetry run codecov 19 | 20 | notifications: 21 | email: false 22 | -------------------------------------------------------------------------------- /.venv/pyvenv.cfg: -------------------------------------------------------------------------------- 1 | home = /Users/whtsky/.pyenv/versions/3.8.0/bin 2 | include-system-site-packages = false 3 | version = 3.8.0 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.exclude": { 3 | "**/.git": true, 4 | "**/.svn": true, 5 | "**/.hg": true, 6 | "**/CVS": true, 7 | "**/.DS_Store": true, 8 | "**/venv": true 9 | }, 10 | "python.pythonPath": ".venv/bin/python" 11 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 whtsky 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include catsup/templates *.* 2 | recursive-include catsup/themes *.* 3 | include README.rst 4 | include LICENSE -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | Catsup 2 | ---------------- 3 | 4 | .. image:: https://travis-ci.org/whtsky/Catsup.png?branch=develop 5 | :target: https://travis-ci.org/whtsky/Catsup 6 | 7 | .. image:: https://coveralls.io/repos/whtsky/catsup/badge.png?branch=develop 8 | :target: https://coveralls.io/r/whtsky/catsup?branch=develop 9 | 10 | 11 | Catsup is a lightweight static website generator which aims to be simple and elegant. 12 | Documentation is available at RTFD: https://catsup.readthedocs.org/en/latest/ 13 | 14 | Quick Start 15 | =============== 16 | 17 | First, install Catsup via pip :: 18 | 19 | $ pip install catsup 20 | 21 | Then, create a new Catsup site :: 22 | 23 | $ mkdir site 24 | $ cd site 25 | $ catsup init 26 | 27 | Edit the config file :: 28 | 29 | vim config.json 30 | 31 | Write some posts :: 32 | 33 | $ vim posts/hello-world.md 34 | $ cat posts/hello-world.md 35 | # Hello World 36 | 37 | - tags: hello world, catsup 38 | - time: 2013-08-30 12:00 39 | 40 | --- 41 | 42 | Hello, World! 43 | 44 | Build your site and deploy :: 45 | 46 | catsup build && catsup deploy 47 | 48 | For more information, please read the document: https://catsup.readthedocs.org/en/latest/ 49 | -------------------------------------------------------------------------------- /catsup/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Catsup, a lightweight static blog generator 3 | """ 4 | 5 | __version__ = "0.3.11" 6 | -------------------------------------------------------------------------------- /catsup/cli.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from catsup.options import g 4 | from catsup.logger import logger, enable_pretty_logging 5 | 6 | enable_pretty_logging() 7 | 8 | import catsup 9 | 10 | doc = ( 11 | """Catsup v%s 12 | 13 | Usage: 14 | catsup init [] 15 | catsup build [-s |--settings=] 16 | catsup deploy [-s |--settings=] 17 | catsup git [-s |--settings=] 18 | catsup rsync [-s |--settings=] 19 | catsup server [-s |--settings=] [-p |--port=] 20 | catsup webhook [-s |--settings=] [-p |--port=] 21 | catsup watch [-s |--settings=] 22 | catsup clean [-s |--settings=] 23 | catsup themes 24 | catsup install 25 | catsup -h | --help 26 | catsup --version 27 | 28 | Options: 29 | -h --help Show this screen and exit. 30 | -s --settings= specify a config file. [default: config.json] 31 | -f --file= specify a wordpress output file. 32 | -o --output= specify a output folder. [default: .] 33 | -p --port= specify the server port. [default: 8888] 34 | -g --global install theme to global theme folder. 35 | """ 36 | % catsup.__version__ 37 | ) 38 | 39 | from parguments import Parguments 40 | 41 | parguments = Parguments(doc, version=catsup.__version__) 42 | 43 | 44 | @parguments.command 45 | def init(path): 46 | """ 47 | Usage: 48 | catsup init [] 49 | 50 | Options: 51 | -h --help Show this screen and exit. 52 | """ 53 | from catsup.parser.utils import create_config_file 54 | 55 | create_config_file(path) 56 | 57 | 58 | @parguments.command 59 | def build(settings): 60 | """ 61 | Usage: 62 | catsup build [-s |--settings=] 63 | 64 | Options: 65 | -h --help Show this screen and exit. 66 | -s --settings= specify a setting file. [default: config.json] 67 | """ 68 | from catsup.generator import Generator 69 | 70 | generator = Generator(settings) 71 | generator.generate() 72 | 73 | 74 | @parguments.command 75 | def deploy(settings): 76 | """ 77 | Usage: 78 | catsup deploy [-s |--settings=] 79 | 80 | Options: 81 | -h --help Show this screen and exit. 82 | -s --settings= specify a setting file. [default: config.json] 83 | """ 84 | import catsup.parser 85 | import catsup.deploy 86 | 87 | config = catsup.parser.config(settings) 88 | if config.deploy.default == "git": 89 | catsup.deploy.git(config) 90 | elif config.deploy.default == "rsync": 91 | catsup.deploy.rsync(config) 92 | else: 93 | logger.error("Unknown deploy: %s" % config.deploy.default) 94 | 95 | 96 | @parguments.command 97 | def git(settings): 98 | """ 99 | Usage: 100 | catsup git [-s |--settings=] 101 | 102 | Options: 103 | -h --help Show this screen and exit. 104 | -s --settings= specify a setting file. [default: config.json] 105 | """ 106 | import catsup.parser.config 107 | import catsup.deploy 108 | 109 | config = catsup.parser.config(settings) 110 | catsup.deploy.git(config) 111 | 112 | 113 | @parguments.command 114 | def rsync(settings): 115 | """ 116 | Usage: 117 | catsup rsync [-s |--settings=] 118 | 119 | Options: 120 | -h --help Show this screen and exit. 121 | -s --settings= specify a setting file. [default: config.json] 122 | """ 123 | import catsup.parser.config 124 | import catsup.deploy 125 | 126 | config = catsup.parser.config(settings) 127 | catsup.deploy.rsync(config) 128 | 129 | 130 | @parguments.command 131 | def server(settings, port): 132 | """ 133 | Usage: 134 | catsup server [-s |--settings=] [-p |--port=] 135 | 136 | Options: 137 | -h --help Show this screen and exit. 138 | -s --settings= specify a setting file. [default: config.json] 139 | -p --port= specify the server port. [default: 8888] 140 | """ 141 | import catsup.server 142 | 143 | preview_server = catsup.server.PreviewServer(settings, port) 144 | preview_server.run() 145 | 146 | 147 | @parguments.command 148 | def webhook(settings, port): 149 | """ 150 | Usage: 151 | catsup webhook [-s |--settings=] [-p |--port=] 152 | 153 | Options: 154 | -h --help Show this screen and exit. 155 | -s --settings= specify a setting file. [default: config.json] 156 | -p --port= specify the server port. [default: 8888] 157 | """ 158 | import catsup.server 159 | 160 | server = catsup.server.WebhookServer(settings, port) 161 | server.run() 162 | 163 | 164 | @parguments.command 165 | def watch(settings): 166 | """ 167 | Usage: 168 | catsup watch [-s |--settings=] 169 | 170 | Options: 171 | -h --help Show this screen and exit. 172 | -s --settings= specify a setting file. [default: config.json] 173 | """ 174 | from catsup.generator import Generator 175 | from catsup.server import CatsupEventHandler 176 | from watchdog.observers import Observer 177 | 178 | generator = Generator(settings) 179 | generator.generate() 180 | event_handler = CatsupEventHandler(generator) 181 | observer = Observer() 182 | for path in [generator.config.config.source, g.theme.path]: 183 | path = os.path.abspath(path) 184 | observer.schedule(event_handler, path=path, recursive=True) 185 | observer.start() 186 | while True: 187 | pass 188 | 189 | 190 | @parguments.command 191 | def clean(settings: str): 192 | """ 193 | Usage: 194 | catsup clean [-s |--settings=] 195 | 196 | Options: 197 | -h --help Show this screen and exit. 198 | -s --settings= specify a setting file. [default: config.json] 199 | """ 200 | import shutil 201 | import catsup.parser.config 202 | 203 | config = catsup.parser.config(settings) 204 | 205 | for path in [config.config.static_output, config.config.output]: 206 | if os.path.exists(path): 207 | shutil.rmtree(path) 208 | 209 | 210 | @parguments.command 211 | def themes(): 212 | """ 213 | Usage: 214 | catsup themes 215 | 216 | Options: 217 | -h --help Show this screen and exit. 218 | """ 219 | from catsup.parser.themes import list_themes 220 | 221 | list_themes() 222 | 223 | 224 | @parguments.command 225 | def install(name): 226 | """ 227 | Usage: 228 | catsup install 229 | 230 | Options: 231 | -h --help Show this screen and exit. 232 | """ 233 | from catsup.themes.install import install_theme 234 | 235 | install_theme(name=name) 236 | 237 | 238 | def main(): 239 | parguments.run() 240 | -------------------------------------------------------------------------------- /catsup/deploy.py: -------------------------------------------------------------------------------- 1 | import os 2 | import datetime 3 | import shutil 4 | 5 | from catsup.logger import logger 6 | from catsup.utils import call 7 | 8 | 9 | RSYNC_COMMAND = ( 10 | "rsync -avze 'ssh -p {ssh_port}' {args}" 11 | " {deploy_dir}/ {ssh_user}@{ssh_host}:{document_root}" 12 | ) 13 | 14 | 15 | def git(config): 16 | logger.info("Deploying your site via git") 17 | 18 | cwd = os.path.abspath(config.config.output) 19 | 20 | def _call(*args, **kwargs): 21 | return call(*args, cwd=cwd, **kwargs) 22 | 23 | dot_git_path = os.path.join(cwd, ".git") 24 | 25 | if os.path.exists(dot_git_path): 26 | if _call("git remote -v | grep %s" % config.deploy.git.repo) == 0: 27 | shutil.rmtree(dot_git_path) 28 | if not os.path.exists(dot_git_path): 29 | _call("git init") 30 | _call("git remote add origin %s" % config.deploy.git.repo) 31 | if _call("git checkout %s" % config.deploy.git.branch) != 0: 32 | _call("git branch -m %s" % config.deploy.git.branch) 33 | if config.deploy.git.delete: 34 | _call("rm -rf *") 35 | 36 | from catsup.generator import Generator 37 | 38 | generator = Generator(config.path) 39 | generator.generate() 40 | 41 | _call("git add .", silence=True) 42 | _call( 43 | 'git commit -m "Update at %s"' % str(datetime.datetime.utcnow()), silence=True 44 | ) 45 | _call("git push origin %s --force" % config.deploy.git.branch) 46 | 47 | 48 | def rsync(config): 49 | logger.info("Deploying your site via rsync") 50 | if config.deploy.rsync.delete: 51 | args = "--delete" 52 | else: 53 | args = "" 54 | cmd = RSYNC_COMMAND.format( 55 | ssh_port=config.deploy.rsync.ssh_port, 56 | args=args, 57 | deploy_dir=config.config.output, 58 | ssh_user=config.deploy.rsync.ssh_user, 59 | ssh_host=config.deploy.rsync.ssh_host, 60 | document_root=config.deploy.rsync.document_root, 61 | ) 62 | call(cmd) 63 | -------------------------------------------------------------------------------- /catsup/generator/__init__.py: -------------------------------------------------------------------------------- 1 | import time 2 | import os 3 | import catsup.parser 4 | 5 | from catsup.logger import logger 6 | from catsup.generator.renderer import Renderer 7 | from catsup.reader import get_reader 8 | from catsup.options import g 9 | from catsup.utils import smart_copy 10 | from catsup.models import * 11 | 12 | 13 | class Generator(object): 14 | def __init__(self, config_path, local=False, base_url=None): 15 | self.config_path = config_path 16 | self.local = local 17 | 18 | self.base_url = base_url 19 | g.generator = self 20 | 21 | self.posts = [] 22 | self.pages = [] 23 | self.non_post_files = [] 24 | self.archives = [] 25 | self.tags = [] 26 | self.caches = [] 27 | self.config = {} 28 | self.renderer = None 29 | self.reset() 30 | 31 | def reset(self): 32 | self.posts = [] 33 | self.pages = [] 34 | self.non_post_files = [] 35 | self.archives = g.archives = Archives() 36 | self.tags = g.tags = Tags() 37 | self.load_config() 38 | self.load_posts() 39 | self.load_renderer() 40 | self.caches = {"static_url": {}, "url_for": {}} 41 | 42 | def load_config(self): 43 | self.config = g.config = catsup.parser.config( 44 | self.config_path, local=self.local, base_url=self.base_url 45 | ) 46 | 47 | def load_posts(self): 48 | for f in os.listdir(g.source): 49 | if f.startswith("."): # hidden file 50 | continue 51 | filename, ext = os.path.splitext(f) 52 | ext = ext.lower()[1:] 53 | reader = get_reader(ext) 54 | if reader is not None: 55 | logger.info("Loading file %s" % filename) 56 | path = os.path.join(g.source, f) 57 | post = reader(path) 58 | if post.type == "page": 59 | self.pages.append(post) 60 | else: 61 | self.posts.append(post) 62 | else: 63 | self.non_post_files.append(f) 64 | self.posts.sort(key=lambda x: x.datetime, reverse=True) 65 | 66 | def load_renderer(self): 67 | templates_path = [ 68 | g.public_templates_path, 69 | os.path.join(g.theme.path, "templates"), 70 | ] 71 | self.renderer = Renderer(templates_path=templates_path, generator=self) 72 | 73 | def add_archives_and_tags(self): 74 | for post in self.posts: 75 | post.add_archive_and_tags() 76 | 77 | def generate_feed(self): 78 | feed = Feed(self.posts) 79 | feed.render(self.renderer) 80 | 81 | def generate_pages(self): 82 | page = Page(self.posts) 83 | page.render_all(self.renderer) 84 | 85 | def generate_posts(self): 86 | for post in self.posts: 87 | post.render(self.renderer) 88 | for page in self.pages: 89 | page.render(self.renderer) 90 | 91 | def generate_tags(self): 92 | self.tags.render(self.renderer) 93 | 94 | def generate_archives(self): 95 | self.archives.render(self.renderer) 96 | 97 | def generate_other_pages(self): 98 | NotFound().render(self.renderer) 99 | 100 | def copy_static_files(self): 101 | static_path = self.config.config.static_output 102 | 103 | smart_copy(os.path.join(g.theme.path, "static"), static_path) 104 | smart_copy(self.config.config.static_source, static_path) 105 | for f in self.non_post_files: 106 | smart_copy( 107 | os.path.join(g.source, f), os.path.join(self.config.config.output, f) 108 | ) 109 | 110 | def generate(self): 111 | started_loading = time.time() 112 | self.reset() 113 | self.add_archives_and_tags() 114 | finish_loading = time.time() 115 | logger.info( 116 | "Loaded config and %s posts in %.3fs" 117 | % (len(self.posts), finish_loading - started_loading) 118 | ) 119 | if self.posts: 120 | self.generate_posts() 121 | self.generate_tags() 122 | self.generate_archives() 123 | self.generate_feed() 124 | self.generate_pages() 125 | else: 126 | logger.warning("Can't find any post.") 127 | self.generate_other_pages() 128 | self.copy_static_files() 129 | self.renderer.render_sitemap() 130 | finish_generating = time.time() 131 | logger.info( 132 | "Generated %s posts in %.3fs" 133 | % (len(self.posts), finish_generating - finish_loading) 134 | ) 135 | logger.info( 136 | "Generating finished in %.3fs" % (finish_generating - started_loading) 137 | ) 138 | -------------------------------------------------------------------------------- /catsup/generator/renderer.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from jinja2 import Environment, FileSystemLoader, TemplateNotFound 4 | from catsup.options import g 5 | from catsup.utils import mkdir, static_url, url_for, urljoin 6 | 7 | 8 | class Renderer(object): 9 | def __init__(self, templates_path, generator): 10 | self.env = Environment( 11 | loader=FileSystemLoader(templates_path), autoescape=False 12 | ) 13 | config = generator.config 14 | 15 | self.env.globals.update( 16 | generator=generator, 17 | site=config.site, 18 | config=config.config, 19 | author=config.author, 20 | comment=config.comment, 21 | theme=config.theme.vars, 22 | g=g, 23 | pages=generator.pages, 24 | static_url=static_url, 25 | url_for=url_for, 26 | ) 27 | 28 | catsup_filter_path = os.path.join(g.catsup_path, "templates", "filters.py") 29 | theme_filter_path = os.path.join(g.theme.path, "filters.py") 30 | self.load_filters_from_pyfile(catsup_filter_path) 31 | self.load_filters_from_pyfile(theme_filter_path) 32 | self.rendered_permalinks = [] 33 | 34 | def load_filters_from_pyfile(self, path): 35 | if not os.path.exists(path): 36 | return 37 | filters = {} 38 | exec(open(path).read(), {}, filters) 39 | self.env.filters.update(filters) 40 | 41 | def render(self, template, **kwargs): 42 | try: 43 | return self.env.get_template(template).render(**kwargs) 44 | except TemplateNotFound: 45 | # logger.warning("Template not found: %s" % template) 46 | pass 47 | 48 | def render_to(self, template, permalink, **kwargs): 49 | html = self.render(template, **kwargs) 50 | if not html: 51 | return 52 | permalink, output_name = urljoin(g.base_url, permalink), permalink 53 | kwargs.setdefault("permalink", permalink) 54 | self.rendered_permalinks.append(permalink) 55 | if output_name.endswith("/") or "." not in output_name: 56 | output_name = output_name.rstrip("/") 57 | output_name += "/index.html" 58 | output_path = os.path.join(g.output, output_name.lstrip("/")) 59 | output_path = output_path.encode("utf-8") 60 | mkdir(os.path.dirname(output_path)) 61 | with open(output_path, "w") as f: 62 | f.write(html) 63 | 64 | def render_sitemap(self): 65 | with open(os.path.join(g.output, "sitemap.txt"), "w") as f: 66 | f.write("\n".join(self.rendered_permalinks)) 67 | -------------------------------------------------------------------------------- /catsup/generator/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtsky/Catsup/e7db1ce7d84cef7efc9923b9bd9047319fc9822e/catsup/generator/utils.py -------------------------------------------------------------------------------- /catsup/logger.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import time 3 | import logging 4 | 5 | try: 6 | import curses 7 | 8 | assert curses 9 | except ImportError: 10 | curses = None 11 | 12 | unicode = str 13 | 14 | logger = logging.getLogger() 15 | 16 | 17 | def enable_pretty_logging(level="info"): 18 | """Turns on formatted logging output as configured. 19 | 20 | This is called automatically by `parse_command_line`. 21 | """ 22 | logger.setLevel(getattr(logging, level.upper())) 23 | 24 | if not logger.handlers: 25 | # Set up color if we are in a tty and curses is installed 26 | color = False 27 | if curses and sys.stderr.isatty(): 28 | try: 29 | curses.setupterm() 30 | if curses.tigetnum("colors") > 0: 31 | color = True 32 | except Exception: 33 | pass 34 | channel = logging.StreamHandler() 35 | channel.setFormatter(_LogFormatter(color=color)) 36 | logger.addHandler(channel) 37 | 38 | 39 | class _LogFormatter(logging.Formatter): 40 | def __init__(self, color, *args, **kwargs): 41 | logging.Formatter.__init__(self, *args, **kwargs) 42 | self._color = color 43 | if color: 44 | fg_color = curses.tigetstr("setaf") or curses.tigetstr("setf") or "" 45 | if (3, 0) < sys.version_info < (3, 2, 3): 46 | fg_color = str(fg_color, "ascii") 47 | self._colors = { 48 | logging.DEBUG: str(curses.tparm(fg_color, 4), "ascii"), # Blue 49 | logging.INFO: str(curses.tparm(fg_color, 2), "ascii"), # Green 50 | logging.WARNING: str(curses.tparm(fg_color, 3), "ascii"), # Yellow 51 | logging.ERROR: str(curses.tparm(fg_color, 1), "ascii"), # Red 52 | } 53 | self._normal = str(curses.tigetstr("sgr0"), "ascii") 54 | 55 | def format(self, record): 56 | try: 57 | record.message = record.getMessage() 58 | except Exception as e: 59 | record.message = "Bad message (%r): %r" % (e, record.__dict__) 60 | record.asctime = time.strftime( 61 | "%y%m%d %H:%M:%S", self.converter(record.created) 62 | ) 63 | prefix = "[%(levelname)1.1s %(asctime)s]" % record.__dict__ 64 | if self._color: 65 | prefix = ( 66 | self._colors.get(record.levelno, self._normal) + prefix + self._normal 67 | ) 68 | formatted = prefix + " " + record.message 69 | if record.exc_info: 70 | if not record.exc_text: 71 | record.exc_text = self.formatException(record.exc_info) 72 | if record.exc_text: 73 | formatted = formatted.rstrip() + "\n" + record.exc_text 74 | return formatted.replace("\n", "\n ") 75 | -------------------------------------------------------------------------------- /catsup/models.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import os 4 | import re 5 | 6 | from datetime import datetime 7 | 8 | from catsup.options import g 9 | from catsup.utils import html_to_raw_text 10 | from .utils import Pagination 11 | 12 | 13 | class CatsupPage(object): 14 | @property 15 | def class_name(self): 16 | return self.__class__.__name__.lower() 17 | 18 | def get_permalink_args(self): 19 | return {} 20 | 21 | @property 22 | def permalink(self): 23 | kwargs = self.__dict__.copy() 24 | kwargs.update(self.get_permalink_args()) 25 | return g.permalink[self.class_name].format(**kwargs).replace(" ", "-") 26 | 27 | def render(self, renderer, **kwargs): 28 | if hasattr(self, "template_name"): 29 | template_name = self.template_name 30 | else: 31 | template_name = self.class_name + ".html" 32 | kwargs[self.class_name] = self 33 | kwargs.update(self.__dict__) 34 | renderer.render_to(template_name, self.permalink, **kwargs) 35 | 36 | 37 | class Tag(CatsupPage): 38 | def __init__(self, name): 39 | self.name = name 40 | self.posts = [] 41 | 42 | def add_post(self, post): 43 | self.posts.append(post) 44 | 45 | @property 46 | def count(self): 47 | return len(self.posts) 48 | 49 | def __iter__(self): 50 | for post in self.posts: 51 | yield post 52 | 53 | 54 | class Tags(CatsupPage): 55 | def __init__(self, tags=None): 56 | if tags is None: 57 | tags = {} 58 | self.tags_dict = tags 59 | 60 | def get(self, name): 61 | return self.tags_dict.setdefault(name, Tag(name)) 62 | 63 | def render(self, renderer, **kwargs): 64 | for tag in self.tags: 65 | tag.render(renderer) 66 | super(Tags, self).render(renderer, **kwargs) 67 | 68 | @property 69 | def tags(self): 70 | if not hasattr(self, "_tags"): 71 | self._tags = list(self.tags_dict.values()) 72 | self._tags.sort(key=lambda x: x.count, reverse=True) 73 | return self._tags 74 | 75 | def __iter__(self): 76 | for tag in self.tags: 77 | yield tag 78 | 79 | 80 | class Archive(CatsupPage): 81 | def __init__(self, year): 82 | self.year = int(year) 83 | self.posts = [] 84 | 85 | def add_post(self, post): 86 | self.posts.append(post) 87 | 88 | @property 89 | def count(self): 90 | return len(self.posts) 91 | 92 | def __iter__(self): 93 | for post in self.posts: 94 | yield post 95 | 96 | 97 | class Archives(CatsupPage): 98 | def __init__(self, archives=None): 99 | if archives is None: 100 | archives = {} 101 | self.archives_dict = archives 102 | 103 | def get(self, year): 104 | return self.archives_dict.setdefault(year, Archive(year)) 105 | 106 | def render(self, renderer, **kwargs): 107 | for tag in self.archives: 108 | tag.render(renderer) 109 | super(Archives, self).render(renderer, **kwargs) 110 | 111 | @property 112 | def archives(self): 113 | if not hasattr(self, "_archives"): 114 | self._archives = list(self.archives_dict.values()) 115 | self._archives.sort(key=lambda x: x.year, reverse=True) 116 | return self._archives 117 | 118 | def __iter__(self): 119 | for archive in self.archives: 120 | yield archive 121 | 122 | 123 | class Post(CatsupPage): 124 | DATE_RE = re.compile("\d{4}\-\d{2}\-\d{2}") 125 | 126 | def __init__(self, path, meta, content): 127 | self.path = path 128 | self.filename, _ = os.path.splitext(os.path.basename(path)) 129 | self.meta = meta 130 | self.content = content 131 | self.tags = [] 132 | self.date = self.datetime.strftime("%Y-%m-%d") 133 | 134 | filename, _ = os.path.splitext(os.path.basename(path)) 135 | if self.DATE_RE.match(filename[:10]): 136 | self.meta.setdefault("date", filename[:10]) 137 | self.filename = filename[11:] 138 | else: 139 | self.filename = filename 140 | 141 | if "date" in self.meta: 142 | self.date = self.meta.date 143 | else: 144 | self.date = self.datetime.strftime("%Y-%m-%d") 145 | 146 | def add_archive_and_tags(self): 147 | year = self.datetime.strftime("%Y") 148 | g.archives.get(year).add_post(self) 149 | 150 | for tag in self.meta.pop("tags", "").split(","): 151 | tag = tag.strip() 152 | tag = g.tags.get(tag) 153 | tag.add_post(self) 154 | self.tags.append(tag) 155 | 156 | @property 157 | def permalink(self): 158 | if "permalink" in self.meta: 159 | return self.meta.permalink 160 | return super(Post, self).permalink 161 | 162 | def get_permalink_args(self): 163 | args = self.meta.copy() 164 | args.update(title=self.title, datetime=self.datetime) 165 | return args 166 | 167 | @property 168 | def datetime(self): 169 | import os 170 | 171 | if "time" in self.meta: 172 | return datetime.strptime(self.meta.time, "%Y-%m-%d %H:%M") 173 | elif "date" in self.meta: 174 | return datetime.strptime(self.meta.date, "%Y-%m-%d") 175 | st_ctime = os.stat(self.path).st_ctime 176 | return datetime.fromtimestamp(st_ctime) 177 | 178 | @property 179 | def description(self): 180 | if "description" not in self.meta: 181 | description = self.meta.get("description", self.content).replace("\n", "") 182 | description = html_to_raw_text(description) 183 | if " 150: 188 | description = description[:150] 189 | self.meta.description = description.strip() 190 | return self.meta.description 191 | 192 | @property 193 | def allow_comment(self): 194 | if self.meta.get("comment", None) == "disabled": 195 | return False 196 | else: 197 | return g.config.comment.allow 198 | 199 | @property 200 | def title(self): 201 | return self.meta.get("title", self.filename) 202 | 203 | @property 204 | def type(self): 205 | return self.meta.type 206 | 207 | 208 | class Page(CatsupPage): 209 | def __init__(self, posts): 210 | self.posts = posts 211 | self.per_page = g.theme.post_per_page 212 | 213 | @staticmethod 214 | def get_permalink(page): 215 | if page == 1: 216 | return "/" 217 | return g.permalink["page"].format(page=page) 218 | 219 | @property 220 | def permalink(self): 221 | return Page.get_permalink(self.page) 222 | 223 | def render_all(self, renderer): 224 | count = int((len(self.posts) - 1) / self.per_page) + 1 225 | for i in range(count): 226 | page = i + 1 227 | if page == 1: 228 | self._permalink = "/" 229 | self.page = page 230 | pagination = Pagination( 231 | page=page, 232 | posts=self.posts, 233 | per_page=self.per_page, 234 | get_permalink=self.get_permalink, 235 | ) 236 | self.render(renderer=renderer, pagination=pagination) 237 | 238 | 239 | class Feed(CatsupPage): 240 | def __init__(self, posts): 241 | self.posts = posts 242 | self.template_name = "feed.xml" 243 | 244 | 245 | class NotFound(CatsupPage): 246 | def __init__(self): 247 | self.template_name = "404.html" 248 | 249 | @property 250 | def permalink(self): 251 | return "/404.html" 252 | -------------------------------------------------------------------------------- /catsup/options.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from catsup.utils import ObjectDict 4 | 5 | g = ObjectDict() 6 | 7 | g.catsup_path = os.path.abspath(os.path.dirname(__file__)) 8 | g.public_templates_path = os.path.join(g.catsup_path, "templates") 9 | g.cwdpath = os.path.abspath(".") 10 | -------------------------------------------------------------------------------- /catsup/parser/__init__.py: -------------------------------------------------------------------------------- 1 | from .config import load 2 | 3 | 4 | def config(*args, **kwargs): 5 | return load(*args, **kwargs) 6 | -------------------------------------------------------------------------------- /catsup/parser/config.py: -------------------------------------------------------------------------------- 1 | import os 2 | import ujson 3 | 4 | from catsup.logger import logger 5 | from catsup.options import g 6 | from catsup.utils import update_nested_dict, urljoin, ObjectDict 7 | from catsup.parser.themes import find_theme 8 | 9 | from .utils import add_slash 10 | 11 | 12 | def parse(path): 13 | """ 14 | Parser json configuration file 15 | """ 16 | try: 17 | f = open(path, "r") 18 | except IOError: 19 | logger.error( 20 | "Can't find config file." "Run `catsup init` to generate a new config file." 21 | ) 22 | exit(1) 23 | return update_nested_dict(ObjectDict(), ujson.load(f)) 24 | 25 | 26 | def load(path=None, local=False, base_url=None): 27 | # Read default configuration file first. 28 | # So catsup can use the default value when user's conf is missing. 29 | # And user does't have to change conf file everytime he updates catsup. 30 | default_config = os.path.join(g.public_templates_path, "config.json") 31 | config = parse(default_config) 32 | 33 | if path: 34 | user_config = parse(path) 35 | config = update_nested_dict(config, user_config) 36 | os.chdir(os.path.abspath(os.path.dirname(path))) 37 | g.theme = find_theme(config) 38 | g.source = config.config.source 39 | g.output = config.config.output 40 | g.permalink = config.permalink 41 | if base_url: 42 | g.base_url = add_slash(base_url) 43 | else: 44 | g.base_url = add_slash(config.site.url) 45 | config.site.url = g.base_url 46 | if local: 47 | import tempfile 48 | 49 | config.config.static_prefix = "/static/" 50 | config.config.output = tempfile.mkdtemp() 51 | 52 | g.static_prefix = urljoin(g.base_url, add_slash(config.config.static_prefix)) 53 | 54 | g.theme.vars = update_nested_dict(g.theme.vars, config.theme.vars) 55 | config.theme.vars = g.theme.vars 56 | config.path = path 57 | return config 58 | -------------------------------------------------------------------------------- /catsup/parser/themes.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from __future__ import with_statement 3 | 4 | import sys 5 | import os 6 | 7 | from catsup.logger import logger 8 | from catsup.options import g 9 | from catsup.utils import ObjectDict 10 | 11 | 12 | def read_theme(path): 13 | """ 14 | :param path: path for the theme. 15 | :return: Theme theme read in path. 16 | """ 17 | if not os.path.exists(path): 18 | return 19 | theme_file = os.path.join(path, "theme.py") 20 | if not os.path.exists(theme_file): 21 | logger.warn("%s is not a catsup theme." % path) 22 | return 23 | theme = ObjectDict( 24 | name="", author="", homepage="", path=path, post_per_page=5, vars={}, 25 | ) 26 | exec(open(theme_file).read(), {}, theme) 27 | theme.name = theme.name.lower() 28 | return theme 29 | 30 | 31 | def find_theme(config=None, theme_name="", silence=False): 32 | if not theme_name: 33 | theme_name = config.theme.name 34 | theme_name = theme_name.lower() 35 | theme_gallery = [ 36 | os.path.join(os.path.abspath("themes"), theme_name), 37 | os.path.join(g.catsup_path, "themes", theme_name), 38 | ] 39 | for path in theme_gallery: 40 | theme = read_theme(path) 41 | if theme: 42 | return theme 43 | 44 | if not silence: 45 | logger.error("Can't find theme: {name}".format(name=theme_name)) 46 | exit(1) 47 | 48 | 49 | def list_themes(): 50 | theme_gallery = [ 51 | os.path.abspath("themes"), 52 | os.path.join(g.catsup_path, "themes"), 53 | ] 54 | themes = [] 55 | for path in theme_gallery: 56 | if not os.path.exists(path): 57 | continue 58 | names = os.listdir(path) 59 | for name in names: 60 | if name == "__pycache__": 61 | continue 62 | theme_path = os.path.join(path, name) 63 | if os.path.isdir(theme_path): 64 | themes.append(name) 65 | print("Available themes: \n") 66 | themes_text = [] 67 | for name in themes: 68 | theme = find_theme(theme_name=name) 69 | themes_text.append( 70 | "\n".join( 71 | [ 72 | "Name: %s" % theme.name, 73 | "Author: %s" % theme.author, 74 | "HomePage: %s" % theme.homepage, 75 | ] 76 | ) 77 | ) 78 | print("\n--------\n".join(themes_text)) 79 | -------------------------------------------------------------------------------- /catsup/parser/utils.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from catsup.options import g 4 | from catsup.utils import mkdir 5 | 6 | 7 | def add_slash(url): 8 | if "//" in url: 9 | return url.rstrip("/") + "/" 10 | return "/%s/" % url.strip("/") 11 | 12 | 13 | def get_template(): 14 | default_config_path = os.path.join(g.public_templates_path, "config.json") 15 | return open(default_config_path, "r").read() 16 | 17 | 18 | def create_config_file(path=None): 19 | if path: 20 | os.chdir(path) 21 | 22 | current_dir = os.getcwd() 23 | config_path = os.path.join(current_dir, "config.json") 24 | 25 | if os.path.exists(config_path): 26 | from catsup.logger import logger 27 | 28 | logger.warning("Config file already exist.") 29 | exit(1) 30 | 31 | mkdir("posts") 32 | mkdir("static") 33 | 34 | template = get_template() 35 | 36 | with open(config_path, "w") as f: 37 | f.write(template) 38 | 39 | print( 40 | "Created a new config file." "Please configure your blog by editing config.json" 41 | ) 42 | -------------------------------------------------------------------------------- /catsup/reader/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding:utf-8 -*- 2 | 3 | from .markdown import markdown_reader 4 | from .txt import txt_reader 5 | from .html import html_reader 6 | 7 | READERS = dict() 8 | 9 | 10 | def register_reader(ext, f): 11 | if isinstance(ext, (list, tuple)): 12 | for e in ext: 13 | READERS[e.lower()] = f 14 | else: 15 | READERS[ext.lower()] = f 16 | 17 | 18 | def get_reader(ext): 19 | return READERS.get(ext, None) 20 | 21 | 22 | register_reader(["md", "markdown"], markdown_reader) 23 | register_reader("txt", txt_reader) 24 | register_reader(["htm", "html"], html_reader) 25 | -------------------------------------------------------------------------------- /catsup/reader/html.py: -------------------------------------------------------------------------------- 1 | from catsup.models import Post 2 | from catsup.utils import to_unicode, ObjectDict 3 | from catsup.reader.meta import parse_yaml_meta 4 | from catsup.reader.utils import split_content 5 | 6 | 7 | def html_reader(path): 8 | meta, content = split_content(path) 9 | if not meta: 10 | meta = ObjectDict() 11 | else: 12 | meta = parse_yaml_meta(meta, path) 13 | return Post(path=path, meta=meta, content=to_unicode(content)) 14 | -------------------------------------------------------------------------------- /catsup/reader/markdown.py: -------------------------------------------------------------------------------- 1 | import misaka as m 2 | 3 | from houdini import escape_html 4 | 5 | from pygments import highlight 6 | from pygments.formatters import HtmlFormatter 7 | from pygments.lexers import get_lexer_by_name 8 | from pygments.util import ClassNotFound 9 | 10 | from catsup.models import Post 11 | from catsup.utils import ObjectDict 12 | from catsup.reader.meta import parse_meta 13 | from catsup.reader.utils import split_content 14 | 15 | 16 | class CatsupRender(m.HtmlRenderer, m.SmartyPants): 17 | def block_code(self, text, lang): 18 | try: 19 | lexer = get_lexer_by_name(lang, stripall=True) 20 | except ClassNotFound: 21 | text = escape_html(text.strip()) 22 | return "\n
%s
\n" % text 23 | else: 24 | formatter = HtmlFormatter() 25 | return highlight(text, lexer, formatter) 26 | 27 | def autolink(self, link, is_email): 28 | if is_email: 29 | s = '{link}' 30 | elif link.endswith((".jpg", ".png", ".gif", ".jpeg")): 31 | s = '' 32 | else: 33 | s = '{link}' 34 | return s.format(link=link) 35 | 36 | 37 | md = m.Markdown( 38 | CatsupRender(flags=m.HTML_USE_XHTML), 39 | extensions=m.EXT_FENCED_CODE 40 | | m.EXT_NO_INTRA_EMPHASIS 41 | | m.EXT_AUTOLINK 42 | | m.EXT_STRIKETHROUGH 43 | | m.EXT_SUPERSCRIPT, 44 | ) 45 | 46 | 47 | def markdown_reader(path): 48 | meta, content = split_content(path) 49 | content = content.replace("\n", " \n") 50 | if not meta: 51 | meta = ObjectDict() 52 | else: 53 | meta = parse_meta(meta, path) 54 | return Post(path=path, meta=meta, content=md.render(content)) 55 | -------------------------------------------------------------------------------- /catsup/reader/meta.py: -------------------------------------------------------------------------------- 1 | # -*- coding:utf-8 -*- 2 | 3 | import yaml 4 | 5 | from houdini import escape_html 6 | from catsup.reader.utils import not_valid 7 | from catsup.utils import update_nested_dict, ObjectDict 8 | 9 | 10 | def read_base_meta(path): 11 | meta = ObjectDict(type="post") 12 | if path: 13 | pass 14 | return meta 15 | 16 | 17 | def parse_meta(lines, path=None): 18 | lines = [l.strip() for l in lines if l] 19 | if lines[0].startswith("#"): 20 | return parse_catsup_meta(lines, path) 21 | elif lines[0].startswith("---"): 22 | return parse_yaml_meta(lines, path) 23 | else: 24 | not_valid(path) 25 | 26 | 27 | def parse_yaml_meta(lines, path=None): 28 | title_line = lines.pop(0) 29 | if not title_line.startswith("---"): 30 | not_valid(path) 31 | meta = read_base_meta(path) 32 | meta.update(yaml.load("\n".join(lines))) 33 | return update_nested_dict(ObjectDict(), meta) 34 | 35 | 36 | def parse_catsup_meta(lines, path=None): 37 | meta = read_base_meta(path) 38 | if lines[0][0] == "#": 39 | meta.title = escape_html(lines.pop(0)[1:].strip()) 40 | for line in lines: 41 | if not line: 42 | continue 43 | if ":" not in line: 44 | not_valid(path) 45 | name, value = line.split(":", 1) 46 | name = name.strip().lstrip("-").strip().lower() 47 | meta[name] = value.strip() 48 | return meta 49 | -------------------------------------------------------------------------------- /catsup/reader/txt.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | from houdini import escape_html 4 | 5 | from catsup.utils import to_unicode 6 | from catsup.reader.html import html_reader 7 | 8 | 9 | def txt_reader(path): 10 | post = html_reader(path) 11 | content = post.content.encode("utf-8") 12 | content = escape_html(content) 13 | content = content.replace("\n", "
") 14 | post.content = to_unicode(content) 15 | return post 16 | -------------------------------------------------------------------------------- /catsup/reader/utils.py: -------------------------------------------------------------------------------- 1 | # -*- coding:utf-8 -*- 2 | 3 | import codecs 4 | 5 | from catsup.logger import logger 6 | from catsup.utils import to_unicode 7 | 8 | 9 | def open_file(path): 10 | try: 11 | return codecs.open(path, "r", encoding="utf-8") 12 | except IOError: 13 | logger.error("Can't open file %s" % path) 14 | exit(1) 15 | 16 | 17 | def not_valid(path): 18 | logger.error("%s is not a valid post." % path) 19 | exit(1) 20 | 21 | 22 | def split_content(path): 23 | file = open_file(path) 24 | 25 | lines = [file.readline().strip()] 26 | no_meta = False 27 | 28 | for l in file: 29 | l = l.strip() 30 | if l.startswith("---"): 31 | break 32 | elif l: 33 | lines.append(l) 34 | else: 35 | no_meta = True 36 | if no_meta: 37 | return [], to_unicode("\n".join(lines)) 38 | else: 39 | return lines, to_unicode("".join(file)) 40 | -------------------------------------------------------------------------------- /catsup/server.py: -------------------------------------------------------------------------------- 1 | import os 2 | import catsup 3 | import tornado.web 4 | import tornado.httpserver 5 | import tornado.ioloop 6 | import tornado.autoreload 7 | 8 | from watchdog.observers import Observer 9 | from watchdog.events import FileSystemEventHandler 10 | 11 | from catsup.generator import Generator 12 | from catsup.logger import logger 13 | from catsup.options import g 14 | from catsup.utils import call 15 | 16 | 17 | class CatsupEventHandler(FileSystemEventHandler): 18 | def __init__(self, generator): 19 | self.generator = generator 20 | 21 | def on_any_event(self, event): 22 | logger.info("Captured a file change. Regenerate..") 23 | try: 24 | self.generator.generate() 25 | except: 26 | logger.error("Error when generating:", exc_info=True) 27 | 28 | 29 | class CatsupHandler(tornado.web.RequestHandler): 30 | def set_default_headers(self): 31 | self.set_header("Server", "Catsup/%s" % catsup.__version__) 32 | 33 | def log_exception(self, typ, value, tb): 34 | pass 35 | 36 | 37 | class WebhookHandler(CatsupHandler): 38 | def initialize(self, path, generate): 39 | self.path = path 40 | self.generate = generate 41 | 42 | def get(self): 43 | call("git pull", cwd=self.path) 44 | self.generate() 45 | self.write("success.") 46 | 47 | def post(self): 48 | self.get() 49 | 50 | 51 | class StaticFileHandler(CatsupHandler, tornado.web.StaticFileHandler): 52 | pass 53 | 54 | 55 | class CatsupServer(object): 56 | def __init__(self, settings, port): 57 | self.ioloop = tornado.ioloop.IOLoop.instance() 58 | self.generator = Generator(settings) 59 | self.port = port 60 | 61 | @property 62 | def application(self): 63 | raise NotImplementedError() 64 | 65 | def prepare(self): 66 | pass 67 | 68 | def generate(self): 69 | self.generator.generate() 70 | 71 | def run(self): 72 | self.generate() 73 | self.prepare() 74 | application = self.application 75 | application.settings["log_function"] = lambda x: None 76 | application.settings["static_handler_class"] = StaticFileHandler 77 | http_server = tornado.httpserver.HTTPServer(application, io_loop=self.ioloop) 78 | http_server.listen(self.port) 79 | logger.info("Start server at port %s" % self.port) 80 | self.ioloop.start() 81 | 82 | 83 | class PreviewServer(CatsupServer): 84 | def __init__(self, settings, port): 85 | super(PreviewServer, self).__init__(settings, port) 86 | self.generator = Generator( 87 | settings, local=True, base_url="http://127.0.0.1:%s/" % port 88 | ) 89 | 90 | @property 91 | def application(self): 92 | params = {"path": g.output, "default_filename": "index.html"} 93 | return tornado.web.Application([(r"/(.*)", StaticFileHandler, params),]) 94 | 95 | def prepare(self): 96 | # Reload server when catsup modified. 97 | tornado.autoreload.start(self.ioloop) 98 | tornado.autoreload.add_reload_hook(self.generate) 99 | 100 | event_handler = CatsupEventHandler(self.generator) 101 | observer = Observer() 102 | for path in [self.generator.config.config.source, g.theme.path]: 103 | path = os.path.abspath(path) 104 | observer.schedule(event_handler, path=path, recursive=True) 105 | observer.start() 106 | 107 | 108 | class WebhookServer(CatsupServer): 109 | @property 110 | def application(self): 111 | git_path = "" 112 | for path in ["", self.generator.config.config.source]: 113 | path = os.path.abspath(os.path.join(g.cwdpath, path)) 114 | if os.path.exists(os.path.join(path, ".git")): 115 | git_path = path 116 | break 117 | if not git_path: 118 | logger.error("Can't find git repository.") 119 | exit(1) 120 | params = {"path": git_path, "generate": self.generate} 121 | return tornado.web.Application([(r"/.*?", WebhookHandler, params),]) 122 | -------------------------------------------------------------------------------- /catsup/templates/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "site": { 3 | "name": "blogname", 4 | "description": "Just another catsup blog", 5 | "url": "http://blog.com/" 6 | }, 7 | 8 | "author": { 9 | "name": "nickname", 10 | "email": "name@exmaple.com", 11 | "twitter": "twitter" 12 | }, 13 | 14 | "config": { 15 | "source": "posts", 16 | "static_source": "static", 17 | "output": "deploy", 18 | "static_output": "deploy/static", 19 | "static_prefix": "/static/", 20 | "analytics": "" 21 | }, 22 | 23 | "permalink": { 24 | "page": "/page/{page}/", 25 | "post": "/{filename}/", 26 | "tag": "/tag/{name}/", 27 | "tags": "/tag/index.html", 28 | "archive": "/archive/{year}/", 29 | "archives": "/archive/index.html", 30 | "feed": "/feed.xml" 31 | }, 32 | 33 | "comment": { 34 | "allow": true, 35 | "system": "disqus", 36 | "shortname": "catsup" 37 | }, 38 | 39 | "deploy": { 40 | "default": "rsync", 41 | 42 | "git": { 43 | "repo": "repo url here", 44 | "branch": "master", 45 | "delete": true 46 | }, 47 | 48 | "rsync": { 49 | "ssh_port": 22, 50 | "ssh_user": "username", 51 | "ssh_host": "123.45.6.78", 52 | "document_root": "~/website.com/", 53 | "delete": true 54 | } 55 | }, 56 | 57 | "theme": { 58 | "name": "sealscript", 59 | "vars": { 60 | "github": "whtsky", 61 | "links": [ 62 | { 63 | "name": "catsup", 64 | "url": "https://github.com/whtsky/catsup", 65 | "description": "Awesome!" 66 | } 67 | ] 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /catsup/templates/feed.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ site.name }} 4 | 5 | 6 | {{ posts[0].datetime | xmldatetime }} 7 | {{ site.url }} 8 | {% for post in posts[:5] %} 9 | 10 | <![CDATA[{{ post.title }}]]> 11 | {{ author.name }}{{ site.url }} 12 | 13 | {{ post.datetime | xmldatetime }} 14 | {{ post.datetime | xmldatetime }} 15 | {{ url_for(post) }} 16 | 17 | 20 | 21 | 22 | {% endfor %} 23 | 24 | -------------------------------------------------------------------------------- /catsup/templates/filters.py: -------------------------------------------------------------------------------- 1 | def xmldatetime(t): 2 | return t.strftime("%Y-%m-%dT%H:%M:%SZ") 3 | -------------------------------------------------------------------------------- /catsup/templates/utils.html: -------------------------------------------------------------------------------- 1 | {% macro render_comment(post) %} 2 | {% if post.allow_comment %} 3 | {% if comment.system == 'disqus'%} 4 |
5 | 13 | {% endif %} 14 | {% if comment.system == 'duoshuo'%} 15 |
16 | 27 | {% endif %} 28 | {% endif %} 29 | {% endmacro %} 30 | 31 | {% macro analytics() %} 32 | {% if config.analytics and not generator.local %} 33 | 46 | {% endif %} 47 | {% endmacro %} 48 | 49 | {% macro meta(post) %} 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | {% endmacro %} -------------------------------------------------------------------------------- /catsup/themes/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = "whtsky" 2 | -------------------------------------------------------------------------------- /catsup/themes/install.py: -------------------------------------------------------------------------------- 1 | import os 2 | import shutil 3 | import tempfile 4 | 5 | from catsup.logger import logger 6 | from catsup.parser.themes import find_theme, read_theme 7 | from catsup.utils import call, mkdir 8 | from catsup.themes.utils import search_github 9 | 10 | THEMES_PATH = os.path.abspath("themes") 11 | 12 | 13 | def install_from_git(clone_url): 14 | mkdir(THEMES_PATH) 15 | os.chdir(THEMES_PATH) 16 | tmp_dir = tempfile.mkdtemp() 17 | os.system( 18 | "git clone {clone_url} {tmp_dir}".format(clone_url=clone_url, tmp_dir=tmp_dir) 19 | ) 20 | theme = read_theme(tmp_dir) 21 | if not theme: 22 | logger.error( 23 | "{clone_url} is not a Catsup theme repo.".format(clone_url=clone_url) 24 | ) 25 | shutil.rmtree(tmp_dir) 26 | if os.path.exists(theme.name): 27 | shutil.rmtree(theme.name) 28 | 29 | shutil.move(tmp_dir, theme.name) 30 | logger.info("Installed theme {name}".format(name=theme.name)) 31 | 32 | 33 | def search_and_install(name): 34 | logger.info("Searching theme {name} on GitHub..".format(name=name)) 35 | item = search_github(name=name) 36 | if not item: 37 | logger.error("Can't find theme {name}.".format(name=name)) 38 | exit(1) 39 | 40 | logger.info("Fount {name} on GitHub.".format(name=item["name"])) 41 | install_from_git(item["clone_url"]) 42 | 43 | 44 | def install_theme(name): 45 | theme = find_theme(theme_name=name, silence=True) 46 | if theme: 47 | # Update theme 48 | if not os.path.exists(os.path.join(theme.path, ".git")): 49 | logger.warn("%s is not installed via git." "Can't update it." % theme.name) 50 | else: 51 | logger.info("Updating theme %s" % theme.name) 52 | call("git pull", cwd=theme.path) 53 | exit(0) 54 | if ".git" in name or "//" in name: 55 | install_from_git(name) 56 | else: 57 | item = search_github(name) 58 | if not item: 59 | logger.error("Can't find {} on GitHub.".format(name)) 60 | exit(1) 61 | install_from_git(item["clone_url"]) 62 | -------------------------------------------------------------------------------- /catsup/themes/utils.py: -------------------------------------------------------------------------------- 1 | try: 2 | from urllib.request import Request, urlopen 3 | from urllib.error import HTTPError 4 | except ImportError: 5 | from urllib2 import Request, urlopen, HTTPError 6 | 7 | import ujson 8 | 9 | from catsup.logger import logger 10 | 11 | 12 | def search_github(name): 13 | repo_name = "catsup-theme-{name}".format(name=name) 14 | url = "https://api.github.com/search/repositories?q=" + repo_name 15 | request = Request(url) 16 | request.add_header("User-Agent", "Catsup Theme Finder") 17 | try: 18 | response = urlopen(request) 19 | except HTTPError as e: 20 | logger.warning("Error when connecting to GitHub: {}".format(e.msg)) 21 | return None 22 | content = response.read() 23 | json = ujson.loads(content) 24 | if json["total_count"] == 0: 25 | return None 26 | for item in json["items"]: 27 | if item["name"] == repo_name: 28 | return {"name": item["name"], "clone_url": item["clone_url"]} 29 | -------------------------------------------------------------------------------- /catsup/utils.py: -------------------------------------------------------------------------------- 1 | import os 2 | import re 3 | import subprocess 4 | 5 | from urllib.parse import urljoin 6 | 7 | from tornado.util import ObjectDict 8 | 9 | from catsup.logger import logger 10 | 11 | HTML_TAG_RE = re.compile("<.*?>") 12 | 13 | 14 | def html_to_raw_text(html): 15 | return "".join(HTML_TAG_RE.split(html)) 16 | 17 | 18 | def static_url(f): 19 | from catsup.options import g 20 | 21 | caches_class = g.generator.caches["static_url"] 22 | if f not in caches_class: 23 | import os 24 | import hashlib 25 | 26 | def get_hash(path): 27 | path = os.path.join(g.theme.path, "static", path) 28 | if not os.path.exists(path): 29 | logger.warn("%s does not exist." % path) 30 | return 31 | 32 | with open(path, "rb") as f: 33 | return hashlib.md5(f.read()).hexdigest() 34 | 35 | hsh = get_hash(f) 36 | url = urljoin(g.static_prefix, "%s?v=%s" % (f, hsh)) 37 | caches_class[f] = url 38 | return caches_class[f] 39 | 40 | 41 | def url_for(obj): 42 | from catsup.options import g 43 | 44 | caches_class = g.generator.caches["url_for"] 45 | key = id(obj) 46 | if key not in caches_class: 47 | from catsup.models import CatsupPage 48 | 49 | url = "" 50 | if obj == "index": 51 | url = g.base_url 52 | elif isinstance(obj, CatsupPage): 53 | url = obj.permalink 54 | elif isinstance(obj, str): 55 | url = g.permalink[obj] 56 | caches_class[key] = urljoin(g.base_url, url) 57 | return caches_class[key] 58 | 59 | 60 | def to_unicode(value): 61 | if isinstance(value, str): 62 | return value 63 | if isinstance(value, int): 64 | return str(value) 65 | if isinstance(value, bytes): 66 | return value.decode("utf-8") 67 | return value 68 | 69 | 70 | def update_nested_dict(a, b): 71 | for k, v in b.items(): 72 | if isinstance(v, dict): 73 | d = a.setdefault(k, ObjectDict()) 74 | update_nested_dict(d, v) 75 | else: 76 | a[k] = v 77 | return a 78 | 79 | 80 | def call(cmd, silence=True, **kwargs): 81 | from catsup.options import g 82 | 83 | kwargs.setdefault("cwd", g.cwdpath) 84 | if silence: 85 | kwargs.setdefault("stdout", subprocess.PIPE) 86 | kwargs.setdefault("shell", True) 87 | return subprocess.call(cmd, **kwargs) 88 | 89 | 90 | def mkdir(path): 91 | if not os.path.exists(path): 92 | os.makedirs(path) 93 | 94 | 95 | def smart_copy(source, target): 96 | if not os.path.exists(source): 97 | return 98 | 99 | def copy_file(source, target): 100 | if os.path.exists(target): 101 | if os.path.getsize(source) == os.path.getsize(target): 102 | return 103 | mkdir(os.path.dirname(target)) 104 | open(target, "wb").write(open(source, "rb").read()) 105 | 106 | if os.path.isfile(source): 107 | return copy_file(source, target) 108 | 109 | for f in os.listdir(source): 110 | sourcefile = os.path.join(source, f) 111 | targetfile = os.path.join(target, f) 112 | if os.path.isfile(sourcefile): 113 | copy_file(sourcefile, targetfile) 114 | else: 115 | smart_copy(sourcefile, targetfile) 116 | 117 | 118 | class Pagination(object): 119 | def __init__(self, page, posts, per_page, get_permalink): 120 | self.total_items = posts 121 | self.page = page 122 | self.per_page = per_page 123 | self.get_permalink = get_permalink 124 | 125 | def iter_pages(self, edge=4): 126 | if self.page <= edge: 127 | return range(1, min(self.pages, 2 * edge + 1) + 1) 128 | if self.page + edge > self.pages: 129 | return range(max(self.pages - 2 * edge, 1), self.pages + 1) 130 | return range(self.page - edge, min(self.pages, self.page + edge) + 1) 131 | 132 | @property 133 | def pages(self): 134 | return int((self.total - 1) / self.per_page) + 1 135 | 136 | @property 137 | def has_prev(self): 138 | return self.page > 1 139 | 140 | @property 141 | def prev_permalink(self): 142 | return self.get_permalink(self.prev_num) 143 | 144 | @property 145 | def prev_num(self): 146 | return self.page - 1 147 | 148 | @property 149 | def has_next(self): 150 | return self.page < self.pages 151 | 152 | @property 153 | def next_permalink(self): 154 | return self.get_permalink(self.next_num) 155 | 156 | @property 157 | def next_num(self): 158 | return self.page + 1 159 | 160 | @property 161 | def total(self): 162 | return len(self.total_items) 163 | 164 | @property 165 | def items(self): 166 | start = (self.page - 1) * self.per_page 167 | end = self.page * self.per_page 168 | return self.total_items[start:end] 169 | -------------------------------------------------------------------------------- /conf/README.md: -------------------------------------------------------------------------------- 1 | #Configuration 2 | 3 | ##Nginx 4 | 5 | Remember to replace `yourdomain.com`, `/path/to/catsup/deploy/`, `/path/to/catsup.access.log` and `/path/to/catsup.error.log` to the right settings you want in the provided file nginx.conf. 6 | 7 | ##Supervisord 8 | 9 | Remember to replace `/path/to/logs`, `command=catsup webhook --port=5555` and `user=your_username` to the right settings you want in the provided file supervisord.conf. 10 | -------------------------------------------------------------------------------- /conf/nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | server_name yourdomain.com; 4 | 5 | gzip on; 6 | gzip_static on; 7 | gzip_min_length 500; 8 | gzip_proxied any; 9 | gzip_types text/plain application/xml application/x-javascript text/css text/xml application/atom+xml application/rss+xml; 10 | 11 | root /path/to/catsup/deploy/; 12 | index index.html index.htm; 13 | 14 | access_log /path/to/catsup.access.log; 15 | error_log /path/to/catsup.error.log; 16 | 17 | location = /feed { 18 | rewrite (.*) /feed.xml; 19 | } 20 | } -------------------------------------------------------------------------------- /conf/supervisord.conf: -------------------------------------------------------------------------------- 1 | [unix_http_server] 2 | file=/tmp/supervisor.sock ; path to your socket file 3 | 4 | [supervisord] 5 | logfile=/tmp/supervisord.log ; supervisord log file 6 | logfile_maxbytes=50MB ; maximum size of logfile before rotation 7 | logfile_backups=10 ; number of backed up logfiles 8 | loglevel=warn ; info, debug, warn, trace 9 | pidfile=/tmp/supervisord.pid ; pidfile location 10 | nodaemon=false ; run supervisord as a daemon 11 | minfds=1024 ; number of startup file descriptors 12 | minprocs=200 13 | user=root 14 | childlogdir=/path/to/logs 15 | 16 | [rpcinterface:supervisor] 17 | supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface 18 | 19 | [supervisorctl] 20 | serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket 21 | 22 | [program:catsup_webhook] 23 | command=catsup webhook --port=5555 24 | user=your_username 25 | process_name=catsup_webhook 26 | numproc=1 27 | autostart=true 28 | autorestart=true 29 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | _build/ -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | PAPER = 8 | BUILDDIR = _build 9 | 10 | # Internal variables. 11 | PAPEROPT_a4 = -D latex_paper_size=a4 12 | PAPEROPT_letter = -D latex_paper_size=letter 13 | ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 14 | # the i18n builder cannot share the environment and doctrees with the others 15 | I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . 16 | 17 | .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext 18 | 19 | help: 20 | @echo "Please use \`make ' where is one of" 21 | @echo " html to make standalone HTML files" 22 | @echo " dirhtml to make HTML files named index.html in directories" 23 | @echo " singlehtml to make a single large HTML file" 24 | @echo " pickle to make pickle files" 25 | @echo " json to make JSON files" 26 | @echo " htmlhelp to make HTML files and a HTML help project" 27 | @echo " qthelp to make HTML files and a qthelp project" 28 | @echo " devhelp to make HTML files and a Devhelp project" 29 | @echo " epub to make an epub" 30 | @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" 31 | @echo " latexpdf to make LaTeX files and run them through pdflatex" 32 | @echo " text to make text files" 33 | @echo " man to make manual pages" 34 | @echo " texinfo to make Texinfo files" 35 | @echo " info to make Texinfo files and run them through makeinfo" 36 | @echo " gettext to make PO message catalogs" 37 | @echo " changes to make an overview of all changed/added/deprecated items" 38 | @echo " linkcheck to check all external links for integrity" 39 | @echo " doctest to run all doctests embedded in the documentation (if enabled)" 40 | 41 | clean: 42 | -rm -rf $(BUILDDIR)/* 43 | 44 | html: 45 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html 46 | @echo 47 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." 48 | 49 | dirhtml: 50 | $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml 51 | @echo 52 | @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." 53 | 54 | singlehtml: 55 | $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml 56 | @echo 57 | @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." 58 | 59 | pickle: 60 | $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle 61 | @echo 62 | @echo "Build finished; now you can process the pickle files." 63 | 64 | json: 65 | $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json 66 | @echo 67 | @echo "Build finished; now you can process the JSON files." 68 | 69 | htmlhelp: 70 | $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp 71 | @echo 72 | @echo "Build finished; now you can run HTML Help Workshop with the" \ 73 | ".hhp project file in $(BUILDDIR)/htmlhelp." 74 | 75 | qthelp: 76 | $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp 77 | @echo 78 | @echo "Build finished; now you can run "qcollectiongenerator" with the" \ 79 | ".qhcp project file in $(BUILDDIR)/qthelp, like this:" 80 | @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/catsup.qhcp" 81 | @echo "To view the help file:" 82 | @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/catsup.qhc" 83 | 84 | devhelp: 85 | $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp 86 | @echo 87 | @echo "Build finished." 88 | @echo "To view the help file:" 89 | @echo "# mkdir -p $$HOME/.local/share/devhelp/catsup" 90 | @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/catsup" 91 | @echo "# devhelp" 92 | 93 | epub: 94 | $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub 95 | @echo 96 | @echo "Build finished. The epub file is in $(BUILDDIR)/epub." 97 | 98 | latex: 99 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 100 | @echo 101 | @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." 102 | @echo "Run \`make' in that directory to run these through (pdf)latex" \ 103 | "(use \`make latexpdf' here to do that automatically)." 104 | 105 | latexpdf: 106 | $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex 107 | @echo "Running LaTeX files through pdflatex..." 108 | $(MAKE) -C $(BUILDDIR)/latex all-pdf 109 | @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." 110 | 111 | text: 112 | $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text 113 | @echo 114 | @echo "Build finished. The text files are in $(BUILDDIR)/text." 115 | 116 | man: 117 | $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man 118 | @echo 119 | @echo "Build finished. The manual pages are in $(BUILDDIR)/man." 120 | 121 | texinfo: 122 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 123 | @echo 124 | @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." 125 | @echo "Run \`make' in that directory to run these through makeinfo" \ 126 | "(use \`make info' here to do that automatically)." 127 | 128 | info: 129 | $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo 130 | @echo "Running Texinfo files through makeinfo..." 131 | make -C $(BUILDDIR)/texinfo info 132 | @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." 133 | 134 | gettext: 135 | $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale 136 | @echo 137 | @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." 138 | 139 | changes: 140 | $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes 141 | @echo 142 | @echo "The overview file is in $(BUILDDIR)/changes." 143 | 144 | linkcheck: 145 | $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck 146 | @echo 147 | @echo "Link check complete; look for any errors in the above output " \ 148 | "or in $(BUILDDIR)/linkcheck/output.txt." 149 | 150 | doctest: 151 | $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest 152 | @echo "Testing of doctests in the sources finished, look at the " \ 153 | "results in $(BUILDDIR)/doctest/output.txt." 154 | -------------------------------------------------------------------------------- /docs/_templates/sidebarintro.html: -------------------------------------------------------------------------------- 1 |

About Catsup

2 |

3 | Catsup is a lightweight static website generator which aims to be simple and elegant. 4 |

5 | 6 |

Translations

7 | 11 | 12 |

Useful Links

13 | 18 | 19 |

Donate

20 | 24 | -------------------------------------------------------------------------------- /docs/changelog.rst: -------------------------------------------------------------------------------- 1 | Changelog 2 | ========== 3 | 4 | Version 0.3.11 5 | -------------- 6 | 7 | + Fix Python 2 support 8 | 9 | Version 0.3.10 10 | -------------- 11 | 12 | + Ignore ``__pycache__`` folder when finding themes 13 | + Use force push in git deploy to avoid conflicts 14 | 15 | Version 0.3.9 16 | -------------- 17 | 18 | + Fix theme search under Python 3 19 | 20 | Version 0.3.8 21 | -------------- 22 | 23 | + Always run ``git branch -m`` in git deploy 24 | 25 | 26 | Version 0.3.7 27 | -------------- 28 | 29 | + Fix git deploy 30 | + Supports tag in Unicode 31 | + Fix ``catsup themes`` 32 | 33 | Version 0.3.6 34 | -------------- 35 | 36 | + Load tags and archives before rendering any page 37 | 38 | Version 0.3.5 39 | -------------- 40 | 41 | + Fix a theme install bug 42 | 43 | Version 0.3.4 44 | -------------- 45 | 46 | + Change default post permalink 47 | + Drop cache property 48 | 49 | Version 0.3.3 50 | -------------- 51 | 52 | + Improve Post Model 53 | + Change default post permalink 54 | 55 | Version 0.3.2 56 | -------------- 57 | 58 | + Fix Post meta bug 59 | + Code improvement 60 | 61 | Version 0.3.1 62 | -------------- 63 | 64 | + Fix a bug on ``catsup install`` 65 | 66 | Version 0.3.0 67 | -------------- 68 | 69 | + Add multi-format post support 70 | + Add ``config.config.static_source`` 71 | + Add ``config.config.static_output`` 72 | + Support Non-meta post. 73 | + Support customize permalink for post 74 | + Support TXT format post. 75 | + Support HTML format post. 76 | + Support YAML format meta. 77 | + Rewrite `catsup install` 78 | + Correct the url for Twitter Card Support 79 | + Drop file-based cache system. 80 | + Improve description creator 81 | + Reorganize code. 82 | 83 | Version 0.2.1 84 | -------------- 85 | 86 | + Fix build bugs. 87 | 88 | Version 0.2.0 89 | -------------- 90 | 91 | + Support generate sitemap 92 | + Add `catsup watch` command 93 | + Add `catsup clean` command 94 | + Add cache for rendering markdown 95 | + Add cache for ``url_for`` 96 | + Add cache for ``static_url`` 97 | + Use Jinja2's Bytecode Cache 98 | + Don't generate analytics codes when running ``catsup server`` 99 | + Display time cost for loading config and posts 100 | + Change json engine to `ujson` 101 | 102 | Version 0.1.0 103 | -------------- 104 | 105 | + Use full md5 hash in ``static_url`` 106 | + Add support for pages 107 | + Build to tempdir when running ``catsup server`` 108 | + Add ``config.site.description`` 109 | + Use ``config.comment.shortname`` to replace ``config.comment.disqus`` and ``config.comment.duoshuo`` 110 | + Regenerate the site when your theme or posts changed when running ``catsup server`` 111 | + Use local static file when running ``catsup server`` 112 | + Post per page is defined by theme 113 | + Now catsup copy non-markdown files in source folder to deploy folder 114 | + Drop summary support 115 | + Drop escape markdown support 116 | + Add sub path support 117 | + Support customize any permalink 118 | + Rewrite generator, parser and server 119 | + Don't regenerate your site before deploy 120 | 121 | Version 0.0.8 122 | -------------- 123 | 124 | + Rewrite tag and archive code 125 | + Add deploy support.(via git or rsync) 126 | 127 | Version 0.0.7 128 | -------------- 129 | 130 | Released on Feb. 7, 2013 131 | 132 | + Add pagination for writing theme 133 | + Rename excerpt to summary 134 | + Add theme utils 135 | + Support theme filters -------------------------------------------------------------------------------- /docs/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # catsup documentation build configuration file, created by 4 | # sphinx-quickstart on Fri Feb 8 17:06:00 2013. 5 | # 6 | # This file is execfile()d with the current directory set to its containing dir. 7 | # 8 | # Note that not all possible configuration values are present in this 9 | # autogenerated file. 10 | # 11 | # All configuration values have a default; values that are commented out 12 | # serve to show the default. 13 | 14 | import sys 15 | import os 16 | import time 17 | 18 | # If extensions (or modules to document with autodoc) are in another directory, 19 | # add these directories to sys.path here. If the directory is relative to the 20 | # documentation root, use os.path.abspath to make it absolute, like shown here. 21 | sys.path.append(os.path.abspath("_themes")) 22 | sys.path.insert(0, os.path.abspath("..")) 23 | 24 | import catsup 25 | 26 | # -- General configuration ----------------------------------------------------- 27 | 28 | # If your documentation needs a minimal Sphinx version, state it here. 29 | # needs_sphinx = '1.0' 30 | 31 | # Add any Sphinx extension module names here, as strings. They can be extensions 32 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. 33 | extensions = [] 34 | 35 | # Add any paths that contain templates here, relative to this directory. 36 | templates_path = ["_templates"] 37 | 38 | # The suffix of source filenames. 39 | source_suffix = ".rst" 40 | 41 | # The encoding of source files. 42 | # source_encoding = 'utf-8-sig' 43 | 44 | # The master toctree document. 45 | master_doc = "index" 46 | 47 | # General information about the project. 48 | project = u"Catsup" 49 | copyright = ( 50 | u'2012-%s, whtsky and' 51 | u' Other Crontributors' 52 | % time.strftime("%Y") 53 | ) 54 | 55 | # The version info for the project you're documenting, acts as replacement for 56 | # |version| and |release|, also used in various other places throughout the 57 | # built documents. 58 | # 59 | # The short X.Y version. 60 | version = catsup.__version__ 61 | # The full version, including alpha/beta/rc tags. 62 | release = catsup.__version__ 63 | 64 | # The language for content autogenerated by Sphinx. Refer to documentation 65 | # for a list of supported languages. 66 | # language = None 67 | 68 | # There are two options for replacing |today|: either, you set today to some 69 | # non-false value, then it is used: 70 | # today = '' 71 | # Else, today_fmt is used as the format for a strftime call. 72 | # today_fmt = '%B %d, %Y' 73 | 74 | # List of patterns, relative to source directory, that match files and 75 | # directories to ignore when looking for source files. 76 | exclude_patterns = ["_build"] 77 | 78 | # The reST default role (used for this markup: `text`) to use for all documents. 79 | # default_role = None 80 | 81 | # If true, '()' will be appended to :func: etc. cross-reference text. 82 | # add_function_parentheses = True 83 | 84 | # If true, the current module name will be prepended to all description 85 | # unit titles (such as .. function::). 86 | # add_module_names = True 87 | 88 | # If true, sectionauthor and moduleauthor directives will be shown in the 89 | # output. They are ignored by default. 90 | # show_authors = False 91 | 92 | # The name of the Pygments (syntax highlighting) style to use. 93 | pygments_style = "flask_theme_support.FlaskyStyle" 94 | 95 | # A list of ignored prefixes for module index sorting. 96 | # modindex_common_prefix = [] 97 | 98 | 99 | # -- Options for HTML output --------------------------------------------------- 100 | 101 | # The theme to use for HTML and HTML Help pages. See the documentation for 102 | # a list of builtin themes. 103 | html_theme = "flask" 104 | 105 | # Theme options are theme-specific and customize the look and feel of a theme 106 | # further. For a list of options available for each theme, see the 107 | # documentation. 108 | # html_theme_options = {} 109 | 110 | # Add any paths that contain custom themes here, relative to this directory. 111 | html_theme_path = ["_themes"] 112 | 113 | # The name for this set of Sphinx documents. If None, it defaults to 114 | # " v documentation". 115 | # html_title = None 116 | 117 | # A shorter title for the navigation bar. Default is the same as html_title. 118 | # html_short_title = None 119 | 120 | # The name of an image file (relative to this directory) to place at the top 121 | # of the sidebar. 122 | # html_logo = None 123 | 124 | # The name of an image file (within the static path) to use as favicon of the 125 | # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 126 | # pixels large. 127 | # html_favicon = None 128 | 129 | # Add any paths that contain custom static files (such as style sheets) here, 130 | # relative to this directory. They are copied after the builtin static files, 131 | # so a file named "default.css" will overwrite the builtin "default.css". 132 | html_static_path = ["_static"] 133 | 134 | # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, 135 | # using the given strftime format. 136 | # html_last_updated_fmt = '%b %d, %Y' 137 | 138 | # If true, SmartyPants will be used to convert quotes and dashes to 139 | # typographically correct entities. 140 | # html_use_smartypants = True 141 | 142 | # Custom sidebar templates, maps document names to template names. 143 | html_sidebars = { 144 | "index": ["sourcelink.html", "sidebarintro.html", "searchbox.html"], 145 | "**": ["localtoc.html", "relations.html", "sidebarintro.html", "searchbox.html"], 146 | } 147 | 148 | # Additional templates that should be rendered to pages, maps page names to 149 | # template names. 150 | # html_additional_pages = {} 151 | 152 | # If false, no module index is generated. 153 | # html_domain_indices = True 154 | 155 | # If false, no index is generated. 156 | html_use_index = False 157 | 158 | # If true, the index is split into individual pages for each letter. 159 | # html_split_index = False 160 | 161 | # If true, links to the reST sources are added to the pages. 162 | html_show_sourcelink = False 163 | 164 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. 165 | # html_show_sphinx = True 166 | 167 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. 168 | # html_show_copyright = True 169 | 170 | # If true, an OpenSearch description file will be output, and all pages will 171 | # contain a tag referring to it. The value of this option must be the 172 | # base URL from which the finished HTML is served. 173 | # html_use_opensearch = '' 174 | 175 | # This is the file name suffix for HTML files (e.g. ".xhtml"). 176 | # html_file_suffix = None 177 | 178 | # Output file base name for HTML help builder. 179 | htmlhelp_basename = "catsupdoc" 180 | 181 | 182 | # -- Options for LaTeX output -------------------------------------------------- 183 | 184 | latex_elements = { 185 | # The paper size ('letterpaper' or 'a4paper'). 186 | #'papersize': 'letterpaper', 187 | # The font size ('10pt', '11pt' or '12pt'). 188 | #'pointsize': '10pt', 189 | # Additional stuff for the LaTeX preamble. 190 | #'preamble': '', 191 | } 192 | 193 | # Grouping the document tree into LaTeX files. List of tuples 194 | # (source start file, target name, title, author, documentclass [howto/manual]). 195 | latex_documents = [ 196 | ("index", "catsup.tex", u"catsup Documentation", u"whtsky", "manual"), 197 | ] 198 | 199 | # The name of an image file (relative to this directory) to place at the top of 200 | # the title page. 201 | # latex_logo = None 202 | 203 | # For "manual" documents, if this is true, then toplevel headings are parts, 204 | # not chapters. 205 | # latex_use_parts = False 206 | 207 | # If true, show page references after internal links. 208 | # latex_show_pagerefs = False 209 | 210 | # If true, show URL addresses after external links. 211 | # latex_show_urls = False 212 | 213 | # Documents to append as an appendix to all manuals. 214 | # latex_appendices = [] 215 | 216 | # If false, no module index is generated. 217 | # latex_domain_indices = True 218 | 219 | 220 | # -- Options for manual page output -------------------------------------------- 221 | 222 | # One entry per manual page. List of tuples 223 | # (source start file, name, description, authors, manual section). 224 | man_pages = [("index", "catsup", u"Catsup Documentation", [u"whtsky"], 1)] 225 | 226 | # If true, show URL addresses after external links. 227 | # man_show_urls = False 228 | 229 | 230 | # -- Options for Texinfo output ------------------------------------------------ 231 | 232 | # Grouping the document tree into Texinfo files. List of tuples 233 | # (source start file, target name, title, author, 234 | # dir menu entry, description, category) 235 | texinfo_documents = [ 236 | ( 237 | "index", 238 | "catsup", 239 | u"Catsup Documentation", 240 | u"whtsky", 241 | "catsup", 242 | "One line description of project.", 243 | "Miscellaneous", 244 | ), 245 | ] 246 | 247 | # Documents to append as an appendix to all manuals. 248 | # texinfo_appendices = [] 249 | 250 | # If false, no module index is generated. 251 | # texinfo_domain_indices = True 252 | 253 | # How to display URL addresses: 'footnote', 'no', or 'inline'. 254 | # texinfo_show_urls = 'footnote' 255 | -------------------------------------------------------------------------------- /docs/config.json: -------------------------------------------------------------------------------- 1 | ../catsup/templates/config.json -------------------------------------------------------------------------------- /docs/config.rst: -------------------------------------------------------------------------------- 1 | .. _configuration: 2 | 3 | Configuration 4 | =============== 5 | 6 | Catsup's configuration file is a vaild JSON file. 7 | 8 | Overview 9 | ------------ 10 | 11 | The default config file looks like : 12 | 13 | .. literalinclude:: config.json 14 | :language: json 15 | 16 | 17 | Site & Author & Config 18 | ------------------------ 19 | 20 | It’s easy enough to configure these by yourself. 21 | 22 | If you're using Google Analytics, remember to change ``config.analytics`` :: 23 | 24 | "config": { 25 | "source": "posts", 26 | "static_source": "static", 27 | "output": "deploy", 28 | "static_output": "deploy/static", 29 | "static_prefix": "/static/", 30 | "analytics": "" 31 | }, 32 | 33 | 34 | Permalink 35 | ------------- 36 | 37 | You can easily change any page's permalink in ``config.permalink`` . 38 | 39 | There are some permalink styles for posts you may like : 40 | 41 | + ``/{title}.html`` 42 | + ``{filename}.html`` 43 | + ``/{date}/{title}/`` 44 | + ``/{filename}/`` 45 | + ``/{date}/{filename}/`` 46 | + ``/{datetime.year}/{filename}/`` 47 | 48 | Note that permalink defined in :ref:`Post Meta ` will be used first. 49 | 50 | For example, you defined your post permalink like :: 51 | 52 | "permalink": { 53 | "post": "/{title}/", 54 | "feed": "/feed.xml" 55 | }, 56 | 57 | And in your post, you defined a permalink in :ref:`Post Meta ` :: 58 | 59 | # About 60 | 61 | - datetime: 2013-08-30 12:00 62 | - type: page 63 | - permalink: /about-the-site 64 | 65 | ------- 66 | 67 | This is a about page 68 | 69 | In the end the permalink of this page will be ``/about-the-site`` . 70 | 71 | Comment 72 | ---------- 73 | 74 | Catsup supports two comment systems: `Disqus `_ and `Duoshuo `_ 75 | 76 | If you prefer Duoshuo to Disqus, just change your comment system to it :: 77 | 78 | "comment": { 79 | "allow": true, 80 | "system": "duoshuo", 81 | "shortname": "catsup" 82 | }, 83 | 84 | If you have your own shortname, remember to change ``comment.shortname`` to your own :: 85 | 86 | "comment": { 87 | "allow": true, 88 | "system": "disqus", 89 | "shortname": "my_site" 90 | }, 91 | 92 | If you don't want to allow any comment, just disable it :: 93 | 94 | "comment": { 95 | "allow": false 96 | }, 97 | 98 | If you just want some of the posts can't be commented, set ``- comment: disabled`` in :ref:`Post Meta ` 99 | 100 | Deploy & Theme 101 | ---------------- 102 | 103 | It’s easy enough to configure these by yourself. 104 | 105 | For more information, read about :ref:`Deploy Support ` and your theme's document. -------------------------------------------------------------------------------- /docs/goodies.rst: -------------------------------------------------------------------------------- 1 | Goodies 2 | =========== 3 | 4 | .. _preview-server: 5 | 6 | Preview Server 7 | ---------------- 8 | Preview your site without deploy :: 9 | 10 | catsup server 11 | catsup server -p 8000 12 | 13 | Preview server will regenerate your site when : 14 | 15 | + Your source folder (``posts`` by default) changes (Like add a new post or modify one) 16 | + Your theme folder changes(Useful for writing themes for Catsup) 17 | + Catsup program changes(Useful for writing codes for Catsup) 18 | 19 | .. note:: Catsup will ignore ``site.url`` and build your site into a temporary directory when running Preview Server. 20 | 21 | .. _deploy: 22 | 23 | Deploy Support 24 | ---------------- 25 | Help you deploy your site via git or rsync :: 26 | 27 | catsup deploy # Deploy via default way 28 | catsup rsync # Deploy via rsync 29 | catsup git # Deploy via git 30 | 31 | 32 | Webhook 33 | --------- 34 | If you host your site's source on GitHub or Bitbucket, Catsup can generate your site when you push to your repo. 35 | 36 | You need to clone your repo and start webhook server :: 37 | 38 | git clone git://path/to/your/site.git 39 | cd site 40 | catsup webhook -p 12580 41 | 42 | .. attention:: Catsup webhook is not a daemon process.That means you may need to use Supervisor_ to turn it into daemon. 43 | 44 | Then configure webhook on GitHub or Bitbucket. Here we use GitHub as an example: 45 | 46 | + Go to the “admin” page for your project 47 | + Click “Service Hooks” 48 | + In the available service hooks, click “WebHook URLs“ 49 | + Type your url [1]_ 50 | + Click “Update Settings” 51 | 52 | .. [1] If your server's ip is 1.2.3.4 , you can type ``http://1.2.3.4:12580/webhook`` 53 | 54 | Then when you push to GitHub, Catsup will pull and generate your site. 55 | 56 | .. _Supervisor: http://pypi.python.org/pypi/supervisor/ 57 | -------------------------------------------------------------------------------- /docs/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to Catsup 2 | ================================== 3 | 4 | Catsup is a lightweight static website generator which aims to be simple and elegant. 5 | 6 | User’s Guide 7 | --------------- 8 | 9 | .. toctree:: 10 | :maxdepth: 2 11 | 12 | install 13 | start 14 | post 15 | config 16 | theme 17 | goodies 18 | upgrading 19 | changelog 20 | -------------------------------------------------------------------------------- /docs/install.rst: -------------------------------------------------------------------------------- 1 | .. _installation: 2 | 3 | Installation 4 | ============== 5 | 6 | 7 | If you are familiar with Python, it is strongly suggested that you install everything in virtualenv. 8 | 9 | If you are using OS X , make sure you have installed the *Command Line Tools* . 10 | 11 | Install using pip 12 | ------------------------- 13 | Install Catsup via pip is easy :: 14 | 15 | (sudo) pip install catsup 16 | 17 | 18 | Upgrade from older version 19 | ------------------------------- 20 | It's also easy to upgrade your Catsup :: 21 | 22 | (sudo) pip install catsup --upgrade 23 | 24 | Install with Git 25 | ----------------- 26 | Install with git can always have the latest code :: 27 | 28 | git clone git://github.com/whtsky/catsup.git 29 | cd catsup 30 | 31 | # We use git submodules to organize out theme. 32 | # If you don't want the default theme(current version is sealscript) 33 | # You can skip these command. 34 | git submodule init 35 | git submodule update 36 | 37 | python setup.py install 38 | 39 | Cann’t find Python.h ? 40 | ----------------------- 41 | Catsup uses misaka as the markdown engine. It requires C compiler.On Ubuntu, you may run :: 42 | 43 | (sudo) apt-get install python-dev 44 | 45 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | REM Command file for Sphinx documentation 4 | 5 | if "%SPHINXBUILD%" == "" ( 6 | set SPHINXBUILD=sphinx-build 7 | ) 8 | set BUILDDIR=_build 9 | set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . 10 | set I18NSPHINXOPTS=%SPHINXOPTS% . 11 | if NOT "%PAPER%" == "" ( 12 | set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% 13 | set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% 14 | ) 15 | 16 | if "%1" == "" goto help 17 | 18 | if "%1" == "help" ( 19 | :help 20 | echo.Please use `make ^` where ^ is one of 21 | echo. html to make standalone HTML files 22 | echo. dirhtml to make HTML files named index.html in directories 23 | echo. singlehtml to make a single large HTML file 24 | echo. pickle to make pickle files 25 | echo. json to make JSON files 26 | echo. htmlhelp to make HTML files and a HTML help project 27 | echo. qthelp to make HTML files and a qthelp project 28 | echo. devhelp to make HTML files and a Devhelp project 29 | echo. epub to make an epub 30 | echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter 31 | echo. text to make text files 32 | echo. man to make manual pages 33 | echo. texinfo to make Texinfo files 34 | echo. gettext to make PO message catalogs 35 | echo. changes to make an overview over all changed/added/deprecated items 36 | echo. linkcheck to check all external links for integrity 37 | echo. doctest to run all doctests embedded in the documentation if enabled 38 | goto end 39 | ) 40 | 41 | if "%1" == "clean" ( 42 | for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i 43 | del /q /s %BUILDDIR%\* 44 | goto end 45 | ) 46 | 47 | if "%1" == "html" ( 48 | %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html 49 | if errorlevel 1 exit /b 1 50 | echo. 51 | echo.Build finished. The HTML pages are in %BUILDDIR%/html. 52 | goto end 53 | ) 54 | 55 | if "%1" == "dirhtml" ( 56 | %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml 57 | if errorlevel 1 exit /b 1 58 | echo. 59 | echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. 60 | goto end 61 | ) 62 | 63 | if "%1" == "singlehtml" ( 64 | %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml 65 | if errorlevel 1 exit /b 1 66 | echo. 67 | echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. 68 | goto end 69 | ) 70 | 71 | if "%1" == "pickle" ( 72 | %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle 73 | if errorlevel 1 exit /b 1 74 | echo. 75 | echo.Build finished; now you can process the pickle files. 76 | goto end 77 | ) 78 | 79 | if "%1" == "json" ( 80 | %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json 81 | if errorlevel 1 exit /b 1 82 | echo. 83 | echo.Build finished; now you can process the JSON files. 84 | goto end 85 | ) 86 | 87 | if "%1" == "htmlhelp" ( 88 | %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp 89 | if errorlevel 1 exit /b 1 90 | echo. 91 | echo.Build finished; now you can run HTML Help Workshop with the ^ 92 | .hhp project file in %BUILDDIR%/htmlhelp. 93 | goto end 94 | ) 95 | 96 | if "%1" == "qthelp" ( 97 | %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp 98 | if errorlevel 1 exit /b 1 99 | echo. 100 | echo.Build finished; now you can run "qcollectiongenerator" with the ^ 101 | .qhcp project file in %BUILDDIR%/qthelp, like this: 102 | echo.^> qcollectiongenerator %BUILDDIR%\qthelp\catsup.qhcp 103 | echo.To view the help file: 104 | echo.^> assistant -collectionFile %BUILDDIR%\qthelp\catsup.ghc 105 | goto end 106 | ) 107 | 108 | if "%1" == "devhelp" ( 109 | %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp 110 | if errorlevel 1 exit /b 1 111 | echo. 112 | echo.Build finished. 113 | goto end 114 | ) 115 | 116 | if "%1" == "epub" ( 117 | %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub 118 | if errorlevel 1 exit /b 1 119 | echo. 120 | echo.Build finished. The epub file is in %BUILDDIR%/epub. 121 | goto end 122 | ) 123 | 124 | if "%1" == "latex" ( 125 | %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex 126 | if errorlevel 1 exit /b 1 127 | echo. 128 | echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. 129 | goto end 130 | ) 131 | 132 | if "%1" == "text" ( 133 | %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text 134 | if errorlevel 1 exit /b 1 135 | echo. 136 | echo.Build finished. The text files are in %BUILDDIR%/text. 137 | goto end 138 | ) 139 | 140 | if "%1" == "man" ( 141 | %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man 142 | if errorlevel 1 exit /b 1 143 | echo. 144 | echo.Build finished. The manual pages are in %BUILDDIR%/man. 145 | goto end 146 | ) 147 | 148 | if "%1" == "texinfo" ( 149 | %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo 150 | if errorlevel 1 exit /b 1 151 | echo. 152 | echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. 153 | goto end 154 | ) 155 | 156 | if "%1" == "gettext" ( 157 | %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale 158 | if errorlevel 1 exit /b 1 159 | echo. 160 | echo.Build finished. The message catalogs are in %BUILDDIR%/locale. 161 | goto end 162 | ) 163 | 164 | if "%1" == "changes" ( 165 | %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes 166 | if errorlevel 1 exit /b 1 167 | echo. 168 | echo.The overview file is in %BUILDDIR%/changes. 169 | goto end 170 | ) 171 | 172 | if "%1" == "linkcheck" ( 173 | %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck 174 | if errorlevel 1 exit /b 1 175 | echo. 176 | echo.Link check complete; look for any errors in the above output ^ 177 | or in %BUILDDIR%/linkcheck/output.txt. 178 | goto end 179 | ) 180 | 181 | if "%1" == "doctest" ( 182 | %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest 183 | if errorlevel 1 exit /b 1 184 | echo. 185 | echo.Testing of doctests in the sources finished, look at the ^ 186 | results in %BUILDDIR%/doctest/output.txt. 187 | goto end 188 | ) 189 | 190 | :end 191 | -------------------------------------------------------------------------------- /docs/post.rst: -------------------------------------------------------------------------------- 1 | .. _post-syntax: 2 | 3 | Post Syntax 4 | ============= 5 | 6 | Catsup currently supports 3 types of post: :ref:`Markdown `, :ref:`Text ` and :ref:`HTML `. 7 | 8 | .. _post-markdown-syntax: 9 | 10 | Markdown Post 11 | -------------- 12 | 13 | Overview 14 | ~~~~~~~~~ 15 | 16 | Post's extension should be either ``.md`` or ``.markdown`` . 17 | 18 | A sample post looks like :: 19 | 20 | # Hello, World! <---- This is title 21 | 22 | - time: 2013-08-25 23:30 <---- This is meta 23 | - tags: hello world 24 | 25 | --- 26 | 27 | Hello, World! <---- This is content 28 | This is my first post in catsup. 29 | I'm writing in **MarkDown** ! 30 | HTML is supported, too 31 | 32 | ```python 33 | print("I love python") 34 | ``` 35 | 36 | A post consists of three parts: 37 | 38 | + Title 39 | + :ref:`Meta ` 40 | + Content 41 | 42 | Title 43 | ~~~~~~~~~~~~~~~~~~~~~~ 44 | 45 | Title should always on the first line and starts with ``#`` 46 | 47 | Content 48 | ~~~~~~~~~~~~~~~~~~~~~~ 49 | 50 | Everything below the separator is the content. Content should be written in Markdown. 51 | 52 | Code Highlight 53 | ~~~~~~~~~~~~~~~~~~~~~~ 54 | 55 | Catsup supports GitHub's style code highlight, like this :: 56 | 57 | ```python 58 | print("Hello World!") 59 | ``` 60 | 61 | .. _post-text-syntax: 62 | 63 | Text Post 64 | -------------- 65 | 66 | Sometimes you may just want to write something without considering the syntax. Then you should use Text Post. 67 | 68 | Text post's extension should be ``.txt`` . 69 | 70 | The simplest text post looks like :: 71 | 72 | Hello! 73 | This is a text post. 74 | 75 | If you want to write meta in a text post, write the meta in YAML format :: 76 | 77 | --- 78 | title: Hello, World! 79 | tags: Hello, World 80 | time: 2014-01-04 20:56 81 | --- 82 | 83 | Hello, World! I'm a text post. 84 | 85 | 86 | .. _post-html-syntax: 87 | 88 | HTML Post 89 | -------------- 90 | 91 | HTML post is like :ref:`Text Post `, but you can use HTML in the content. 92 | 93 | HTML post's extension should be ``.txt`` . 94 | 95 | A HTML post looks like :: 96 | 97 | --- 98 | title: Hello, World! 99 | tags: Hello, World 100 | time: 2014-01-04 20:56 101 | --- 102 | 103 |

I'm writing HTML in catsup

104 | 105 | 106 | .. _post-meta: 107 | 108 | Meta 109 | -------- 110 | 111 | Meta is some information about the post. 112 | Note that meta is optional, and if your post have meta, remember to put a :ref:`separator ` below the meta. 113 | 114 | + time: When the post is written. like ``2013-08-25 11:10`` 115 | + tags: Tags of the post. Separated by comma, like ``Python, Program`` 116 | + type: Set to ``page`` to turn this post into a page. 117 | + description: Description of the post. 118 | + comment: Set to ``disabled`` to forbid comment 119 | + permalink: Permalink to the post, link ``/this-post`` 120 | 121 | .. _post-separator: 122 | 123 | The separator 124 | ---------------- 125 | 126 | The separator separates meta and content. It should be at least *three* ``-`` :: 127 | 128 | --- 129 | 130 | It's okay to make it longer :: 131 | 132 | ---------------- 133 | 134 | Page 135 | -------- 136 | 137 | Page is a kind of post. Turn an ordinary post into page by adding ``- type: page`` in post's meta. 138 | 139 | So, what's the difference between page and post? 140 | 141 | + Page do not have tags 142 | + Page do not display in Archives Pages and Index Pages 143 | + In general, pages will be linked in every page's navigation. -------------------------------------------------------------------------------- /docs/start.rst: -------------------------------------------------------------------------------- 1 | .. _get-started: 2 | 3 | Get Started 4 | ================ 5 | 6 | This section needs you have Catsup installed.If you don't, please go and :ref:`Install it ` 7 | 8 | Create a new site 9 | ------------------- 10 | It's pretty simple to create a site using Catsup :: 11 | 12 | $ mkdir site 13 | $ cd site 14 | $ catsup init 15 | 16 | Let's see what happened :: 17 | 18 | $ ls 19 | config.json posts 20 | 21 | After running ``catsup init``, Catsup generates a sample config file ``config.json`` and an empty post folder ``posts``. 22 | 23 | Now, let's configure your new site. 24 | 25 | Configure your site 26 | ----------------------- 27 | 28 | Catsup can be highly customized, but you only need to change a few variables to get started : 29 | 30 | + ``site.name`` : Name of your site 31 | + ``site.description`` : Description of your site 32 | + ``site.url`` : Your site's URL. Like ``http://example.com`` or ``http://example.com/site`` 33 | + ``author.name`` : Your nickname 34 | 35 | Want to learn more about configuration file? Take a look at :ref:`Configuration ` 36 | 37 | After configuring your site, it's time to start writing. 38 | 39 | Write posts and pages 40 | ------------------------- 41 | 42 | Let's write a post first :: 43 | 44 | vim posts/hello-world.md 45 | 46 | a Hello World post looks like :: 47 | 48 | # Hello, World! 49 | 50 | - time: 2013-08-25 23:30 51 | - tags: hello world 52 | 53 | --- 54 | 55 | Hello, World! 56 | This is my first post in catsup. 57 | I'm writing in **MarkDown** ! 58 | HTML is supported, too 59 | 60 | ```python 61 | print("I love python") 62 | ``` 63 | 64 | Then, let's write a page to talk about your site :: 65 | 66 | vim posts/about.md 67 | 68 | a About page looks like :: 69 | 70 | # About the site 71 | 72 | - time: 2013-08-25 23:31 73 | - type: page 74 | 75 | ---- 76 | 77 | Hi! 78 | This site is generated by [catsup](https://github.com/whtsky/catsup). 79 | 80 | 81 | Read about :ref:`Post Syntax ` to learn more. 82 | 83 | Build your site 84 | ----------------- 85 | After writing posts and pages, It's time to build your site and let everyone know! 86 | 87 | But don't hurry, let's take a look at your site first :: 88 | 89 | catsup server 90 | 91 | Then open your favorite web browser, go to http://127.0.0.1:8888 . 92 | 93 | Head over to :ref:`Preview Server ` to know more. 94 | 95 | 96 | After making sure everything's all right, let's build the site :: 97 | 98 | catsup build 99 | 100 | Let's see what happened :: 101 | 102 | $ ls 103 | config.json deploy posts 104 | 105 | 106 | Deploy your site 107 | ------------------ 108 | 109 | Deploy to GitHub Pages 110 | ```````````````````````` 111 | 112 | Thanks to GitHub, we have a perfect place to host our site. 113 | 114 | You need to have a repo called `YOUR_GITHUB_USERNAME.github.io`. If you don't, go to `create one `_ 115 | 116 | 117 | Then edit your configuration file, change ``deploy`` section like this :: 118 | 119 | "deploy": { 120 | "default": "git", 121 | 122 | "git": { 123 | "repo": "git@github.com:YOUR_GITHUB_USERNAME/YOUR_GITHUB_USERNAME.github.io.git", 124 | "branch": "master", 125 | "delete": true 126 | } 127 | }, 128 | 129 | replace ``YOUR_GITHUB_USERNAME`` with your github username, like ``whtsky`` . 130 | 131 | After that, let's deploy your site to GitHub Pages :: 132 | 133 | catsup build && catsup deploy 134 | 135 | Then open http://YOUR_GITHUB_USERNAME.github.io to enjoy your fresh site. 136 | 137 | Deploy to your own server 138 | ``````````````````````````` 139 | 140 | Catsup also supports deploy via rsync. Before continue, make sure you have rsync running on your server. 141 | 142 | Then edit your configuration file, change ``deploy`` section like this :: 143 | 144 | "deploy": { 145 | "default": "rsync", 146 | 147 | "rsync": { 148 | "ssh_port": 22, 149 | "ssh_user": "USER_NAME_HERE", 150 | "ssh_host": "IP_ADDRESS_OF_YOUR_SERVER", 151 | "document_root": "DEPLOY_TO_WHICH_PATH", 152 | } 153 | }, 154 | 155 | Here's an example :: 156 | 157 | "deploy": { 158 | "default": "rsync", 159 | 160 | "rsync": { 161 | "ssh_port": 22, 162 | "ssh_user": "whtsky", 163 | "ssh_host": "whouz.com", 164 | "document_root": "~/whouz.com", 165 | } 166 | }, 167 | 168 | After that, let's deploy your site via rsync :: 169 | 170 | catsup build && catsup deploy 171 | 172 | 173 | Head over to :ref:`Deploy Support ` to know more. -------------------------------------------------------------------------------- /docs/theme.rst: -------------------------------------------------------------------------------- 1 | Theme 2 | ======== 3 | 4 | Overview 5 | --------- 6 | 7 | Install a theme :: 8 | 9 | catsup install theme_name 10 | 11 | For instance, install `Theme Clean `_ :: 12 | 13 | catsup install clean 14 | 15 | List all themes installed :: 16 | 17 | catsup themes 18 | 19 | Structure 20 | ---------- 21 | 22 | Catsup uses Jinja2 as a Template Engine.You need to learn it if you want to design your own theme. 23 | 24 | You can learn how to design your theme by reading source: 25 | 26 | + `Theme Clean `_ 27 | + `Theme Sealscript `_ 28 | 29 | A catsup theme should look like :: 30 | 31 | ├── README.md <-------- how to install/customize your theme. 32 | ├── static <-------- static files 33 | │   ├── css 34 | │   │   ├── pygments_style.css <-------- catsup uses Pygments to highlight code 35 | │   │   └── style.css 36 | ├── templates <-------- template files 37 | │   ├── 404.html 38 | │   ├── archive.html 39 | │   ├── archives.html 40 | │   ├── page.html 41 | │   ├── post.html 42 | │   └── tag.html 43 | │   └── tags.html 44 | ├── filters.py <--------- filters defined by theme 45 | └── theme.py <--------- meta file 46 | 47 | 48 | Meta File 49 | ----------- 50 | 51 | A demo meta file :: 52 | 53 | name = 'sealscript' 54 | author = 'Lyric' 55 | homepage = 'https://github.com/whtsky/catsup-theme-sealscript' 56 | post_per_page = 3 57 | vars = { 58 | "github": "whtsky", 59 | } 60 | 61 | A theme meta consists of : 62 | 63 | + name 64 | + author 65 | + homepage 66 | + post_per_page 67 | + vars 68 | 69 | 70 | Variables 71 | ---------- 72 | 73 | Global Variables 74 | ~~~~~~~~~~~~~~~~~~ 75 | 76 | + generator: Catsup's Generator instance. 77 | + site: ``site`` in user's config file. 78 | + author: ``author`` in user's config file. 79 | + config: ``config`` in user's config file. 80 | + comment: ``commment`` in user's config file. 81 | + theme: ``theme.vars`` in user's config file. 82 | + pages: All the pages of the current site. 83 | 84 | Templatable Variables 85 | ~~~~~~~~~~~~~~~~~~~~~~ 86 | 87 | Templatable variables are only accessed in specify templates. 88 | 89 | + pagination: available in ``page.html`` 90 | + post: available in ``post.html`` 91 | + permalink: permalink of the current page :: 92 | 93 | 94 | 95 | 96 | Built-in Functions 97 | ------------------------ 98 | 99 | static_url 100 | ~~~~~~~~~~~~~~~~~~ 101 | Static URL returns a static URL for the given relative static file path. :: 102 | 103 | 104 | 105 | url_for 106 | ~~~~~~~~~~~~~~~~~~~ 107 | 108 | url for returns the permalink of the given object or string :: 109 | 110 | {{ site.name }} 111 | 112 | {{ post.title }} 113 | 114 | 115 | 116 | Filters 117 | ----------- 118 | 119 | Every function in ``filters.py`` will be a filter.Catsup also has some build-in filter: 120 | 121 | + xmldatetime 122 | 123 | Template Marco 124 | --------------- 125 | Catsup has some powerful marco to make your job easier 126 | 127 | + render_comment(post): Render comment of the given post. 128 | + meta(post): Render meta tags of given post.Should be used id ````. 129 | + analytics(): Render analytics code. 130 | 131 | An example ``post.html`` template using built-in marco :: 132 | 133 | 134 | 135 | {{ post.title }} 136 | {% from 'utils.html' import meta, analytics %} 137 | {{ meta(post) }} 138 | {{ analytics() }} 139 | 140 | 141 | 142 |
143 |

{{ post.title }}

144 | {{ post.content }} 145 | {% from 'utils.html' import render_comment %} 146 | {{ render_comment(post) }} 147 |
148 | 149 | 150 | -------------------------------------------------------------------------------- /docs/upgrading.rst: -------------------------------------------------------------------------------- 1 | .. _upgrading: 2 | 3 | Upgrading to Newer Releases 4 | ============================ 5 | 6 | Catsup itself is changing like any software is changing over time. Most of 7 | the changes are the nice kind, the kind where you don't have to change 8 | anything in your site to profit from a new release. 9 | 10 | However every once in a while there are changes that do require some 11 | changes in your site. 12 | 13 | This section of the documentation enumerates all the changes in Catsup from 14 | release to release and how you can change your site to have a painless 15 | updating experience. 16 | 17 | If you want to use the `easy_install` command to upgrade your Catsup 18 | installation, make sure to pass it the ``-U`` parameter:: 19 | 20 | $ easy_install -U catsup 21 | 22 | Version 0.2.0 23 | ---------------- 24 | 25 | Catsup adds an cache system since 0.2.0 . 26 | 27 | Cache files are stored in ``.catsup-cache`` folder, so if you are using git to organize your site and 28 | want to ignore the cache files, add the following line to your ``.gitignore`` file :: 29 | 30 | .catsup-cache 31 | 32 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | deploy/ -------------------------------------------------------------------------------- /example/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "site": { 3 | "name": "blogname", 4 | "description": "Just another catsup blog", 5 | "domain": "http://blog.com/", 6 | "root_path": "/" 7 | }, 8 | 9 | "author": { 10 | "name": "nickname", 11 | "email": "name@exmaple.com", 12 | "twitter": "twitter" 13 | }, 14 | 15 | "config": { 16 | "source": "posts", 17 | "output": "deploy", 18 | "static_prefix": "/static/", 19 | "analytics": "" 20 | }, 21 | 22 | "permalink": { 23 | "page": "/page/{page}/", 24 | "post": "/{year}-{month}-{day}-{title}/", 25 | "tag": "/tag/{name}/", 26 | "tags": "/tag/index.html", 27 | "archive": "/archive/{year}/", 28 | "archives": "/archive/index.html", 29 | "feed": "/feed.xml" 30 | }, 31 | 32 | "comment": { 33 | "disqus": "catsup" 34 | }, 35 | 36 | "deploy": { 37 | "default": "rsync", 38 | 39 | "git": { 40 | "repo": "repo url here", 41 | "branch": "master", 42 | "delete": true 43 | }, 44 | 45 | "rsync": { 46 | "ssh_port": 22, 47 | "ssh_user": "username", 48 | "ssh_host": "123.45.6.78", 49 | "document_root": "~/website.com/", 50 | "delete": true 51 | } 52 | }, 53 | 54 | "theme": { 55 | "name": "sealscript", 56 | "vars": { 57 | "description": "a blog", 58 | "github": "whtsky", 59 | "links": [ 60 | { 61 | "name": "catsup", 62 | "url": "https://github.com/whtsky/catsup", 63 | "description": "Awesome!" 64 | } 65 | ] 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /example/posts/hello_world.md: -------------------------------------------------------------------------------- 1 | #Hello World! 2 | 3 | - tags: hello world, catsup 4 | - time: 2013-07-20 21:57 5 | 6 | -------- 7 | 8 | Hello World! 9 | 10 | ```python 11 | print("I love writing Python.") 12 | ``` -------------------------------------------------------------------------------- /poetry.lock: -------------------------------------------------------------------------------- 1 | [[package]] 2 | category = "dev" 3 | description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." 4 | marker = "python_version >= \"3.6\" and python_version < \"4.0\"" 5 | name = "appdirs" 6 | optional = false 7 | python-versions = "*" 8 | version = "1.4.4" 9 | 10 | [[package]] 11 | category = "main" 12 | description = "An unobtrusive argparse wrapper with natural syntax" 13 | name = "argh" 14 | optional = false 15 | python-versions = "*" 16 | version = "0.26.2" 17 | 18 | [[package]] 19 | category = "dev" 20 | description = "Atomic file writes." 21 | marker = "sys_platform == \"win32\"" 22 | name = "atomicwrites" 23 | optional = false 24 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 25 | version = "1.4.0" 26 | 27 | [[package]] 28 | category = "dev" 29 | description = "Classes Without Boilerplate" 30 | name = "attrs" 31 | optional = false 32 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 33 | version = "19.3.0" 34 | 35 | [package.extras] 36 | azure-pipelines = ["coverage", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface", "pytest-azurepipelines"] 37 | dev = ["coverage", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface", "sphinx", "pre-commit"] 38 | docs = ["sphinx", "zope.interface"] 39 | tests = ["coverage", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface"] 40 | 41 | [[package]] 42 | category = "main" 43 | description = "The ssl.match_hostname() function from Python 3.5" 44 | name = "backports.ssl-match-hostname" 45 | optional = false 46 | python-versions = "*" 47 | version = "3.7.0.1" 48 | 49 | [[package]] 50 | category = "dev" 51 | description = "The uncompromising code formatter." 52 | marker = "python_version >= \"3.6\" and python_version < \"4.0\"" 53 | name = "black" 54 | optional = false 55 | python-versions = ">=3.6" 56 | version = "19.10b0" 57 | 58 | [package.dependencies] 59 | appdirs = "*" 60 | attrs = ">=18.1.0" 61 | click = ">=6.5" 62 | pathspec = ">=0.6,<1" 63 | regex = "*" 64 | toml = ">=0.9.4" 65 | typed-ast = ">=1.4.0" 66 | 67 | [package.extras] 68 | d = ["aiohttp (>=3.3.2)", "aiohttp-cors"] 69 | 70 | [[package]] 71 | category = "dev" 72 | description = "Python package for providing Mozilla's CA Bundle." 73 | name = "certifi" 74 | optional = false 75 | python-versions = "*" 76 | version = "2020.4.5.1" 77 | 78 | [[package]] 79 | category = "dev" 80 | description = "Universal encoding detector for Python 2 and 3" 81 | name = "chardet" 82 | optional = false 83 | python-versions = "*" 84 | version = "3.0.4" 85 | 86 | [[package]] 87 | category = "dev" 88 | description = "Composable command line interface toolkit" 89 | marker = "python_version >= \"3.6\" and python_version < \"4.0\"" 90 | name = "click" 91 | optional = false 92 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" 93 | version = "7.1.2" 94 | 95 | [[package]] 96 | category = "dev" 97 | description = "Hosted coverage reports for GitHub, Bitbucket and Gitlab" 98 | name = "codecov" 99 | optional = false 100 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 101 | version = "2.1.3" 102 | 103 | [package.dependencies] 104 | coverage = "*" 105 | requests = ">=2.7.9" 106 | 107 | [[package]] 108 | category = "dev" 109 | description = "Cross-platform colored terminal text." 110 | marker = "sys_platform == \"win32\"" 111 | name = "colorama" 112 | optional = false 113 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" 114 | version = "0.4.3" 115 | 116 | [[package]] 117 | category = "dev" 118 | description = "Code coverage measurement for Python" 119 | name = "coverage" 120 | optional = false 121 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" 122 | version = "5.1" 123 | 124 | [package.extras] 125 | toml = ["toml"] 126 | 127 | [[package]] 128 | category = "dev" 129 | description = "Show coverage stats online via coveralls.io" 130 | name = "coveralls" 131 | optional = false 132 | python-versions = "*" 133 | version = "1.11.1" 134 | 135 | [package.dependencies] 136 | coverage = ">=3.6,<6.0" 137 | docopt = ">=0.6.1" 138 | requests = ">=1.0.0" 139 | 140 | [package.extras] 141 | yaml = ["PyYAML (>=3.10,<5.3)"] 142 | 143 | [[package]] 144 | category = "main" 145 | description = "Pythonic argument parser, that will make you smile" 146 | name = "docopt" 147 | optional = false 148 | python-versions = "*" 149 | version = "0.6.2" 150 | 151 | [[package]] 152 | category = "main" 153 | description = "A Python binding for Houdini." 154 | name = "houdini.py" 155 | optional = false 156 | python-versions = "*" 157 | version = "0.1.0" 158 | 159 | [[package]] 160 | category = "dev" 161 | description = "Internationalized Domain Names in Applications (IDNA)" 162 | name = "idna" 163 | optional = false 164 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 165 | version = "2.9" 166 | 167 | [[package]] 168 | category = "dev" 169 | description = "Read metadata from Python packages" 170 | marker = "python_version < \"3.8\"" 171 | name = "importlib-metadata" 172 | optional = false 173 | python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" 174 | version = "1.6.0" 175 | 176 | [package.dependencies] 177 | zipp = ">=0.5" 178 | 179 | [package.extras] 180 | docs = ["sphinx", "rst.linker"] 181 | testing = ["packaging", "importlib-resources"] 182 | 183 | [[package]] 184 | category = "main" 185 | description = "A small but fast and easy to use stand-alone template engine written in pure python." 186 | name = "jinja2" 187 | optional = false 188 | python-versions = "*" 189 | version = "2.7.2" 190 | 191 | [package.dependencies] 192 | markupsafe = "*" 193 | 194 | [package.extras] 195 | i18n = ["Babel (>=0.8)"] 196 | 197 | [[package]] 198 | category = "main" 199 | description = "Safely add untrusted strings to HTML/XML markup." 200 | name = "markupsafe" 201 | optional = false 202 | python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*" 203 | version = "1.1.1" 204 | 205 | [[package]] 206 | category = "main" 207 | description = "The Python binding for Sundown, a markdown parsing library." 208 | name = "misaka" 209 | optional = false 210 | python-versions = "*" 211 | version = "1.0.2" 212 | 213 | [[package]] 214 | category = "dev" 215 | description = "More routines for operating on iterables, beyond itertools" 216 | name = "more-itertools" 217 | optional = false 218 | python-versions = ">=3.5" 219 | version = "8.3.0" 220 | 221 | [[package]] 222 | category = "dev" 223 | description = "Core utilities for Python packages" 224 | name = "packaging" 225 | optional = false 226 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 227 | version = "20.3" 228 | 229 | [package.dependencies] 230 | pyparsing = ">=2.0.2" 231 | six = "*" 232 | 233 | [[package]] 234 | category = "main" 235 | description = "Parguments: A simple cli args parser for Python" 236 | name = "parguments" 237 | optional = false 238 | python-versions = "*" 239 | version = "0.3.2" 240 | 241 | [package.dependencies] 242 | docopt = ">=0.6.1" 243 | 244 | [[package]] 245 | category = "dev" 246 | description = "Object-oriented filesystem paths" 247 | marker = "python_version < \"3.6\"" 248 | name = "pathlib2" 249 | optional = false 250 | python-versions = "*" 251 | version = "2.3.5" 252 | 253 | [package.dependencies] 254 | six = "*" 255 | 256 | [[package]] 257 | category = "dev" 258 | description = "Utility library for gitignore style pattern matching of file paths." 259 | marker = "python_version >= \"3.6\" and python_version < \"4.0\"" 260 | name = "pathspec" 261 | optional = false 262 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" 263 | version = "0.8.0" 264 | 265 | [[package]] 266 | category = "main" 267 | description = "File system general utilities" 268 | name = "pathtools" 269 | optional = false 270 | python-versions = "*" 271 | version = "0.1.2" 272 | 273 | [[package]] 274 | category = "dev" 275 | description = "plugin and hook calling mechanisms for python" 276 | name = "pluggy" 277 | optional = false 278 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 279 | version = "0.13.1" 280 | 281 | [package.dependencies] 282 | [package.dependencies.importlib-metadata] 283 | python = "<3.8" 284 | version = ">=0.12" 285 | 286 | [package.extras] 287 | dev = ["pre-commit", "tox"] 288 | 289 | [[package]] 290 | category = "dev" 291 | description = "library with cross-python path, ini-parsing, io, code, log facilities" 292 | name = "py" 293 | optional = false 294 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 295 | version = "1.8.1" 296 | 297 | [[package]] 298 | category = "main" 299 | description = "Pygments is a syntax highlighting package written in Python." 300 | name = "pygments" 301 | optional = false 302 | python-versions = "*" 303 | version = "1.6" 304 | 305 | [[package]] 306 | category = "dev" 307 | description = "Python parsing module" 308 | name = "pyparsing" 309 | optional = false 310 | python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" 311 | version = "2.4.7" 312 | 313 | [[package]] 314 | category = "dev" 315 | description = "pytest: simple powerful testing with Python" 316 | name = "pytest" 317 | optional = false 318 | python-versions = ">=3.5" 319 | version = "5.4.2" 320 | 321 | [package.dependencies] 322 | atomicwrites = ">=1.0" 323 | attrs = ">=17.4.0" 324 | colorama = "*" 325 | more-itertools = ">=4.0.0" 326 | packaging = "*" 327 | pluggy = ">=0.12,<1.0" 328 | py = ">=1.5.0" 329 | wcwidth = "*" 330 | 331 | [package.dependencies.importlib-metadata] 332 | python = "<3.8" 333 | version = ">=0.12" 334 | 335 | [package.dependencies.pathlib2] 336 | python = "<3.6" 337 | version = ">=2.2.0" 338 | 339 | [package.extras] 340 | checkqa-mypy = ["mypy (v0.761)"] 341 | testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] 342 | 343 | [[package]] 344 | category = "dev" 345 | description = "Pytest plugin for measuring coverage." 346 | name = "pytest-cov" 347 | optional = false 348 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" 349 | version = "2.8.1" 350 | 351 | [package.dependencies] 352 | coverage = ">=4.4" 353 | pytest = ">=3.6" 354 | 355 | [package.extras] 356 | testing = ["fields", "hunter", "process-tests (2.0.2)", "six", "virtualenv"] 357 | 358 | [[package]] 359 | category = "main" 360 | description = "YAML parser and emitter for Python" 361 | name = "pyyaml" 362 | optional = false 363 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" 364 | version = "5.3.1" 365 | 366 | [[package]] 367 | category = "dev" 368 | description = "Alternative regular expression module, to replace re." 369 | marker = "python_version >= \"3.6\" and python_version < \"4.0\"" 370 | name = "regex" 371 | optional = false 372 | python-versions = "*" 373 | version = "2020.5.14" 374 | 375 | [[package]] 376 | category = "dev" 377 | description = "Python HTTP for Humans." 378 | name = "requests" 379 | optional = false 380 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" 381 | version = "2.23.0" 382 | 383 | [package.dependencies] 384 | certifi = ">=2017.4.17" 385 | chardet = ">=3.0.2,<4" 386 | idna = ">=2.5,<3" 387 | urllib3 = ">=1.21.1,<1.25.0 || >1.25.0,<1.25.1 || >1.25.1,<1.26" 388 | 389 | [package.extras] 390 | security = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)"] 391 | socks = ["PySocks (>=1.5.6,<1.5.7 || >1.5.7)", "win-inet-pton"] 392 | 393 | [[package]] 394 | category = "dev" 395 | description = "Python 2 and 3 compatibility utilities" 396 | name = "six" 397 | optional = false 398 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" 399 | version = "1.14.0" 400 | 401 | [[package]] 402 | category = "dev" 403 | description = "Python Library for Tom's Obvious, Minimal Language" 404 | marker = "python_version >= \"3.6\" and python_version < \"4.0\"" 405 | name = "toml" 406 | optional = false 407 | python-versions = "*" 408 | version = "0.10.1" 409 | 410 | [[package]] 411 | category = "main" 412 | description = "Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed." 413 | name = "tornado" 414 | optional = false 415 | python-versions = "*" 416 | version = "3.2" 417 | 418 | [package.dependencies] 419 | "backports.ssl_match_hostname" = "*" 420 | 421 | [[package]] 422 | category = "dev" 423 | description = "a fork of Python 2 and 3 ast modules with type comment support" 424 | marker = "python_version >= \"3.6\" and python_version < \"4.0\"" 425 | name = "typed-ast" 426 | optional = false 427 | python-versions = "*" 428 | version = "1.4.1" 429 | 430 | [[package]] 431 | category = "main" 432 | description = "Ultra fast JSON encoder and decoder for Python" 433 | name = "ujson" 434 | optional = false 435 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" 436 | version = "2.0.3" 437 | 438 | [[package]] 439 | category = "dev" 440 | description = "HTTP library with thread-safe connection pooling, file post, and more." 441 | name = "urllib3" 442 | optional = false 443 | python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" 444 | version = "1.25.9" 445 | 446 | [package.extras] 447 | brotli = ["brotlipy (>=0.6.0)"] 448 | secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "pyOpenSSL (>=0.14)", "ipaddress"] 449 | socks = ["PySocks (>=1.5.6,<1.5.7 || >1.5.7,<2.0)"] 450 | 451 | [[package]] 452 | category = "main" 453 | description = "Filesystem events monitoring" 454 | name = "watchdog" 455 | optional = false 456 | python-versions = "*" 457 | version = "0.7.0" 458 | 459 | [package.dependencies] 460 | PyYAML = ">=3.09" 461 | argh = ">=0.8.1" 462 | pathtools = ">=0.1.1" 463 | 464 | [[package]] 465 | category = "dev" 466 | description = "Measures number of Terminal column cells of wide-character codes" 467 | name = "wcwidth" 468 | optional = false 469 | python-versions = "*" 470 | version = "0.1.9" 471 | 472 | [[package]] 473 | category = "dev" 474 | description = "Backport of pathlib-compatible object wrapper for zip files" 475 | marker = "python_version < \"3.8\"" 476 | name = "zipp" 477 | optional = false 478 | python-versions = ">=2.7" 479 | version = "1.2.0" 480 | 481 | [package.extras] 482 | docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"] 483 | testing = ["pathlib2", "unittest2", "jaraco.itertools", "func-timeout"] 484 | 485 | [metadata] 486 | content-hash = "6c173080253c3ac650e495adec1d08a47017f750723521edbae94e596b0ebd48" 487 | python-versions = "^3.5" 488 | 489 | [metadata.files] 490 | appdirs = [ 491 | {file = "appdirs-1.4.4-py2.py3-none-any.whl", hash = "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128"}, 492 | {file = "appdirs-1.4.4.tar.gz", hash = "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41"}, 493 | ] 494 | argh = [ 495 | {file = "argh-0.26.2-py2.py3-none-any.whl", hash = "sha256:a9b3aaa1904eeb78e32394cd46c6f37ac0fb4af6dc488daa58971bdc7d7fcaf3"}, 496 | {file = "argh-0.26.2.tar.gz", hash = "sha256:e9535b8c84dc9571a48999094fda7f33e63c3f1b74f3e5f3ac0105a58405bb65"}, 497 | ] 498 | atomicwrites = [ 499 | {file = "atomicwrites-1.4.0-py2.py3-none-any.whl", hash = "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197"}, 500 | {file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"}, 501 | ] 502 | attrs = [ 503 | {file = "attrs-19.3.0-py2.py3-none-any.whl", hash = "sha256:08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c"}, 504 | {file = "attrs-19.3.0.tar.gz", hash = "sha256:f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72"}, 505 | ] 506 | "backports.ssl-match-hostname" = [ 507 | {file = "backports.ssl_match_hostname-3.7.0.1.tar.gz", hash = "sha256:bb82e60f9fbf4c080eabd957c39f0641f0fc247d9a16e31e26d594d8f42b9fd2"}, 508 | ] 509 | black = [ 510 | {file = "black-19.10b0-py36-none-any.whl", hash = "sha256:1b30e59be925fafc1ee4565e5e08abef6b03fe455102883820fe5ee2e4734e0b"}, 511 | {file = "black-19.10b0.tar.gz", hash = "sha256:c2edb73a08e9e0e6f65a0e6af18b059b8b1cdd5bef997d7a0b181df93dc81539"}, 512 | ] 513 | certifi = [ 514 | {file = "certifi-2020.4.5.1-py2.py3-none-any.whl", hash = "sha256:1d987a998c75633c40847cc966fcf5904906c920a7f17ef374f5aa4282abd304"}, 515 | {file = "certifi-2020.4.5.1.tar.gz", hash = "sha256:51fcb31174be6e6664c5f69e3e1691a2d72a1a12e90f872cbdb1567eb47b6519"}, 516 | ] 517 | chardet = [ 518 | {file = "chardet-3.0.4-py2.py3-none-any.whl", hash = "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"}, 519 | {file = "chardet-3.0.4.tar.gz", hash = "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"}, 520 | ] 521 | click = [ 522 | {file = "click-7.1.2-py2.py3-none-any.whl", hash = "sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc"}, 523 | {file = "click-7.1.2.tar.gz", hash = "sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a"}, 524 | ] 525 | codecov = [ 526 | {file = "codecov-2.1.3-py2.7.egg", hash = "sha256:e20e9fd7e530da14a22245862beb43a9fce9a6b998d9bf196c44d0207817b236"}, 527 | {file = "codecov-2.1.3.tar.gz", hash = "sha256:2ebd639d8f621aabcce399e475b0302e436cb7e00e7724d1b2224bbf3f215a0c"}, 528 | ] 529 | colorama = [ 530 | {file = "colorama-0.4.3-py2.py3-none-any.whl", hash = "sha256:7d73d2a99753107a36ac6b455ee49046802e59d9d076ef8e47b61499fa29afff"}, 531 | {file = "colorama-0.4.3.tar.gz", hash = "sha256:e96da0d330793e2cb9485e9ddfd918d456036c7149416295932478192f4436a1"}, 532 | ] 533 | coverage = [ 534 | {file = "coverage-5.1-cp27-cp27m-macosx_10_12_x86_64.whl", hash = "sha256:0cb4be7e784dcdc050fc58ef05b71aa8e89b7e6636b99967fadbdba694cf2b65"}, 535 | {file = "coverage-5.1-cp27-cp27m-macosx_10_13_intel.whl", hash = "sha256:c317eaf5ff46a34305b202e73404f55f7389ef834b8dbf4da09b9b9b37f76dd2"}, 536 | {file = "coverage-5.1-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:b83835506dfc185a319031cf853fa4bb1b3974b1f913f5bb1a0f3d98bdcded04"}, 537 | {file = "coverage-5.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:5f2294dbf7875b991c381e3d5af2bcc3494d836affa52b809c91697449d0eda6"}, 538 | {file = "coverage-5.1-cp27-cp27m-win32.whl", hash = "sha256:de807ae933cfb7f0c7d9d981a053772452217df2bf38e7e6267c9cbf9545a796"}, 539 | {file = "coverage-5.1-cp27-cp27m-win_amd64.whl", hash = "sha256:bf9cb9a9fd8891e7efd2d44deb24b86d647394b9705b744ff6f8261e6f29a730"}, 540 | {file = "coverage-5.1-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:acf3763ed01af8410fc36afea23707d4ea58ba7e86a8ee915dfb9ceff9ef69d0"}, 541 | {file = "coverage-5.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:dec5202bfe6f672d4511086e125db035a52b00f1648d6407cc8e526912c0353a"}, 542 | {file = "coverage-5.1-cp35-cp35m-macosx_10_12_x86_64.whl", hash = "sha256:7a5bdad4edec57b5fb8dae7d3ee58622d626fd3a0be0dfceda162a7035885ecf"}, 543 | {file = "coverage-5.1-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:1601e480b9b99697a570cea7ef749e88123c04b92d84cedaa01e117436b4a0a9"}, 544 | {file = "coverage-5.1-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:dbe8c6ae7534b5b024296464f387d57c13caa942f6d8e6e0346f27e509f0f768"}, 545 | {file = "coverage-5.1-cp35-cp35m-win32.whl", hash = "sha256:a027ef0492ede1e03a8054e3c37b8def89a1e3c471482e9f046906ba4f2aafd2"}, 546 | {file = "coverage-5.1-cp35-cp35m-win_amd64.whl", hash = "sha256:0e61d9803d5851849c24f78227939c701ced6704f337cad0a91e0972c51c1ee7"}, 547 | {file = "coverage-5.1-cp36-cp36m-macosx_10_13_x86_64.whl", hash = "sha256:2d27a3f742c98e5c6b461ee6ef7287400a1956c11421eb574d843d9ec1f772f0"}, 548 | {file = "coverage-5.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:66460ab1599d3cf894bb6baee8c684788819b71a5dc1e8fa2ecc152e5d752019"}, 549 | {file = "coverage-5.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:5c542d1e62eece33c306d66fe0a5c4f7f7b3c08fecc46ead86d7916684b36d6c"}, 550 | {file = "coverage-5.1-cp36-cp36m-win32.whl", hash = "sha256:2742c7515b9eb368718cd091bad1a1b44135cc72468c731302b3d641895b83d1"}, 551 | {file = "coverage-5.1-cp36-cp36m-win_amd64.whl", hash = "sha256:dead2ddede4c7ba6cb3a721870f5141c97dc7d85a079edb4bd8d88c3ad5b20c7"}, 552 | {file = "coverage-5.1-cp37-cp37m-macosx_10_13_x86_64.whl", hash = "sha256:01333e1bd22c59713ba8a79f088b3955946e293114479bbfc2e37d522be03355"}, 553 | {file = "coverage-5.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:e1ea316102ea1e1770724db01998d1603ed921c54a86a2efcb03428d5417e489"}, 554 | {file = "coverage-5.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:adeb4c5b608574a3d647011af36f7586811a2c1197c861aedb548dd2453b41cd"}, 555 | {file = "coverage-5.1-cp37-cp37m-win32.whl", hash = "sha256:782caea581a6e9ff75eccda79287daefd1d2631cc09d642b6ee2d6da21fc0a4e"}, 556 | {file = "coverage-5.1-cp37-cp37m-win_amd64.whl", hash = "sha256:00f1d23f4336efc3b311ed0d807feb45098fc86dee1ca13b3d6768cdab187c8a"}, 557 | {file = "coverage-5.1-cp38-cp38-macosx_10_13_x86_64.whl", hash = "sha256:402e1744733df483b93abbf209283898e9f0d67470707e3c7516d84f48524f55"}, 558 | {file = "coverage-5.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:a3f3654d5734a3ece152636aad89f58afc9213c6520062db3978239db122f03c"}, 559 | {file = "coverage-5.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:6402bd2fdedabbdb63a316308142597534ea8e1895f4e7d8bf7476c5e8751fef"}, 560 | {file = "coverage-5.1-cp38-cp38-win32.whl", hash = "sha256:8fa0cbc7ecad630e5b0f4f35b0f6ad419246b02bc750de7ac66db92667996d24"}, 561 | {file = "coverage-5.1-cp38-cp38-win_amd64.whl", hash = "sha256:79a3cfd6346ce6c13145731d39db47b7a7b859c0272f02cdb89a3bdcbae233a0"}, 562 | {file = "coverage-5.1-cp39-cp39-win32.whl", hash = "sha256:a82b92b04a23d3c8a581fc049228bafde988abacba397d57ce95fe95e0338ab4"}, 563 | {file = "coverage-5.1-cp39-cp39-win_amd64.whl", hash = "sha256:bb28a7245de68bf29f6fb199545d072d1036a1917dca17a1e75bbb919e14ee8e"}, 564 | {file = "coverage-5.1.tar.gz", hash = "sha256:f90bfc4ad18450c80b024036eaf91e4a246ae287701aaa88eaebebf150868052"}, 565 | ] 566 | coveralls = [ 567 | {file = "coveralls-1.11.1-py2.py3-none-any.whl", hash = "sha256:4b6bfc2a2a77b890f556bc631e35ba1ac21193c356393b66c84465c06218e135"}, 568 | {file = "coveralls-1.11.1.tar.gz", hash = "sha256:67188c7ec630c5f708c31552f2bcdac4580e172219897c4136504f14b823132f"}, 569 | ] 570 | docopt = [ 571 | {file = "docopt-0.6.2.tar.gz", hash = "sha256:49b3a825280bd66b3aa83585ef59c4a8c82f2c8a522dbe754a8bc8d08c85c491"}, 572 | ] 573 | "houdini.py" = [ 574 | {file = "houdini.py-0.1.0.tar.gz", hash = "sha256:cabd10734a859c34c3707ecb99b93cb78547a9128cbfabbe3f4d5628e822f666"}, 575 | ] 576 | idna = [ 577 | {file = "idna-2.9-py2.py3-none-any.whl", hash = "sha256:a068a21ceac8a4d63dbfd964670474107f541babbd2250d61922f029858365fa"}, 578 | {file = "idna-2.9.tar.gz", hash = "sha256:7588d1c14ae4c77d74036e8c22ff447b26d0fde8f007354fd48a7814db15b7cb"}, 579 | ] 580 | importlib-metadata = [ 581 | {file = "importlib_metadata-1.6.0-py2.py3-none-any.whl", hash = "sha256:2a688cbaa90e0cc587f1df48bdc97a6eadccdcd9c35fb3f976a09e3b5016d90f"}, 582 | {file = "importlib_metadata-1.6.0.tar.gz", hash = "sha256:34513a8a0c4962bc66d35b359558fd8a5e10cd472d37aec5f66858addef32c1e"}, 583 | ] 584 | jinja2 = [ 585 | {file = "Jinja2-2.7.2.tar.gz", hash = "sha256:310a35fbccac3af13ebf927297f871ac656b9da1d248b1fe6765affa71b53235"}, 586 | ] 587 | markupsafe = [ 588 | {file = "MarkupSafe-1.1.1-cp27-cp27m-macosx_10_6_intel.whl", hash = "sha256:09027a7803a62ca78792ad89403b1b7a73a01c8cb65909cd876f7fcebd79b161"}, 589 | {file = "MarkupSafe-1.1.1-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:e249096428b3ae81b08327a63a485ad0878de3fb939049038579ac0ef61e17e7"}, 590 | {file = "MarkupSafe-1.1.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:500d4957e52ddc3351cabf489e79c91c17f6e0899158447047588650b5e69183"}, 591 | {file = "MarkupSafe-1.1.1-cp27-cp27m-win32.whl", hash = "sha256:b2051432115498d3562c084a49bba65d97cf251f5a331c64a12ee7e04dacc51b"}, 592 | {file = "MarkupSafe-1.1.1-cp27-cp27m-win_amd64.whl", hash = "sha256:98c7086708b163d425c67c7a91bad6e466bb99d797aa64f965e9d25c12111a5e"}, 593 | {file = "MarkupSafe-1.1.1-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:cd5df75523866410809ca100dc9681e301e3c27567cf498077e8551b6d20e42f"}, 594 | {file = "MarkupSafe-1.1.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:43a55c2930bbc139570ac2452adf3d70cdbb3cfe5912c71cdce1c2c6bbd9c5d1"}, 595 | {file = "MarkupSafe-1.1.1-cp34-cp34m-macosx_10_6_intel.whl", hash = "sha256:1027c282dad077d0bae18be6794e6b6b8c91d58ed8a8d89a89d59693b9131db5"}, 596 | {file = "MarkupSafe-1.1.1-cp34-cp34m-manylinux1_i686.whl", hash = "sha256:62fe6c95e3ec8a7fad637b7f3d372c15ec1caa01ab47926cfdf7a75b40e0eac1"}, 597 | {file = "MarkupSafe-1.1.1-cp34-cp34m-manylinux1_x86_64.whl", hash = "sha256:88e5fcfb52ee7b911e8bb6d6aa2fd21fbecc674eadd44118a9cc3863f938e735"}, 598 | {file = "MarkupSafe-1.1.1-cp34-cp34m-win32.whl", hash = "sha256:ade5e387d2ad0d7ebf59146cc00c8044acbd863725f887353a10df825fc8ae21"}, 599 | {file = "MarkupSafe-1.1.1-cp34-cp34m-win_amd64.whl", hash = "sha256:09c4b7f37d6c648cb13f9230d847adf22f8171b1ccc4d5682398e77f40309235"}, 600 | {file = "MarkupSafe-1.1.1-cp35-cp35m-macosx_10_6_intel.whl", hash = "sha256:79855e1c5b8da654cf486b830bd42c06e8780cea587384cf6545b7d9ac013a0b"}, 601 | {file = "MarkupSafe-1.1.1-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:c8716a48d94b06bb3b2524c2b77e055fb313aeb4ea620c8dd03a105574ba704f"}, 602 | {file = "MarkupSafe-1.1.1-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:7c1699dfe0cf8ff607dbdcc1e9b9af1755371f92a68f706051cc8c37d447c905"}, 603 | {file = "MarkupSafe-1.1.1-cp35-cp35m-win32.whl", hash = "sha256:6dd73240d2af64df90aa7c4e7481e23825ea70af4b4922f8ede5b9e35f78a3b1"}, 604 | {file = "MarkupSafe-1.1.1-cp35-cp35m-win_amd64.whl", hash = "sha256:9add70b36c5666a2ed02b43b335fe19002ee5235efd4b8a89bfcf9005bebac0d"}, 605 | {file = "MarkupSafe-1.1.1-cp36-cp36m-macosx_10_6_intel.whl", hash = "sha256:24982cc2533820871eba85ba648cd53d8623687ff11cbb805be4ff7b4c971aff"}, 606 | {file = "MarkupSafe-1.1.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:00bc623926325b26bb9605ae9eae8a215691f33cae5df11ca5424f06f2d1f473"}, 607 | {file = "MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:717ba8fe3ae9cc0006d7c451f0bb265ee07739daf76355d06366154ee68d221e"}, 608 | {file = "MarkupSafe-1.1.1-cp36-cp36m-win32.whl", hash = "sha256:535f6fc4d397c1563d08b88e485c3496cf5784e927af890fb3c3aac7f933ec66"}, 609 | {file = "MarkupSafe-1.1.1-cp36-cp36m-win_amd64.whl", hash = "sha256:b1282f8c00509d99fef04d8ba936b156d419be841854fe901d8ae224c59f0be5"}, 610 | {file = "MarkupSafe-1.1.1-cp37-cp37m-macosx_10_6_intel.whl", hash = "sha256:8defac2f2ccd6805ebf65f5eeb132adcf2ab57aa11fdf4c0dd5169a004710e7d"}, 611 | {file = "MarkupSafe-1.1.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:46c99d2de99945ec5cb54f23c8cd5689f6d7177305ebff350a58ce5f8de1669e"}, 612 | {file = "MarkupSafe-1.1.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:ba59edeaa2fc6114428f1637ffff42da1e311e29382d81b339c1817d37ec93c6"}, 613 | {file = "MarkupSafe-1.1.1-cp37-cp37m-win32.whl", hash = "sha256:b00c1de48212e4cc9603895652c5c410df699856a2853135b3967591e4beebc2"}, 614 | {file = "MarkupSafe-1.1.1-cp37-cp37m-win_amd64.whl", hash = "sha256:9bf40443012702a1d2070043cb6291650a0841ece432556f784f004937f0f32c"}, 615 | {file = "MarkupSafe-1.1.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6788b695d50a51edb699cb55e35487e430fa21f1ed838122d722e0ff0ac5ba15"}, 616 | {file = "MarkupSafe-1.1.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:cdb132fc825c38e1aeec2c8aa9338310d29d337bebbd7baa06889d09a60a1fa2"}, 617 | {file = "MarkupSafe-1.1.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:13d3144e1e340870b25e7b10b98d779608c02016d5184cfb9927a9f10c689f42"}, 618 | {file = "MarkupSafe-1.1.1-cp38-cp38-win32.whl", hash = "sha256:596510de112c685489095da617b5bcbbac7dd6384aeebeda4df6025d0256a81b"}, 619 | {file = "MarkupSafe-1.1.1-cp38-cp38-win_amd64.whl", hash = "sha256:e8313f01ba26fbbe36c7be1966a7b7424942f670f38e666995b88d012765b9be"}, 620 | {file = "MarkupSafe-1.1.1.tar.gz", hash = "sha256:29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b"}, 621 | ] 622 | misaka = [ 623 | {file = "misaka-1.0.2.tar.gz", hash = "sha256:6197e4886ff0c2718df1b472e40b5fea45f447a7a5b0192a48123ee868973517"}, 624 | ] 625 | more-itertools = [ 626 | {file = "more-itertools-8.3.0.tar.gz", hash = "sha256:558bb897a2232f5e4f8e2399089e35aecb746e1f9191b6584a151647e89267be"}, 627 | {file = "more_itertools-8.3.0-py3-none-any.whl", hash = "sha256:7818f596b1e87be009031c7653d01acc46ed422e6656b394b0f765ce66ed4982"}, 628 | ] 629 | packaging = [ 630 | {file = "packaging-20.3-py2.py3-none-any.whl", hash = "sha256:82f77b9bee21c1bafbf35a84905d604d5d1223801d639cf3ed140bd651c08752"}, 631 | {file = "packaging-20.3.tar.gz", hash = "sha256:3c292b474fda1671ec57d46d739d072bfd495a4f51ad01a055121d81e952b7a3"}, 632 | ] 633 | parguments = [ 634 | {file = "parguments-0.3.2-py2.7.egg", hash = "sha256:b8676bd877596233d82ae29359eb22a62bc6f06793cfe4d6c3b880ea73a02060"}, 635 | {file = "parguments-0.3.2.tar.gz", hash = "sha256:a58340fa8578aba50243e57399ec9efaf77f5e0c47c2c3435ec38d9cefec528f"}, 636 | ] 637 | pathlib2 = [ 638 | {file = "pathlib2-2.3.5-py2.py3-none-any.whl", hash = "sha256:0ec8205a157c80d7acc301c0b18fbd5d44fe655968f5d947b6ecef5290fc35db"}, 639 | {file = "pathlib2-2.3.5.tar.gz", hash = "sha256:6cd9a47b597b37cc57de1c05e56fb1a1c9cc9fab04fe78c29acd090418529868"}, 640 | ] 641 | pathspec = [ 642 | {file = "pathspec-0.8.0-py2.py3-none-any.whl", hash = "sha256:7d91249d21749788d07a2d0f94147accd8f845507400749ea19c1ec9054a12b0"}, 643 | {file = "pathspec-0.8.0.tar.gz", hash = "sha256:da45173eb3a6f2a5a487efba21f050af2b41948be6ab52b6a1e3ff22bb8b7061"}, 644 | ] 645 | pathtools = [ 646 | {file = "pathtools-0.1.2.tar.gz", hash = "sha256:7c35c5421a39bb82e58018febd90e3b6e5db34c5443aaaf742b3f33d4655f1c0"}, 647 | ] 648 | pluggy = [ 649 | {file = "pluggy-0.13.1-py2.py3-none-any.whl", hash = "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"}, 650 | {file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"}, 651 | ] 652 | py = [ 653 | {file = "py-1.8.1-py2.py3-none-any.whl", hash = "sha256:c20fdd83a5dbc0af9efd622bee9a5564e278f6380fffcacc43ba6f43db2813b0"}, 654 | {file = "py-1.8.1.tar.gz", hash = "sha256:5e27081401262157467ad6e7f851b7aa402c5852dbcb3dae06768434de5752aa"}, 655 | ] 656 | pygments = [ 657 | {file = "Pygments-1.6-py2.6.egg", hash = "sha256:8f2d2fcef78d32292be95f460fcab6ebe65273a59cda6042fa4657e491b69d14"}, 658 | {file = "Pygments-1.6-py2.7.egg", hash = "sha256:e34c30aa9941b0b48272a4daca73beded432570c535a229554b187c11e535d7e"}, 659 | {file = "Pygments-1.6.tar.gz", hash = "sha256:799ed4caf77516e54440806d8d9cd82a7607dfdf4e4fb643815171a4b5c921c0"}, 660 | ] 661 | pyparsing = [ 662 | {file = "pyparsing-2.4.7-py2.py3-none-any.whl", hash = "sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b"}, 663 | {file = "pyparsing-2.4.7.tar.gz", hash = "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"}, 664 | ] 665 | pytest = [ 666 | {file = "pytest-5.4.2-py3-none-any.whl", hash = "sha256:95c710d0a72d91c13fae35dce195633c929c3792f54125919847fdcdf7caa0d3"}, 667 | {file = "pytest-5.4.2.tar.gz", hash = "sha256:eb2b5e935f6a019317e455b6da83dd8650ac9ffd2ee73a7b657a30873d67a698"}, 668 | ] 669 | pytest-cov = [ 670 | {file = "pytest-cov-2.8.1.tar.gz", hash = "sha256:cc6742d8bac45070217169f5f72ceee1e0e55b0221f54bcf24845972d3a47f2b"}, 671 | {file = "pytest_cov-2.8.1-py2.py3-none-any.whl", hash = "sha256:cdbdef4f870408ebdbfeb44e63e07eb18bb4619fae852f6e760645fa36172626"}, 672 | ] 673 | pyyaml = [ 674 | {file = "PyYAML-5.3.1-cp27-cp27m-win32.whl", hash = "sha256:74809a57b329d6cc0fdccee6318f44b9b8649961fa73144a98735b0aaf029f1f"}, 675 | {file = "PyYAML-5.3.1-cp27-cp27m-win_amd64.whl", hash = "sha256:240097ff019d7c70a4922b6869d8a86407758333f02203e0fc6ff79c5dcede76"}, 676 | {file = "PyYAML-5.3.1-cp35-cp35m-win32.whl", hash = "sha256:4f4b913ca1a7319b33cfb1369e91e50354d6f07a135f3b901aca02aa95940bd2"}, 677 | {file = "PyYAML-5.3.1-cp35-cp35m-win_amd64.whl", hash = "sha256:cc8955cfbfc7a115fa81d85284ee61147059a753344bc51098f3ccd69b0d7e0c"}, 678 | {file = "PyYAML-5.3.1-cp36-cp36m-win32.whl", hash = "sha256:7739fc0fa8205b3ee8808aea45e968bc90082c10aef6ea95e855e10abf4a37b2"}, 679 | {file = "PyYAML-5.3.1-cp36-cp36m-win_amd64.whl", hash = "sha256:69f00dca373f240f842b2931fb2c7e14ddbacd1397d57157a9b005a6a9942648"}, 680 | {file = "PyYAML-5.3.1-cp37-cp37m-win32.whl", hash = "sha256:d13155f591e6fcc1ec3b30685d50bf0711574e2c0dfffd7644babf8b5102ca1a"}, 681 | {file = "PyYAML-5.3.1-cp37-cp37m-win_amd64.whl", hash = "sha256:73f099454b799e05e5ab51423c7bcf361c58d3206fa7b0d555426b1f4d9a3eaf"}, 682 | {file = "PyYAML-5.3.1-cp38-cp38-win32.whl", hash = "sha256:06a0d7ba600ce0b2d2fe2e78453a470b5a6e000a985dd4a4e54e436cc36b0e97"}, 683 | {file = "PyYAML-5.3.1-cp38-cp38-win_amd64.whl", hash = "sha256:95f71d2af0ff4227885f7a6605c37fd53d3a106fcab511b8860ecca9fcf400ee"}, 684 | {file = "PyYAML-5.3.1.tar.gz", hash = "sha256:b8eac752c5e14d3eca0e6dd9199cd627518cb5ec06add0de9d32baeee6fe645d"}, 685 | ] 686 | regex = [ 687 | {file = "regex-2020.5.14-cp27-cp27m-win32.whl", hash = "sha256:e565569fc28e3ba3e475ec344d87ed3cd8ba2d575335359749298a0899fe122e"}, 688 | {file = "regex-2020.5.14-cp27-cp27m-win_amd64.whl", hash = "sha256:d466967ac8e45244b9dfe302bbe5e3337f8dc4dec8d7d10f5e950d83b140d33a"}, 689 | {file = "regex-2020.5.14-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:27ff7325b297fb6e5ebb70d10437592433601c423f5acf86e5bc1ee2919b9561"}, 690 | {file = "regex-2020.5.14-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:ea55b80eb0d1c3f1d8d784264a6764f931e172480a2f1868f2536444c5f01e01"}, 691 | {file = "regex-2020.5.14-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:c9bce6e006fbe771a02bda468ec40ffccbf954803b470a0345ad39c603402577"}, 692 | {file = "regex-2020.5.14-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:d881c2e657c51d89f02ae4c21d9adbef76b8325fe4d5cf0e9ad62f850f3a98fd"}, 693 | {file = "regex-2020.5.14-cp36-cp36m-win32.whl", hash = "sha256:99568f00f7bf820c620f01721485cad230f3fb28f57d8fbf4a7967ec2e446994"}, 694 | {file = "regex-2020.5.14-cp36-cp36m-win_amd64.whl", hash = "sha256:70c14743320a68c5dac7fc5a0f685be63bc2024b062fe2aaccc4acc3d01b14a1"}, 695 | {file = "regex-2020.5.14-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:a7c37f048ec3920783abab99f8f4036561a174f1314302ccfa4e9ad31cb00eb4"}, 696 | {file = "regex-2020.5.14-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:89d76ce33d3266173f5be80bd4efcbd5196cafc34100fdab814f9b228dee0fa4"}, 697 | {file = "regex-2020.5.14-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:51f17abbe973c7673a61863516bdc9c0ef467407a940f39501e786a07406699c"}, 698 | {file = "regex-2020.5.14-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:ce5cc53aa9fbbf6712e92c7cf268274eaff30f6bd12a0754e8133d85a8fb0f5f"}, 699 | {file = "regex-2020.5.14-cp37-cp37m-win32.whl", hash = "sha256:8044d1c085d49673aadb3d7dc20ef5cb5b030c7a4fa253a593dda2eab3059929"}, 700 | {file = "regex-2020.5.14-cp37-cp37m-win_amd64.whl", hash = "sha256:c2062c7d470751b648f1cacc3f54460aebfc261285f14bc6da49c6943bd48bdd"}, 701 | {file = "regex-2020.5.14-cp38-cp38-manylinux1_i686.whl", hash = "sha256:329ba35d711e3428db6b45a53b1b13a0a8ba07cbbcf10bbed291a7da45f106c3"}, 702 | {file = "regex-2020.5.14-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:579ea215c81d18da550b62ff97ee187b99f1b135fd894a13451e00986a080cad"}, 703 | {file = "regex-2020.5.14-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:3a9394197664e35566242686d84dfd264c07b20f93514e2e09d3c2b3ffdf78fe"}, 704 | {file = "regex-2020.5.14-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:ce367d21f33e23a84fb83a641b3834dd7dd8e9318ad8ff677fbfae5915a239f7"}, 705 | {file = "regex-2020.5.14-cp38-cp38-win32.whl", hash = "sha256:1386e75c9d1574f6aa2e4eb5355374c8e55f9aac97e224a8a5a6abded0f9c927"}, 706 | {file = "regex-2020.5.14-cp38-cp38-win_amd64.whl", hash = "sha256:7e61be8a2900897803c293247ef87366d5df86bf701083b6c43119c7c6c99108"}, 707 | {file = "regex-2020.5.14.tar.gz", hash = "sha256:ce450ffbfec93821ab1fea94779a8440e10cf63819be6e176eb1973a6017aff5"}, 708 | ] 709 | requests = [ 710 | {file = "requests-2.23.0-py2.py3-none-any.whl", hash = "sha256:43999036bfa82904b6af1d99e4882b560e5e2c68e5c4b0aa03b655f3d7d73fee"}, 711 | {file = "requests-2.23.0.tar.gz", hash = "sha256:b3f43d496c6daba4493e7c431722aeb7dbc6288f52a6e04e7b6023b0247817e6"}, 712 | ] 713 | six = [ 714 | {file = "six-1.14.0-py2.py3-none-any.whl", hash = "sha256:8f3cd2e254d8f793e7f3d6d9df77b92252b52637291d0f0da013c76ea2724b6c"}, 715 | {file = "six-1.14.0.tar.gz", hash = "sha256:236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a"}, 716 | ] 717 | toml = [ 718 | {file = "toml-0.10.1-py2.py3-none-any.whl", hash = "sha256:bda89d5935c2eac546d648028b9901107a595863cb36bae0c73ac804a9b4ce88"}, 719 | {file = "toml-0.10.1.tar.gz", hash = "sha256:926b612be1e5ce0634a2ca03470f95169cf16f939018233a670519cb4ac58b0f"}, 720 | ] 721 | tornado = [ 722 | {file = "tornado-3.2.tar.gz", hash = "sha256:c8c2949c8d42af781437e356978f00a42b16a090612573cd7385c62451a00c2b"}, 723 | ] 724 | typed-ast = [ 725 | {file = "typed_ast-1.4.1-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:73d785a950fc82dd2a25897d525d003f6378d1cb23ab305578394694202a58c3"}, 726 | {file = "typed_ast-1.4.1-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:aaee9905aee35ba5905cfb3c62f3e83b3bec7b39413f0a7f19be4e547ea01ebb"}, 727 | {file = "typed_ast-1.4.1-cp35-cp35m-win32.whl", hash = "sha256:0c2c07682d61a629b68433afb159376e24e5b2fd4641d35424e462169c0a7919"}, 728 | {file = "typed_ast-1.4.1-cp35-cp35m-win_amd64.whl", hash = "sha256:4083861b0aa07990b619bd7ddc365eb7fa4b817e99cf5f8d9cf21a42780f6e01"}, 729 | {file = "typed_ast-1.4.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:269151951236b0f9a6f04015a9004084a5ab0d5f19b57de779f908621e7d8b75"}, 730 | {file = "typed_ast-1.4.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:24995c843eb0ad11a4527b026b4dde3da70e1f2d8806c99b7b4a7cf491612652"}, 731 | {file = "typed_ast-1.4.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:fe460b922ec15dd205595c9b5b99e2f056fd98ae8f9f56b888e7a17dc2b757e7"}, 732 | {file = "typed_ast-1.4.1-cp36-cp36m-win32.whl", hash = "sha256:4e3e5da80ccbebfff202a67bf900d081906c358ccc3d5e3c8aea42fdfdfd51c1"}, 733 | {file = "typed_ast-1.4.1-cp36-cp36m-win_amd64.whl", hash = "sha256:249862707802d40f7f29f6e1aad8d84b5aa9e44552d2cc17384b209f091276aa"}, 734 | {file = "typed_ast-1.4.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8ce678dbaf790dbdb3eba24056d5364fb45944f33553dd5869b7580cdbb83614"}, 735 | {file = "typed_ast-1.4.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:c9e348e02e4d2b4a8b2eedb48210430658df6951fa484e59de33ff773fbd4b41"}, 736 | {file = "typed_ast-1.4.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:bcd3b13b56ea479b3650b82cabd6b5343a625b0ced5429e4ccad28a8973f301b"}, 737 | {file = "typed_ast-1.4.1-cp37-cp37m-win32.whl", hash = "sha256:d5d33e9e7af3b34a40dc05f498939f0ebf187f07c385fd58d591c533ad8562fe"}, 738 | {file = "typed_ast-1.4.1-cp37-cp37m-win_amd64.whl", hash = "sha256:0666aa36131496aed8f7be0410ff974562ab7eeac11ef351def9ea6fa28f6355"}, 739 | {file = "typed_ast-1.4.1-cp38-cp38-macosx_10_15_x86_64.whl", hash = "sha256:d205b1b46085271b4e15f670058ce182bd1199e56b317bf2ec004b6a44f911f6"}, 740 | {file = "typed_ast-1.4.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:6daac9731f172c2a22ade6ed0c00197ee7cc1221aa84cfdf9c31defeb059a907"}, 741 | {file = "typed_ast-1.4.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:498b0f36cc7054c1fead3d7fc59d2150f4d5c6c56ba7fb150c013fbc683a8d2d"}, 742 | {file = "typed_ast-1.4.1-cp38-cp38-win32.whl", hash = "sha256:715ff2f2df46121071622063fc7543d9b1fd19ebfc4f5c8895af64a77a8c852c"}, 743 | {file = "typed_ast-1.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:fc0fea399acb12edbf8a628ba8d2312f583bdbdb3335635db062fa98cf71fca4"}, 744 | {file = "typed_ast-1.4.1-cp39-cp39-macosx_10_15_x86_64.whl", hash = "sha256:d43943ef777f9a1c42bf4e552ba23ac77a6351de620aa9acf64ad54933ad4d34"}, 745 | {file = "typed_ast-1.4.1.tar.gz", hash = "sha256:8c8aaad94455178e3187ab22c8b01a3837f8ee50e09cf31f1ba129eb293ec30b"}, 746 | ] 747 | ujson = [ 748 | {file = "ujson-2.0.3-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:7ae13733d9467d16ccac2f38212cdee841b49ae927085c533425be9076b0bc9d"}, 749 | {file = "ujson-2.0.3-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:6217c63a36e9b26e9271e686d212397ce7fb04c07d85509dd4e2ed73493320f8"}, 750 | {file = "ujson-2.0.3-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:c8369ef49169804944e920c427e350182e33756422b69989c55608fc28bebf98"}, 751 | {file = "ujson-2.0.3-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:0c23f21e8d2b60efab57bc6ce9d1fb7c4e96f4bfefbf5a6043a3f3309e2a738a"}, 752 | {file = "ujson-2.0.3-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:3d1f4705a4ec1e48ff383a4d92299d8ec25e9a8158bcea619912440948117634"}, 753 | {file = "ujson-2.0.3-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:2ab88e330405315512afe9276f29a60e9b3439187b273665630a57ed7fe1d936"}, 754 | {file = "ujson-2.0.3.tar.gz", hash = "sha256:bd2deffc983827510e5145fb66e4cc0f577480c62fe0b4882139f8f7d27ae9a3"}, 755 | ] 756 | urllib3 = [ 757 | {file = "urllib3-1.25.9-py2.py3-none-any.whl", hash = "sha256:88206b0eb87e6d677d424843ac5209e3fb9d0190d0ee169599165ec25e9d9115"}, 758 | {file = "urllib3-1.25.9.tar.gz", hash = "sha256:3018294ebefce6572a474f0604c2021e33b3fd8006ecd11d62107a5d2a963527"}, 759 | ] 760 | watchdog = [ 761 | {file = "watchdog-0.7.0.tar.gz", hash = "sha256:8d89934fede6ec0dfe4d128606e36b989ba0b27b6cf74bd042b818b554625240"}, 762 | ] 763 | wcwidth = [ 764 | {file = "wcwidth-0.1.9-py2.py3-none-any.whl", hash = "sha256:cafe2186b3c009a04067022ce1dcd79cb38d8d65ee4f4791b8888d6599d1bbe1"}, 765 | {file = "wcwidth-0.1.9.tar.gz", hash = "sha256:ee73862862a156bf77ff92b09034fc4825dd3af9cf81bc5b360668d425f3c5f1"}, 766 | ] 767 | zipp = [ 768 | {file = "zipp-1.2.0-py2.py3-none-any.whl", hash = "sha256:e0d9e63797e483a30d27e09fffd308c59a700d365ec34e93cc100844168bf921"}, 769 | {file = "zipp-1.2.0.tar.gz", hash = "sha256:c70410551488251b0fee67b460fb9a536af8d6f9f008ad10ac51f615b6a521b1"}, 770 | ] 771 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool] 2 | [tool.poetry] 3 | name = "Catsup" 4 | version = "0.3.11" 5 | description = "Catsup, a lightweight static blog generator" 6 | authors = ["Wu Haotian "] 7 | keywords = ["catsup", "blog", "site", "static", "static", "blog", "static", "site", "generator"] 8 | classifiers = ["Development Status :: 4 - Beta", "Environment :: Console", "License :: OSI Approved :: MIT License", "Operating System :: MacOS", "Operating System :: POSIX", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8"] 9 | readme = "README.rst" 10 | 11 | 12 | [tool.poetry.scripts] 13 | catsup = "catsup.cli:main" 14 | 15 | [tool.poetry.dependencies] 16 | python = "^3.5" 17 | docopt = "==0.6.2" 18 | "houdini.py" = "==0.1.0" 19 | jinja2 = "==2.7.2" 20 | misaka = "==1.0.2" 21 | parguments = "==0.3.2" 22 | pygments = "==1.6" 23 | tornado = "==3.2" 24 | ujson = "==2.0.3" 25 | watchdog = "==0.7.0" 26 | pyyaml = "^5.3" 27 | 28 | [tool.poetry.dev-dependencies] 29 | pytest = "^5.4.2" 30 | pytest-cov = "^2.8.1" 31 | coveralls = "^1.11.1" 32 | black = {version = "^19.10b0", python = "^3.6"} 33 | codecov = "^2.1.3" 34 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["@whtsky"] 3 | } 4 | -------------------------------------------------------------------------------- /tests/.gitignore: -------------------------------------------------------------------------------- 1 | deploy/ 2 | -------------------------------------------------------------------------------- /tests/2013-02-11-test.md: -------------------------------------------------------------------------------- 1 | # Hello, World! Markdown! 2 | 3 | - tags: Hello, World 4 | 5 | --- 6 | 7 | Hi! 8 | I'm happy to use Catsup! 9 | 中文测试 10 | 11 | *** 12 | 13 | ```python 14 | print("Hello, World!") 15 | ``` 16 | -------------------------------------------------------------------------------- /tests/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "site": { 3 | "name": "blogname", 4 | "description": "Just another catsup blog", 5 | "url": "http://blog.com/" 6 | }, 7 | 8 | "author": { 9 | "name": "nickname", 10 | "email": "name@exmaple.com", 11 | "twitter": "twitter" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/conftest.py: -------------------------------------------------------------------------------- 1 | import os 2 | import pytest 3 | 4 | BASE_DIR = os.path.abspath(os.path.dirname(__file__)) 5 | SITE_DIR = os.path.join(BASE_DIR, "site") 6 | 7 | 8 | @pytest.fixture 9 | def site_dir(): 10 | return SITE_DIR 11 | 12 | 13 | @pytest.fixture 14 | def output_exist(): 15 | return lambda path: os.path.exists(os.path.join(SITE_DIR, "deploy", path)) 16 | 17 | 18 | @pytest.fixture(autouse=True) 19 | def chdir(): 20 | from catsup.options import g 21 | 22 | os.chdir(SITE_DIR) 23 | g.cwdpath = SITE_DIR 24 | -------------------------------------------------------------------------------- /tests/no_meta.txt: -------------------------------------------------------------------------------- 1 | fjsdklfjskdal -------------------------------------------------------------------------------- /tests/post.txt: -------------------------------------------------------------------------------- 1 | --- 2 | title: Hello, World! 3 | tags: Hello, World 4 | time: 2014-01-04 20:56 5 | --- 6 | 7 | Hi! 8 | I'm happy to use Catsup! 9 | 中文测试 10 | -------------------------------------------------------------------------------- /tests/site/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "site": { 3 | "name": "blogname", 4 | "description": "Just another catsup blog", 5 | "url": "http://blog.com/" 6 | }, 7 | 8 | "author": { 9 | "name": "nickname", 10 | "email": "name@exmaple.com", 11 | "twitter": "twitter" 12 | }, 13 | 14 | "config": { 15 | "source": "posts", 16 | "static_source": "static", 17 | "output": "deploy", 18 | "static_output": "deploy/static", 19 | "static_prefix": "/static/", 20 | "analytics": "" 21 | }, 22 | 23 | "permalink": { 24 | "page": "/page/{page}/", 25 | "post": "/{filename}/", 26 | "tag": "/tag/{name}/", 27 | "tags": "/tag/index.html", 28 | "archive": "/archive/{year}/", 29 | "archives": "/archive/index.html", 30 | "feed": "/feed.xml" 31 | }, 32 | 33 | "comment": { 34 | "allow": true, 35 | "system": "disqus", 36 | "shortname": "catsup" 37 | }, 38 | 39 | "deploy": { 40 | "default": "rsync", 41 | 42 | "git": { 43 | "repo": "repo url here", 44 | "branch": "master", 45 | "delete": true 46 | }, 47 | 48 | "rsync": { 49 | "ssh_port": 22, 50 | "ssh_user": "username", 51 | "ssh_host": "123.45.6.78", 52 | "document_root": "~/website.com/", 53 | "delete": true 54 | } 55 | }, 56 | 57 | "theme": { 58 | "name": "sealscript", 59 | "vars": { 60 | "github": "whtsky", 61 | "links": [ 62 | { 63 | "name": "catsup", 64 | "url": "https://github.com/whtsky/catsup", 65 | "description": "Awesome!" 66 | } 67 | ] 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /tests/site/config2.json: -------------------------------------------------------------------------------- 1 | { 2 | "site": { 3 | "name": "blogname", 4 | "description": "Just another catsup blog", 5 | "url": "http://blog.com/" 6 | }, 7 | 8 | "author": { 9 | "name": "nickname", 10 | "email": "name@exmaple.com", 11 | "twitter": "twitter" 12 | }, 13 | 14 | "config": { 15 | "source": "noposts", 16 | "static_source": "static", 17 | "output": "deploy", 18 | "static_output": "deploy/static", 19 | "static_prefix": "/static/", 20 | "analytics": "" 21 | }, 22 | 23 | "permalink": { 24 | "page": "/page/{page}/", 25 | "post": "/{title}/", 26 | "tag": "/tag/{name}/", 27 | "tags": "/tag/index.html", 28 | "archive": "/archive/{year}/", 29 | "archives": "/archive/index.html", 30 | "feed": "/feed.xml" 31 | }, 32 | 33 | "comment": { 34 | "allow": true, 35 | "system": "disqus", 36 | "shortname": "catsup" 37 | }, 38 | 39 | "deploy": { 40 | "default": "rsync", 41 | 42 | "git": { 43 | "repo": "repo url here", 44 | "branch": "master", 45 | "delete": true 46 | }, 47 | 48 | "rsync": { 49 | "ssh_port": 22, 50 | "ssh_user": "username", 51 | "ssh_host": "123.45.6.78", 52 | "document_root": "~/website.com/", 53 | "delete": true 54 | } 55 | }, 56 | 57 | "theme": { 58 | "name": "sealscript", 59 | "vars": { 60 | "github": "whtsky", 61 | "links": [ 62 | { 63 | "name": "catsup", 64 | "url": "https://github.com/whtsky/catsup", 65 | "description": "Awesome!" 66 | } 67 | ] 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /tests/site/noposts/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtsky/Catsup/e7db1ce7d84cef7efc9923b9bd9047319fc9822e/tests/site/noposts/.gitkeep -------------------------------------------------------------------------------- /tests/site/posts/.should-not-exist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtsky/Catsup/e7db1ce7d84cef7efc9923b9bd9047319fc9822e/tests/site/posts/.should-not-exist -------------------------------------------------------------------------------- /tests/site/posts/2013-12-12-html.html: -------------------------------------------------------------------------------- 1 | --- 2 | type: page 3 | --- 4 | 5 |

Hi, I'm writing in HTML!

6 | -------------------------------------------------------------------------------- /tests/site/posts/hh.txt: -------------------------------------------------------------------------------- 1 | --- 2 | time: 2014-01-04 23:12 3 | --- 4 | 5 | Hello! 6 | -------------------------------------------------------------------------------- /tests/site/posts/page.markdown: -------------------------------------------------------------------------------- 1 | # Page 2 | 3 | - time: 2014-01-05 00:05 4 | - permalink: /page.html 5 | - type: page 6 | 7 | --- 8 | 9 | This is a single Page. -------------------------------------------------------------------------------- /tests/site/posts/should-exist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtsky/Catsup/e7db1ce7d84cef7efc9923b9bd9047319fc9822e/tests/site/posts/should-exist -------------------------------------------------------------------------------- /tests/site/themes/test/templates/page.html: -------------------------------------------------------------------------------- 1 |
    2 | {% for post in pagination.items %} 3 |
  • {{ post.title }}
  • 4 | {% endfor %} 5 |
6 | 7 |
8 | {% if pagination.has_prev %} 9 | 10 | {% endif %} 11 | 12 | Page {{ pagination.page }} of {{ pagination.pages }} 13 | 14 | {% if pagination.has_next %} 15 | 16 | {% endif %} 17 |
18 | -------------------------------------------------------------------------------- /tests/site/themes/test/templates/post.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% from 'utils.html' import render_comment, meta %} 4 | {{ meta(post) }} 5 | {{ post.title }} | {{ site.name }} 6 | 7 | 8 | 9 |

{{ post.title }}

10 |
11 | {{ post.datetime.strftime("%b %d, %Y") }} 12 |
13 |
14 | {{ post.content }} 15 |
16 |
17 | Tags: 18 | {% for tag in post.tags %} 19 | {{ tag.name }} 20 | {% endfor %} 21 |
22 | {{ render_comment(post) }} 23 | 24 | 25 | -------------------------------------------------------------------------------- /tests/site/themes/test/theme.py: -------------------------------------------------------------------------------- 1 | name = "test" 2 | author = "whtsky" 3 | homepage = "https://github.com/whtsky/catsup" 4 | post_per_page = 2 5 | vars = {} 6 | -------------------------------------------------------------------------------- /tests/test_meta_parser.py: -------------------------------------------------------------------------------- 1 | from pytest import raises 2 | from catsup.reader.meta import parse_meta, parse_catsup_meta, parse_yaml_meta 3 | 4 | 5 | def test_catsup_meta_parser(): 6 | meta_txt = """ 7 | # Hello, world! 8 | 9 | - tags: hello, world 10 | """ 11 | lines = [l.strip() for l in meta_txt.splitlines() if l] 12 | meta = parse_catsup_meta(lines) 13 | assert meta.title == "Hello, world!" 14 | assert meta.tags == "hello, world" 15 | 16 | 17 | def test_catsup_meta_parser_error_1(): 18 | with raises(SystemExit): 19 | parse_catsup_meta(["fsdaf-,-,-,-", "fdsa- 0,"]) 20 | 21 | 22 | def test_catsup_meta_parser_error_2(): 23 | with raises(SystemExit): 24 | parse_catsup_meta(["#fsdaf-,-,-,-", "fdsa- 0,"]) 25 | 26 | 27 | def test_base_meta(): 28 | pass 29 | 30 | 31 | def test_meta_parser(): 32 | meta_txt = """ 33 | # Hello, world! 34 | 35 | - tags: hello, world 36 | """ 37 | 38 | lines = [l.strip() for l in meta_txt.splitlines() if l] 39 | meta = parse_meta(lines) 40 | assert meta.title == "Hello, world!" 41 | assert meta.tags == "hello, world" 42 | 43 | 44 | def test_parse_unknown_meta(): 45 | with raises(SystemExit): 46 | parse_meta(["fdsjaklfdsjaklfdsjaklfjdsklfjsa"]) 47 | -------------------------------------------------------------------------------- /tests/test_parser.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | BASE_DIR = os.path.abspath(os.path.dirname(__file__)) 4 | 5 | from pytest import raises 6 | 7 | 8 | def test_config_parser(): 9 | from catsup.parser.config import parse 10 | from catsup.utils import ObjectDict 11 | 12 | config = parse(os.path.join(BASE_DIR, "config.json")) 13 | assert config == ObjectDict( 14 | { 15 | u"site": { 16 | u"url": u"http://blog.com/", 17 | u"name": u"blogname", 18 | u"description": u"Just another catsup blog", 19 | }, 20 | u"author": { 21 | u"twitter": u"twitter", 22 | u"name": u"nickname", 23 | u"email": u"name@exmaple.com", 24 | }, 25 | } 26 | ) 27 | 28 | 29 | def test_parser_non_exist_file(): 30 | from catsup.parser.config import parse 31 | 32 | with raises(SystemExit): 33 | parse("fd") 34 | -------------------------------------------------------------------------------- /tests/test_permalink.py: -------------------------------------------------------------------------------- 1 | # -*- coding:utf-8 -*- 2 | 3 | import os 4 | import catsup.parser 5 | 6 | from catsup.options import g 7 | from catsup.reader import txt_reader 8 | 9 | BASE_DIR = os.path.abspath(os.path.dirname(__file__)) 10 | 11 | 12 | def test_post_permalink(): 13 | post_path = os.path.join(BASE_DIR, "post.txt") 14 | post = txt_reader(post_path) 15 | g.config = catsup.parser.config(os.path.join(BASE_DIR, "config.json")) 16 | g.config.permalink.post = "/{title}/" 17 | assert post.permalink == "/Hello,-World!/" 18 | g.config.permalink.post = "/{filename}/" 19 | assert post.permalink == "/post/" 20 | g.config.permalink.post = "/{date}/{title}/" 21 | assert post.permalink == "/2014-01-04/Hello,-World!/" 22 | g.config.permalink.post = "/{datetime.year}/{filename}/" 23 | assert post.permalink == "/2014/post/" 24 | -------------------------------------------------------------------------------- /tests/test_reader.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | import os 4 | 5 | from pytest import raises 6 | 7 | from catsup.utils import to_unicode 8 | 9 | BASE_DIR = os.path.abspath(os.path.dirname(__file__)) 10 | 11 | 12 | def test_reader_choser(): 13 | from catsup.reader import get_reader, markdown_reader, txt_reader 14 | 15 | assert get_reader("md") == markdown_reader 16 | assert get_reader("markdown") == markdown_reader 17 | assert get_reader("txt") == txt_reader 18 | 19 | 20 | def test_open_unexist_file(): 21 | from catsup.reader.utils import open_file 22 | 23 | with raises(SystemExit): 24 | open_file(">_<") 25 | 26 | 27 | def test_txt_reader(): 28 | import datetime 29 | from catsup.reader import txt_reader 30 | 31 | post_path = os.path.join(BASE_DIR, "post.txt") 32 | post = txt_reader(post_path) 33 | assert post.path == post_path 34 | assert post.date == post.datetime.strftime("%Y-%m-%d") == "2014-01-04" 35 | assert post.datetime == datetime.datetime(2014, 1, 4, 20, 56) 36 | assert post.title == "Hello, World!" 37 | assert post.content == to_unicode( 38 | "
Hi!
I'm happy to use Catsup!
中文测试
" 39 | ) 40 | 41 | 42 | def test_read_txt_without_meta(): 43 | from catsup.reader import txt_reader 44 | 45 | post_path = os.path.join(BASE_DIR, "no_meta.txt") 46 | post = txt_reader(post_path) 47 | assert post.title == "no_meta", post.title 48 | 49 | 50 | def test_md_reader(): 51 | from catsup.reader import markdown_reader 52 | 53 | post_path = os.path.join(BASE_DIR, "2013-02-11-test.md") 54 | post = markdown_reader(post_path) 55 | assert post.path == post_path 56 | assert post.date == post.datetime.strftime("%Y-%m-%d") == "2013-02-11" 57 | -------------------------------------------------------------------------------- /tests/test_theme_utils.py: -------------------------------------------------------------------------------- 1 | from catsup.themes.utils import search_github 2 | 3 | 4 | def test_search_github(): 5 | theme = search_github("clean") 6 | assert theme["name"] == "catsup-theme-clean" 7 | assert theme["clone_url"] == "https://github.com/whtsky/catsup-theme-clean.git" 8 | -------------------------------------------------------------------------------- /tests/test_with_cli.py: -------------------------------------------------------------------------------- 1 | from pytest import raises 2 | 3 | 4 | def test_build(output_exist): 5 | from catsup.cli import clean, build 6 | 7 | clean(settings="config.json") 8 | build(settings="config.json") 9 | assert output_exist("feed.xml") 10 | assert output_exist("index.html") 11 | assert output_exist("page.html") 12 | assert output_exist("sitemap.txt") 13 | assert output_exist("should-exist") 14 | assert not output_exist(".should-not-exist") 15 | 16 | 17 | def test_init(): 18 | import os 19 | from catsup.cli import init 20 | 21 | os.remove("config.json") 22 | init("./") 23 | 24 | 25 | def test_reinit(): 26 | from catsup.cli import init 27 | 28 | with raises(SystemExit): 29 | init("./") 30 | 31 | 32 | def test_generate_without_post(output_exist): 33 | from catsup.cli import clean, build 34 | 35 | clean(settings="config2.json") 36 | build(settings="config2.json") 37 | assert not output_exist("page.html") 38 | --------------------------------------------------------------------------------