o
    &Nid                     @   s|   d Z ddlZddlmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ dZeZeeZdd	 Zd
d Zdd Zdd ZdS )zZ
Sphinx Read the Docs theme.

From https://github.com/ryan-roemer/sphinx-bootstrap-theme.
    N)path)version_info)_)	getLoggerz3.1.0c                  C   s(   t td tttt} | S )z Return list of HTML theme paths.z}Calling get_html_theme_path is deprecated. If you are calling it to define html_theme_path, you are safe to remove that code.)loggerwarningr   r   abspathdirname__file__)cur_dir r   M/home/ubuntu/.local/lib/python3.10/site-packages/sphinx_rtd_theme/__init__.pyget_html_theme_path   s
   r   c                 C   sr   |j pi }|drttd |drttd |dr)ttd d|jv r7ttd d S d S )	Ncanonical_urlzXThe canonical_url option is deprecated, use the html_baseurl option from Sphinx instead.analytics_idz_The analytics_id option is deprecated, use the sphinxcontrib-googleanalytics extension instead.analytics_anonymize_ipziThe analytics_anonymize_ip option is deprecated, use the sphinxcontrib-googleanalytics extension instead.extra_css_filesz[The extra_css_file option is deprecated, use the html_css_files option from Sphinx instead.)html_theme_optionsgetr   r   r   html_context)appconfigtheme_optionsr   r   r   config_initiated    s$   




r   c                 C   sT   t |d< tjdddk|d< |d r&tj D ]\}}|dr%|||< qd S d S )Nsphinx_version_infoREADTHEDOCSFTrueREADTHEDOCS_)sphinx_versionosenvironr   items
startswith)r   pagenametemplatenamecontextdoctreekeyvaluer   r   r   extend_html_context7   s   
r)   c                 C   s   t d dk rtd | d | jjrtd tdkr.| d ddlm	} || | j | 
d	ttt ttttd
}| d| | dt d| j_| dt dddS )Nr      zDPython 2 is not supported with sphinx_rtd_theme, update to Python 3.z6.0z6'html4_writer' is not supported with sphinx_rtd_theme.)   r   r   zsphinxcontrib.jquery)add_js_filessphinx_rtd_themelocalesphinxzconfig-initedu   zhtml-page-contextT)parallel_read_safeparallel_write_safe)python_versionr   errorrequire_sphinxr   html4_writerr   setup_extensionsphinxcontrib.jqueryr,   add_html_themer   r   r	   r
   joinadd_message_catalogconnectr   html_permalinks_iconr)   )r   jquery_add_js_filesrtd_locale_pathr   r   r   setupF   s    




r?   )__doc__r   r   sysr   r2   r/   r   sphinx.localer   sphinx.util.loggingr   __version____version_full____name__r   r   r   r)   r?   r   r   r   r   <module>   s    
