Source code for book.nav

"""Navigation Bar Helper."""

import abc
import json
import typing

from django.conf import settings

VERSION = getattr(settings, "VERSION", "0.0.1")
NAV_ITEM_JSON = getattr(settings, "NAV_ITEM_JSON", None)
if NAV_ITEM_JSON:
    nav_config = json.load(open(NAV_ITEM_JSON, encoding="utf-8"))
else:
    nav_config = None

















sidebar = Sidebar(nav_config)


[docs]def get_render_dict(current_page: str) -> dict: """ Context 에 current_page 를 만들어 주는 함수. :param current_page: 현재 page string :type current_page: str :return: """ render_dict = {"current_page": current_page} return render_dict