from config_urls import URLS
from config_texts import TEXTS
from config_code import CODE
from config_styles import STYLES
from config_colors import COLORS
from config_presentation import PRESENTATION
from config_files_to_copy import FILES_TO_COPY

config = {
    "toc": {
        "home_label": TEXTS["home_label"]
    },

    "mkdocs": {
        "site_name": TEXTS["site_name"],
        "site_url": URLS["site_url"],
        "site_description": TEXTS["site_description"],
        "site_author": "Serge Tahé",
        "repo_url": URLS["repo_url"],
        "repo_name": "GitHub",
        "use_directory_urls": False,

        "theme": {
            "name": "material",
            "custom_dir": "overrides",
            "features": [
                "navigation.sections",
                "navigation.indexes",
                "navigation.expand",
                "toc.integrate",
                "navigation.top"
            ],
            "palette": [
                {
                    "media": COLORS["theme"]["palette"]["light"]["media"],
                    "scheme": COLORS["theme"]["palette"]["light"]["scheme"],
                    "primary": COLORS["theme"]["palette"]["light"]["primary"],
                    "accent": COLORS["theme"]["palette"]["light"]["accent"],
                    "toggle": {
                        "icon": "material/brightness-7",
                        "name": TEXTS["toggle_to_dark"]
                    }
                },
                {
                    "media": COLORS["theme"]["palette"]["dark"]["media"],
                    "scheme": COLORS["theme"]["palette"]["dark"]["scheme"],
                    "primary": COLORS["theme"]["palette"]["dark"]["primary"],
                    "accent": COLORS["theme"]["palette"]["dark"]["accent"],
                    "toggle": {
                        "icon": "material/brightness-4",
                        "name": TEXTS["toggle_to_light"]
                    }
                }
            ]
        },

        "markdown_extensions": [
            "admonition",
            "attr_list",
            "pymdownx.superfences",
            "pymdownx.mark",
            {
                "pymdownx.highlight": {
                    "anchor_linenums": True,
                    "linenums": None
                }
            },
            "md_in_html",
            "footnotes"
        ],

        "extra_javascript": [
            "javascripts/focus.js"
        ],
        "extra_css": [
            "stylesheets/focus.css"
        ]
    },

    "footer": (
        "{% block footer %}\n"
        "  <div class=\"md-footer-meta md-typeset\">\n"
        "    <div class=\"md-footer-meta__inner\">\n\n"
        "      <div>\n"
        f"        <a href=\"{URLS['author_site']}\" target=\"_blank\">\n"
        f"          {URLS['author_site']}\n"
        "        </a>\n"
        "        <br>\n"
        f"        {TEXTS['footer_license_sentence']}\n"
        "      </div>\n\n"
        "    </div>\n"
        "  </div>\n"
        "{% endblock %}"
    ),

    "extra": {
        "analytics": {
            "provider": "google",
            "property": "G-EBZC3JVJNR"
        }
    },

    "document_title": {
        "style_names": STYLES["style_names"],
        "css": (
            f"font-size: {PRESENTATION['document_title']['font_size']}; "
            f"font-weight: {PRESENTATION['document_title']['font_weight']}; "
            f"margin-bottom: {PRESENTATION['document_title']['margin_bottom']}; "
            f"line-height: {PRESENTATION['document_title']['line_height']}; "
            f"color: {COLORS['document_title']['color']};"
        )
    },

    "code": {
        "case_insensitive_languages": ["sql", "html", "vbnet", "vbscript"],
        "style_keywords": ["code"],
        "default_language": "text",
        "rich_line_height": PRESENTATION["code"]["rich_line_height"],
        "rich_font_family": PRESENTATION["code"]["rich_font_family"],
        "rich_font_size": PRESENTATION["code"]["rich_font_size"],
        "detection_rules": CODE["detection_rules"],
        "copy_button": True,
        "copy_label": TEXTS["copy_label"],
        "copy_copied_label": TEXTS["copy_copied_label"],
        "copy_only_recognized_language": True,
        "copy_min_lines": 4,
        "copy_allow_pygments_heuristic": True,
        "copy_style": {
            "container": PRESENTATION["copy_button"]["container"],
            "btn": (
                PRESENTATION["copy_button"]["btn"]
                + f"border:1px solid {COLORS['copy_button']['border']}; "
                + f"background:{COLORS['copy_button']['background']}; "
                + f"color:{COLORS['copy_button']['text']}; "
            ),
            "btn_hover": (
                f"background:{COLORS['copy_button']['background_hover']}; "
                + PRESENTATION["copy_button"]["btn_hover"]
            ),
            "btn_copied": PRESENTATION["copy_button"]["btn_copied"]
        }
    },

    "images": {
        "shadow": {
            "enabled": PRESENTATION["images"]["shadow"]["enabled"],
            "border_radius": PRESENTATION["images"]["shadow"]["border_radius"],
            "zoomable": COLORS["images"]["shadow"]["zoomable"],
            "zoomable_hover": COLORS["images"]["shadow"]["zoomable_hover"],
            "lightbox": COLORS["images"]["shadow"]["lightbox"],
        }
    },

    "frame": {
        "header_bg_light": COLORS["frame"]["header_bg_light"],
        "header_bg_dark": COLORS["frame"]["header_bg_dark"],
        "header_top_border_light": COLORS["frame"]["header_top_border_light"],
        "header_top_border_dark": COLORS["frame"]["header_top_border_dark"],
        "header_top_border_width": PRESENTATION["frame"]["header_top_border_width"]
    },

    "files_to_copy": FILES_TO_COPY,

    "debug": True
}
