Ejemplo n.º 1
0
    def test_invalid_pages(self):

        option = config_options.NumPages()
        config = {
            'key': None,
            'pages': None
        }
        option.post_validation(config, 'key')
        self.assertEqual({
            'key': False,
            'pages': None
        }, config)
Ejemplo n.º 2
0
    def test_provided(self):

        option = config_options.NumPages()
        config = {
            'key': True,
            'pages': None
        }
        option.post_validation(config, 'key')
        self.assertEqual({
            'key': True,
            'pages': None
        }, config)
Ejemplo n.º 3
0
    def test_many_pages(self):

        option = config_options.NumPages()
        config = {
            'key': None,
            'pages': [1, 2, 3]
        }
        option.post_validation(config, 'key')
        self.assertEqual({
            'key': True,
            'pages': [1, 2, 3]
        }, config)
Ejemplo n.º 4
0
    ('edit_uri', config_options.Type(utils.string_types)),

    # Specify which css or javascript files from the docs directory should be
    # additionally included in the site. Default, List of all .css and .js
    # files in the docs dir.
    ('extra_css', config_options.Extras(file_match=utils.is_css_file)),
    ('extra_javascript',
     config_options.Extras(file_match=utils.is_javascript_file)),

    # Similar to the above, but each template (HTML or XML) will be build with
    # Jinja2 and the global context.
    ('extra_templates', config_options.Extras()),

    # Determine if the site should include the nav and next/prev elements.
    # Default, True if the site has more than one page, False otherwise.
    ('include_nav', config_options.NumPages()),
    ('include_next_prev', config_options.NumPages()),

    # PyMarkdown extension names.
    ('markdown_extensions',
     config_options.MarkdownExtensions(
         builtins=['meta', 'toc', 'tables', 'fenced_code'],
         configkey='mdx_configs',
         default=[])),

    # PyMarkdown Extension Configs. For internal use only.
    ('mdx_configs', config_options.Private()),

    # enabling strict mode causes MkDocs to stop the build when a problem is
    # encountered rather than display an error.
    ('strict', config_options.Type(bool, default=False)),