def main(args=None): if args is None: args = sys.argv summary = make_summary() result = summary.getResult('both', '') summary_path = to_abs_path('../../dest/summary.md') with open(summary_path, 'w') as fout: fout.write(result.encode('utf-8')) return 0
import re import sys from markdown.blockprocessors import BlockProcessor from markdown.preprocessors import Preprocessor from markdown.preprocessors import ReferencePreprocessor from markdown.extensions import Extension from markdown import markdown from util import to_abs_path _CHANGELOG_PATH = to_abs_path('../../CHANGELOG.md') _SITES_PATH = to_abs_path('../../SITES.md') _TEMPLATE_PATH = to_abs_path('./summary.template.md') _MESSAGE = { 'both': '''**Lite edition** removes image-hosting site support from **Full edition**. If you prefer to use other userscripts to deal with image-hosting sites, you can use the Lite edition. ''', 'full': 'If you do not need image-hosting site support, please see [Lite edition]({url}).', 'lite': 'Lite edition does not support image-hosting sites. If you want full-featured edition, please see [here]({url}).', } class _ChangeLogProcessor(BlockProcessor): def __init__(self, parser, pack): BlockProcessor.__init__(self, parser) self._pack = pack