Exemplo n.º 1
0
    def __init__(self):
        self.verbose = False
        config_path = os.path.join(CONFIG_DIR, "blog_config.cfg")
        self.config = Config(config_path, backup_dir=BACKUP_DIR)
        self.blog_list = self.config.read(all_keys=True)
        self.config_keys = [
            "google_analytics_id",
            "disqus_username",
            "blog_images_dir",
            "templates_dir",
            "blog_posts_dir",
            "default",
            "working_dir",
            "blog_dir",
        ]
        self.optional_config = [
            "meta_format",  # comment format in metadata
            "post_extract_list",  # resource to extract from file
            "index_div_name",  # div name of posts list in blog index
            "filter_post_without_title",  # filter titleless post from indexing
            "working_dir_timestamp",  # Timestamp of last checked working dir
            "create_nbdata_file",  # Flag for creating nbdata file
            "delete_ipynb_meta",  # Delete metadata in ipynb file after reading
            "feed_file",  # Path of feed file
            "site_url",  # URL of website [for building feed links].
            "md_summary_limit",  # No of charectar to include in md summary.
            "ipynb_summary_limit",  # ipynb char limit or Cell no to extract
        ]

        self.SUPPORTED_EXTENSIONS = ["md", "ipynb", "html"]
        self.current_blog = ""
Exemplo n.º 2
0
    def __init__(self):
        self.verbose = False
        config_path = os.path.join(CONFIG_DIR, 'blog_config.cfg')
        self.config = Config(config_path, backup_dir='~/.blogger/backup/')
        self.blog_list = self.config.read(all_keys=True)
        self.config_keys = [
            'google_analytics_id', 'disqus_username', 'blog_images_dir',
            'templates_dir', 'blog_posts_dir', 'default', 'working_dir',
            'blog_dir'
        ]
        self.optional_config = [
            'meta_format', 'post_extract_list', 'index_div_name',
            'filter_post_without_title', 'working_dir_timestamp',
            'create_nbdata_file', 'delete_ipynb_meta'
        ]

        self.SUPPORTED_EXTENSIONS = ['md', 'ipynb', 'html']
        self.current_blog = ''
Exemplo n.º 3
0
def get_config(ctx):
    config_path = os.path.join(CONFIG_DIR, ctx.current_blog, "meta.json")
    config = Config(config_path)
    return config