ó ÿgdSc@sªdZddlmZddlZddlZddlmZddlmZddl m Z m Z m Z m Z ddlmZddlmZd efd „ƒYZdS( sÛ sphinx.builders.websupport ~~~~~~~~~~~~~~~~~~~~~~~~~~ Builder for the web support package. :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. iÿÿÿÿ(tpathN(t StringOutput(tBuiltinTemplateLoader(tos_patht relative_urit ensuredirtcopyfile(tPickleHTMLBuilder(tWebSupportTranslatortWebSupportBuildercBs‰eZdZdZdZd„Zd„Zd„Zd„Zd„Z d„Z d „Z dd „Z d ddd „Zd „Zd„ZRS(s7 Builds documents for the web support package. t websupportt commentablecCsLtj|ƒ|jƒt|jtƒs8tdƒ‚n|jjdƒdS(Ns:websupport builder must be used with the builtin templatess_static/websupport.js( Rtinittinit_templatest isinstancet templatesRt RuntimeErrort script_filestappend(tself((sD/usr/local/lib/python2.7/site-packages/sphinx/builders/websupport.pyR s   cCs(||_||_||_||_dS(N(t staticdirtvirtual_staticdirtsearchtstorage(RRRRR((sD/usr/local/lib/python2.7/site-packages/sphinx/builders/websupport.pyt set_webinfo*s   cCs t|_dS(N(Rttranslator_class(R((sD/usr/local/lib/python2.7/site-packages/sphinx/builders/websupport.pytinit_translator_class0scCs!tj||ƒt|jdˆj|ƒ}t||ƒp=dSdtjˆj|ƒSdS(Ns://t#R!(tget_target_uriRR,R-R(totheruritresourcetbaseuri(R(sD/usr/local/lib/python2.7/site-packages/sphinx/builders/websupport.pytpathtoYs RPcs|ˆjjkS(N(R(tall_docs(tname(R(sD/usr/local/lib/python2.7/site-packages/sphinx/builders/websupport.pytcsthasdocR csˆjˆ|S(N(t_get_local_toctree(tkw(RJR(sD/usr/local/lib/python2.7/site-packages/sphinx/builders/websupport.pyRSesttoctreeshtml-page-contextR;R@R?tsidebartrelbartscripttcss(RtcopytFalseRLtconfigthtml_output_encodingt add_sidebarstupdatetapptemitR*Rt environmentt get_templatet make_modulethasattrtgetattr( RRJtaddctxt templatenameR%R=RPtdoc_ctxttemplatettemplate_moduletitem((RJRsD/usr/local/lib/python2.7/site-packages/sphinx/builders/websupport.pyt _render_pageRs*    s page.htmlc CsÓ|j||||ƒ\}}|sLtj|jdt|ƒ|jƒ}nttj|ƒƒ|j||ƒ|j dƒrÏtj|j dt|dƒƒ}ttj|ƒƒt |j j |ƒ|ƒndS(Ntpicklest sourcenamet_sources(RoRR-toutdirRt out_suffixRtdirnamet dump_contextR*RRR(tdoc2path( RRJRiRjt outfilenameR%R=Rkt source_name((sD/usr/local/lib/python2.7/site-packages/sphinx/builders/websupport.pyR7zs  cCsÖ|jdidƒ\}}|d|jd<|d|jdRERItNoneRoR7R|R‡(((sD/usr/local/lib/python2.7/site-packages/sphinx/builders/websupport.pyR s       ( (RŠtosRR,R~t docutils.ioRtsphinx.jinja2glueRtsphinx.util.osutilRRRRtsphinx.builders.htmlRtsphinx.writers.websupportRR (((sD/usr/local/lib/python2.7/site-packages/sphinx/builders/websupport.pyt s  "