diff --git a/bin/admin/build-docs b/bin/admin/build-docs deleted file mode 100755 index 2ee2ba99973..00000000000 --- a/bin/admin/build-docs +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python - -# Copyright (c) Twisted Matrix Laboratories. -# See LICENSE for details. - -# This script is not meant to be distributed to users of Twisted. -# It is only for use in making upstream Twisted releases. - -import sys - -from twisted.python._release import SphinxBuilder - -SphinxBuilder().main(sys.argv[1:]) diff --git a/docs/_extensions/traclinks.py b/docs/_extensions/traclinks.py deleted file mode 100644 index f54c43dfc2c..00000000000 --- a/docs/_extensions/traclinks.py +++ /dev/null @@ -1,34 +0,0 @@ -""" -Sphinx/docutils extension to create links to a Trac site using a -RestructuredText interpreted text role that looks like this:: - - :trac:`trac_link_text` - -for example:: - - :trac:`#2015` - -creates a link to ticket number 2015. - -adapted from recipe U{here } -""" - -import urllib - -from docutils import nodes, utils - - -def make_trac_link(name, rawtext, text, lineno, inliner, options={}, content=[]): - env = inliner.document.settings.env - trac_url = env.config.traclinks_base_url - ref = trac_url + "/intertrac/" + urllib.quote(text, safe="") - node = nodes.reference(rawtext, utils.unescape(text), refuri=ref, **options) - return [node], [] - - -# setup function to register the extension - - -def setup(app): - app.add_config_value("traclinks_base_url", "https://twistedmatrix.com/trac", "env") - app.add_role("trac", make_trac_link) diff --git a/docs/_themes/twisteddefault/theme.conf b/docs/_themes/twisteddefault/theme.conf deleted file mode 100644 index 7cb2d722bbb..00000000000 --- a/docs/_themes/twisteddefault/theme.conf +++ /dev/null @@ -1,28 +0,0 @@ -[theme] -inherit = default -stylesheet = default.css -pygments_style = sphinx - -[options] -rightsidebar = true -stickysidebar = false - -footerbgcolor = #565656 -footertextcolor = #ffffff -sidebarbgcolor = #565656 -sidebartextcolor = #ffffff -sidebarlinkcolor = #ffffff -relbarbgcolor = #565656 -relbartextcolor = #ffffff -relbarlinkcolor = #ffffff -bgcolor = #ffffff -textcolor = #000000 -headbgcolor = #ffffff -headtextcolor = #83a501 -headlinkcolor = #c60f0f -linkcolor = #517489 -codebgcolor = #eeffcc -codetextcolor = #333333 - -bodyfont = 'Trebuchet MS', arial, verdana, 'Bitstream Vera Sans', helvetica, sans-serif -headfont = 'Trebuchet MS', arial, verdana, 'Bitstream Vera Sans', helvetica, sans-serif diff --git a/docs/_themes/twistedtrac/layout.html b/docs/_themes/twistedtrac/layout.html deleted file mode 100644 index a62435041c7..00000000000 --- a/docs/_themes/twistedtrac/layout.html +++ /dev/null @@ -1,283 +0,0 @@ -{%- block doctype -%} - -{%- endblock %} - -{%- set reldelim1 = reldelim1 is not defined and ' »' or reldelim1 %} -{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %} - -{%- macro relbar() %} - -{%- endmacro %} - -{%- macro sidebar() %} - {%- if not embedded %}{% if not theme_nosidebar|tobool %} -
-
- {%- block sidebarlogo %} - {%- if logo %} - - {%- endif %} - {%- endblock %} - {%- block sidebartoc %} - {%- if display_toc %} -

{{ _('Table Of Contents') }}

- {{ toc }} - {%- endif %} - {%- endblock %} - {%- block sidebarrel %} - {%- if prev %} -

{{ _('Previous topic') }}

-

{{ prev.title }}

- {%- endif %} - {%- if next %} -

{{ _('Next topic') }}

-

{{ next.title }}

- {%- endif %} - {%- endblock %} - {%- block sidebarsourcelink %} - {%- if show_source and has_source and sourcename %} -

{{ _('This Page') }}

- - {%- endif %} - {%- endblock %} - {%- if customsidebar %} - {% include customsidebar %} - {%- endif %} - {%- block sidebarsearch %} - {%- if pagename != "search" %} - - - {%- endif %} - {%- endblock %} -
-
- {%- endif %}{% endif %} -{%- endmacro %} - - - - - - - {{ metatags }} - {%- if not embedded and docstitle %} - {%- set titlesuffix = " — "|safe + docstitle|e %} - {%- else %} - {%- set titlesuffix = "" %} - {%- endif %} - {{ title|striptags }}{{ titlesuffix }} - - - {%- if not embedded %} - - {%- for scriptfile in script_files %} - - {%- endfor %} - {%- if use_opensearch %} - - {%- endif %} - {%- if favicon %} - - {%- endif %} - {%- endif %} -{%- block linktags %} - {%- if hasdoc('about') %} - - {%- endif %} - {%- if hasdoc('genindex') %} - - {%- endif %} - {%- if hasdoc('search') %} - - {%- endif %} - {%- if hasdoc('copyright') %} - - {%- endif %} - - {%- if parents %} - - {%- endif %} - {%- if next %} - - {%- endif %} - {%- if prev %} - - {%- endif %} -{%- endblock %} -{%- block extrahead %} {% endblock %} - - - - - - - - - -{%- block relbar1 %}{{ relbar() }}{% endblock %} - -
- - - -{%- block sidebar1 %} {# possible location for sidebar #} {% endblock %} - -
-{%- block document %} -
- {%- if not embedded %}{% if not theme_nosidebar|tobool %} -
- {%- endif %}{% endif %} - -
- {% block body %} {% endblock %} -
- {%- if not embedded %}{% if not theme_nosidebar|tobool %} -
- {%- endif %}{% endif %} -
-{%- endblock %} - -{%- block sidebar2 %}{{ sidebar() }}{% endblock %} -
-
- -
- - - - diff --git a/docs/_themes/twistedtrac/static/css/trac.css b/docs/_themes/twistedtrac/static/css/trac.css deleted file mode 100644 index a21fe00271a..00000000000 --- a/docs/_themes/twistedtrac/static/css/trac.css +++ /dev/null @@ -1,609 +0,0 @@ -/* Trac CSS */ -body { - background: #fff; - color: #000; - margin: 0px; /* Modified */ - padding: 0; -} -body, th, td { - font: normal 13px trebuchet ms,verdana,arial,'Bitstream Vera Sans',helvetica,sans-serif; /* Modified */ -} -h1, h2, h3, h4 { - font-family: trebuchet ms,arial,verdana,'Bitstream Vera Sans',helvetica,sans-serif; /* Modified */ - font-weight: normal; /* Modified */ - letter-spacing: -0.018em; - color: #83A501; /* Modified */ - border-width: 0 0 1px 0; /* Modified */ - border-style: dotted; /* Modified */ - border-color: #dddddd; /* Modified */ -} -h1 { font-size: 19px; margin: .15em 1em 0 0 } -h2 { font-size: 16px } -h3 { font-size: 14px } -hr { border: none; border-top: 1px solid #ccb; margin: 2em 0 } -address { font-style: normal } -img { border: none; } - -.underline { text-decoration: underline } -ol.loweralpha { list-style-type: lower-alpha } -ol.upperalpha { list-style-type: upper-alpha } -ol.lowerroman { list-style-type: lower-roman } -ol.upperroman { list-style-type: upper-roman } -ol.arabic { list-style-type: decimal } - -/* Link styles */ -:link, :visited { - text-decoration: none; - color: #517489; /* Modified */ - border-bottom: 0px dotted #bbb; -} -:link:hover, :visited:hover { - background-color: transparent; - color: #555; -} -h1 :link, h1 :visited ,h2 :link, h2 :visited, h3 :link, h3 :visited, -h4 :link, h4 :visited, h5 :link, h5 :visited, h6 :link, h6 :visited { - color: inherit; -} - -/* Heading anchors */ -.anchor:link, .anchor:visited { - border: none; - color: #d7d7d7; - font-size: .8em; - vertical-align: text-top; -} -* > .anchor:link, * > .anchor:visited { - visibility: hidden; -} -h1:hover .anchor, h2:hover .anchor, h3:hover .anchor, -h4:hover .anchor, h5:hover .anchor, h6:hover .anchor { - visibility: visible; -} - -@media screen { - a.ext-link .icon { - background: url(../extlink.gif) left center no-repeat; - padding-left: 16px; - } - * html a.ext-link .icon { display: inline-block; } -} - -/* Forms */ -input, textarea, select { margin: 0px } -input, select { vertical-align: middle } -input[type=button], input[type=submit], input[type=reset] { - background-color: #517489; /* Modified */ - color: #ffffff; /* Modified */ - border: 1px solid #334a57; /* Modified */ - padding: .1em .5em; -} -input[type=button]:hover, input[type=submit]:hover, input[type=reset]:hover { - background: #303030; /* Modified */ - border-color: #292929; /* Modified */ - color: #ffffff; /* Modified */ -} -input[type=button][disabled], input[type=submit][disabled], -input[type=reset][disabled] { - background: #f6f6f6; - border-style: solid; - color: #999; -} -input[type=text], input.textwidget, textarea { border: 1px solid #8caabb; background-color: #d5e1e7; color: #000000; } /* Modified */ -input[type=text], input.textwidget { padding: .2em .5em } -input[type=text]:focus, input.textwidget:focus, textarea:focus { - border-color: #517489; /* Modified */ -} -option { border-bottom: 1px dotted #d7d7d7 } -fieldset { border: 1px solid #d7d7d7; padding: .5em; margin: 0 } -fieldset.iefix { background: transparent; border: none; padding: 0; margin: 0 } -* html fieldset.iefix { width: 98% } -fieldset.iefix p { margin: 0 } -legend { color: #999; padding: 0 .25em; font-size: 90%; font-weight: bold } -label.disabled { color: #d7d7d7 } -.buttons { margin: .5em .5em .5em 0 } -.buttons form, .buttons form div { display: inline } -.buttons input { margin: 1em .5em .1em 0 } -.inlinebuttons input { - font-size: 70%; - border-width: 1px; - border-style: dotted; - margin: 0; - padding: 0.1em; - background: none; -} - -input[type=submit] { - background-color: #517489; -} - -/* Header */ -#header hr { display: none } -#header h1 { margin: 1.5em 0 -1.5em; } -#header img { border: none; margin: 0 0 -3em } -#header :link, #header :visited, #header :link:hover, #header :visited:hover { - background: transparent; - color: #555; - margin-bottom: 2px; - border: none; -} -#header h1 :link:hover, #header h1 :visited:hover { color: #000 } - -/* Quick search */ -#search, #topsearch { - clear: both; - font-size: 10px; - height: 2.2em; - margin: 0 71px 1em 0; /* Modified */ - text-align: right; -} - -#topsearch input, #topsearch input[type=button], #topsearch input[type=submit], #topsearch input[type=reset], #topsearch input[type=text], #topsearch input.textwidget { - font-size: 10px; - background-color: #333; /* Modified */ - color: #ffffff; /* Modified */ - border: 1px solid #222; /* Modified */ -} - -#topsearch input[type=text] { - background-color: #222; /* Modified */ -} - -#search input, #search input[type=button], #search input[type=submit], #search input[type=reset], #search input[type=text], #search input.textwidget { - font-size: 10px; - background-color: #383838; /* Modified */ - color: #ffffff; /* Modified */ - border: 1px solid #333333; /* Modified */ -} -#search, #topsearch label { display: none } - -/* Navigation */ -.nav h2, .nav hr { display: none } -.nav ul { font-size: 10px; list-style: none; margin: 0; text-align: right } -.nav li { - border-right: 0px solid #d7d7d7; /* Modified */ - display: inline; - padding: 0 .75em; - white-space: nowrap; -} -.nav li.last { border-right: none } - -/* Main navigation bar */ -#mainnav { - background: #f7f7f7 url(../menu_grad.png) 0 0; /* Modified */ - border: 0px solid #000; /* Modified */ - font: normal 10px trebuchet ms,verdana,'Bitstream Vera Sans',helvetica,arial,sans-serif; /* Modified */ - margin: 0; /* Modified */ - padding: .3em 50px .3em 0; /* Modified */ -} -#mainnav li { border-right: none; padding: .25em 0 } -#mainnav :link, #mainnav :visited { - background: url(../dots.gif) 0 0 no-repeat; - border-right: 0px solid #fff; /* Modified */ - border-bottom: none; - border-left: 0px solid #555; /* Modified */ - color: #ffffff; /* Modified */ - padding: .3em 20px; /* Modified */ -} -* html #mainnav :link, * html #mainnav :visited { background-position: 1px 0 } -#mainnav :link:hover, #mainnav :visited:hover { - background-color: #444444; /* Modified */ - border-right: 0px solid #ddd; /* Modified */ -} -#mainnav .active :link, #mainnav .active :visited { - background: #444444 0 0 repeat-x; /* Modified */ - border-top: none; - border-right: 0px solid #000; /* Modified */ - color: #eee; - font-weight: bold; -} -#mainnav .active :link:hover, #mainnav .active :visited:hover { - /* - border-right: 1px solid #000; - */ -} - -/* Context-dependent navigation links */ -#ctxtnav { background-image: url(../ctxt_grad.png); height: 30px; padding: 5px 61px 0 0; } /* Modified */ -#ctxtnav li ul { - background: #f7f7f7; - color: #ccc; - border: 1px solid; - padding: 0; - display: inline; - margin: 0; -} -#ctxtnav li li { padding: 0; } -#ctxtnav li li :link, #ctxtnav li li :visited { padding: 0 1em } -#ctxtnav li li :link:hover, #ctxtnav li li :visited:hover { - background: #bba; - color: #fff; -} - -#ctxtnav :link, #ctxtnav :visited { - color: #555555; - -} -#ctxtnav :link:hover, #ctxtnav :visited:hover { - color: #999999; -} - -/* Alternate links */ -#altlinks { clear: both; text-align: center } -#altlinks h3 { font-size: 12px; letter-spacing: normal; margin: 0 } -#altlinks ul { list-style: none; margin: 0; padding: 0 0 1em } -#altlinks li { - border-right: 1px solid #d7d7d7; - display: inline; - font-size: 11px; - line-height: 16px; - padding: 0 1em; - white-space: nowrap; -} -#altlinks li.last { border-right: none } -#altlinks li :link, #altlinks li :visited { - background-position: 0 -1px; - background-repeat: no-repeat; - border: none; -} -#altlinks li a.ics { background-image: url(../ics.png); padding-left: 22px } -#altlinks li a.rss { background-image: url(../xml.png); padding-left: 42px } - -/* Footer */ -#footer { - clear: both; - color: #bbb; - font-size: 10px; - border-top: 0px solid; /* Modified */ - height: 150px; /* Modified */ - background-image: url(../footer_grad.png); /* Modified */ - padding: 50px 50px 0 50px; /* Modified */ -} -#footer :link, #footer :visited { color: #bbb; } -#footer hr { display: none } -#footer #tracpowered { border: 0; float: left } -#footer #tracpowered:hover { background: transparent } -#footer p { margin: 0 } -#footer p.left, p.left2 { - float: left; - margin-left: 1em; - padding: 0 1em; -} - -#footer p.left { - border-left: 1px solid #d7d7d7; - border-right: 1px solid #d7d7d7; -} - -#footer p.left2 { - color: #666; -} - -#footer p.right { - float: right; - text-align: right; -} - -#content { padding:0 50px 0 50px; position: relative } - -#help { - clear: both; - color: #999; - font-size: 90%; - margin: 1em; - text-align: right; -} -#help :link, #help :visited { cursor: help } -#help hr { display: none } - -/* Page preferences form */ -#prefs { - background: #edf9c0; - border: 1px solid #bce715; - float: right; - font-size: 9px; - padding: .8em; - position: relative; - margin: 0 1em 1em; -} -* html #prefs { width: 26em } /* Set width only for IE */ -#prefs input, #prefs select { font-size: 9px; vertical-align: middle } -#prefs fieldset { - background: transparent; - border: none; - margin: .5em; - padding: 0; -} -#prefs fieldset legend { - background: transparent; - color: #000; - font-size: 9px; - font-weight: normal; - margin: 0 0 0 -1.5em; - padding: 0; -} -#prefs .buttons { text-align: right } - -/* Version information (browser, wiki, attachments) */ -#info { - margin: 1em 0 0 0; - background: #f7f7f0; - border: 1px solid #d7d7d7; - border-collapse: collapse; - border-spacing: 0; - clear: both; - width: 100%; -} -#info th, #info td { font-size: 85%; padding: 2px .5em; vertical-align: top } -#info th { font-weight: bold; text-align: left; white-space: nowrap } -#info td.message { width: 100% } -#info .message ul { padding: 0; margin: 0 2em } -#info .message p { margin: 0; padding: 0 } - -/* Wiki */ -.wikipage { padding-left: 18px; margin: 0; } /* Modified */ -.wikipage h1, .wikipage h2, .wikipage h3 { margin-left: -18px } - -a.missing:link, a.missing:visited, span.missing { color: #998 } -a.missing:link, a.missing:visited { background: #fafaf0 } -a.missing:hover { color: #000 } -a.closed:link, a.closed:visited { text-decoration: line-through } - -dl.wiki dt { font-weight: bold } -dl.compact dt { float: left; padding-right: .5em } -dl.compact dd { margin: 0; padding: 0 } - -div.code, pre.wiki, pre.literal-block { - background: #edf9c0; - border-width: 1px 0 1px 0; - border-style: solid; - border-color: #bce715; - margin: 30px; - padding: 10px; - overflow: auto; -} - -blockquote.citation { - margin: -0.6em 0; - border-style: solid; - border-width: 0 0 0 2px; - padding-left: .5em; - border-color: #b44; -} -.citation blockquote.citation { border-color: #4b4; } -.citation .citation blockquote.citation { border-color: #44b; } -.citation .citation .citation blockquote.citation { border-color: #c55; } - -table.wiki { - border: 2px solid #ccc; - border-collapse: collapse; - border-spacing: 0; -} -table.wiki td { border: 1px solid #ccc; padding: .1em .25em; } - -.wikitoolbar { - border: solid #d7d7d7; - border-width: 1px 1px 1px 0; - height: 18px; - width: 208px; -} -.wikitoolbar :link, .wikitoolbar :visited { - background: transparent url(../edit_toolbar.png) no-repeat; - border: 1px solid #fff; - border-left-color: #d7d7d7; - cursor: default; - display: block; - float: left; - width: 24px; - height: 16px; -} -.wikitoolbar :link:hover, .wikitoolbar :visited:hover { - background-color: transparent; - border: 1px solid #fb2; -} -.wikitoolbar a#em { background-position: 0 0 } -.wikitoolbar a#strong { background-position: 0 -16px } -.wikitoolbar a#heading { background-position: 0 -32px } -.wikitoolbar a#link { background-position: 0 -48px } -.wikitoolbar a#code { background-position: 0 -64px } -.wikitoolbar a#hr { background-position: 0 -80px } -.wikitoolbar a#np { background-position: 0 -96px } -.wikitoolbar a#br { background-position: 0 -112px } - -/* Styles for the form for adding attachments. */ -#attachment .field { margin-top: 1.3em } -#attachment label { padding-left: .2em } -#attachment fieldset { margin-top: 2em } -#attachment fieldset .field { float: left; margin: 0 1em .5em 0 } -#attachment .options { float: left; padding: 0 0 1em 1em } -#attachment br { clear: left } -.attachment #preview { margin-top: 1em } - -/* Styles for the list of attachments. */ -#attachments { border: 1px outset #996; padding: 1em } -#attachments .attachments { margin-left: 2em; padding: 0 } -#attachments dt { display: list-item; list-style: square; } -#attachments dd { font-style: italic; margin-left: 0; padding-left: 0; } - - -/* Styles for tabular listings such as those used for displaying directory - contents and report results. */ -table.listing { - clear: both; - border-bottom: 1px solid #d7d7d7; - border-collapse: collapse; - border-spacing: 0; - margin-top: 1em; - width: 100%; -} -table.listing th { text-align: left; padding: 0 1em .1em 0; font-size: 12px } -table.listing thead { background: #f7f7f0 } -table.listing thead th { - border: 1px solid #d7d7d7; - border-bottom-color: #999; - font-size: 11px; - font-weight: bold; - padding: 2px .5em; - vertical-align: bottom; -} -table.listing thead th :link:hover, table.listing thead th :visited:hover { - background-color: transparent; -} -table.listing thead th a { border: none; padding-right: 12px } -table.listing th.asc a, table.listing th.desc a { font-weight: bold } -table.listing th.asc a, table.listing th.desc a { - background-position: 100% 50%; - background-repeat: no-repeat; -} -table.listing th.asc a { background-image: url(../asc.png) } -table.listing th.desc a { background-image: url(../desc.png) } -table.listing tbody td, table.listing tbody th { - border: 1px dotted #ddd; - padding: .33em .5em; - vertical-align: top; -} -table.listing tbody td a:hover, table.listing tbody th a:hover { - background-color: transparent; -} -table.listing tbody tr { border-top: 1px solid #ddd } -table.listing tbody tr.even { background-color: #fcfcfc } -table.listing tbody tr.odd { background-color: #f7f7f7 } -table.listing tbody tr:hover { background: #eed !important } - -/* Styles for the error page (and rst errors) */ -#content.error .message, div.system-message { - background: #fdc; - border: 2px solid #d00; - color: #500; - padding: .5em; - margin: 1em 0; -} -#content.error pre, div.system-message pre { margin-left: 1em; overflow: auto } -div.system-message p { margin: 0; } -div.system-message p.system-message-title { font-weight: bold; } - -/* Styles for search word highlighting */ -@media screen { - .searchword0 { background: #ff9 } - .searchword1 { background: #cfc } - .searchword2 { background: #cff } - .searchword3 { background: #ccf } - .searchword4 { background: #fcf } -} - -@media print { - #header, #altlinks, #footer, #help { display: none } - .nav, form, .buttons form, form .buttons { display: none } - form.printableform { display: block } -} - - -/* Custom */ -#top_grad { - background-image: url(../top_grad.png); - height: 26px; -} -#tab { - height: 32px; - width: 282px; - color: #ffffff; - text-align: center; - margin: -2px 50px 0 0; - background-image: url(../tab.png); - background-repeat: no-repeat; - float: right; -} - -#tab :link, #tab :visited { - background: transparent; - color: #ffffff; - font-size: 12px; - border: none; - padding: 4px; - -} -#tab :link:hover, #tab :visited:hover { - border-width: 0 0 1px 0; - border-style: solid; - border-color: #a4cd0d; -} - -#banner { - background-image: url(../main_grad.png); - height: 135px; -} - -#header { - margin: 20px 0 0 50px; -} - -#metanav { - margin-right: 61px; -} - -#metanav :link, #metanav :visited { - color: #ffffff; - -} - -#metanav :link:hover, #metanav :visited:hover { - color: #bbbbbb; -} - -#metanav ul li.first { - color: #ccc; -} - -#side_bar { - float: right; -// width: 350px; - background-color: #ffffff; - padding: 0 0 0 15px; -} - -#download_top { - height: 145px; - width: 273px; - background-image: url(../dld_top.png); -} - -#download_bottom { - height: 91px; - width: 273px; - background-image: url(../dld_bottom.png); -} - -#download { -// height: 145px; - width: 243px; - background-image: url(../dld_back.png); - background-repeat: repeat-y; - padding: 0 10px 0 20px; -} - - -#download_old { - height: 284px; - width: 269px; -// float: right; - margin: 0; - padding: 0 0 0 19px; - background-image: url(../download.png); - background-repeat: no-repeat; -} - -#donate { - height: 284px; - width: 269px; -// float: right; - margin: 0; - padding: 0 0 0 19px; -} - -#download :link, #download :visited, #download :link:hover, #download :visited:hover { - background: transparent; - color: #9ac300; - font-size: 12px; - border: none; - -} diff --git a/docs/_themes/twistedtrac/static/css/wiki.css b/docs/_themes/twistedtrac/static/css/wiki.css deleted file mode 100644 index 31eaada3317..00000000000 --- a/docs/_themes/twistedtrac/static/css/wiki.css +++ /dev/null @@ -1,217 +0,0 @@ -/* BEGIN inline of code.css */ -/* -div.code { - background: #f7f7f7; - border: 1px solid #d7d7d7; - margin: 1em 1.75em; - padding: .25em; - overflow: auto -} -*/ -div.code pre { margin: 0; } - -table.code { - border: 1px solid #ddd; - border-spacing: 0; - border-top: 0; - empty-cells: show; - font-size: 12px; - line-height: 130%; - padding: 0; - margin: 0 auto; - table-layout: fixed; - width: 100%; -} -table.code th { - border-right: 1px solid #d7d7d7; - border-bottom: 1px solid #998; - font-size: 11px; -} -table.code th.lineno { width: 4em } -table.code thead th { - background: #eee; - border-top: 1px solid #d7d7d7; - color: #999; - padding: 0 .25em; - text-align: center; - white-space: nowrap; -} -table.code tbody th { - background: #eed; - color: #886; - font-weight: normal; - padding: 0 .5em; - text-align: right; - vertical-align: top; -} -table.code tbody th :link, table.code tbody th :visited { - border: none; - color: #886; - text-decoration: none; -} -table.code tbody th :link:hover, table.code tbody th :visited:hover { - color: #000; -} -table.code tbody td { - background: #fff; - font: normal 11px monospace; - overflow: hidden; - padding: 1px 2px; - vertical-align: top; -} - -.image-file { background: #eee; padding: .3em } -.image-file img { background: url(../imggrid.png) } - -/* Default */ -.code-block span { - font-family: monospace; -} - -/* Comments */ -.code-comment, .css_comment, .c_comment, .c_commentdoc, .c_commentline, -.c_commentlinedoc, .h_comment,.pl_commentline, .p_commentblock, -.p_commentline, .hphp_comment, .hphp_commentblock, .hphp_commentline, -.yaml_comment { - color: #998; - font-style: italic; -} - -/* Language keyword */ -.code-keyword, .pl_word { color: #789; font-weight: bold } - -/* Type */ -.code-type, .c_word, .c_word2, .p_classname, .hphp_classname{ - color: #468; - font-weight: bold; -} - -/* Function */ -.code-func, .p_defname { - color: #900; - font-weight: bold; - border-bottom: none; -} - -/* Pre-processor */ -.code-prep, .c_preprocessor, .pl_preprocessor, .yaml_identifier { - color: #999; - font-weight: bold; -} - -/* Language construct */ -.code-lang, .p_word { color: #000; font-weight: bold } - -/* String */ -.code-string, .c_string, .c_stringeol, .css_doublestring, .css_singlestring, -.h_singlestring, .h_doublestring, .pl_string, .pl_string_q, .pl_string_qq, -.pl_string_qr, .pl_string_qw, .pl_string_qx, .pl_backticks, .pl_character, -.p_string, .p_stringeol, .hphp_string, .hphp_stringeol, .hphp_triple, -.hphp_tripledouble, .p_character, .p_triple, .p_tripledouble { - color: #b84; - font-weight: normal; -} - -/* Variable name */ -.code-var { color: #f9f } - -/* SilverCity-specific styles */ -.css_id, .css_class, .css_pseudoclass, .css_tag { color: #900000 } -.css_directive { color: #009000; font-weight: bold } -.css_important { color: blue } -.css_operator { color: #000090; font-weight: bold } -.css_tag { font-weight: bold } -.css_unknown_identifier, .css_unknown_pseudoclass { color: red } -.css_value { color: navy } -.c_commentdockeyword { color: navy; font-weight: bold } -.c_commentdockeyworderror { color: red; font-weight: bold } -.c_character, .c_regex, .c_uuid, .c_verbatim { color: olive } -.c_number { color: #099 } -.h_asp { color: #ff0 } -.h_aspat { color: #ffdf00 } -.h_attribute { color: teal } -.h_attributeunknown { color: red } -.h_cdata { color: #373 } -.h_entity { color: purple } -.h_number { color: #099 } -.h_other { color: purple } -.h_script, .h_tag, .h_tagend { color: navy } -.h_tagunknown { color: red } -.h_xmlend, .h_xmlstart { color: blue } -.pl_datasection { color: olive } -.pl_error { color: red; font-weight: bold } -.pl_hash { color: #000 } -.pl_here_delim, .pl_here_q, .pl_here_qq, .pl_here_qx, .pl_longquote { color: olive } -.pl_number { color: #099 } -.pl_pod { font-style: italic } -.pl_regex, .pl_regsubst { color: olive } -.p_number { color: #099 } -.hphp_character { color: olive } -.hphp_defname { color: #099; font-weight: bold } -.hphp_number { color: #099 } -.hphp_word { color: navy; font-weight: bold } -.yaml_document { color: gray; font-style: italic } -.yaml_keyword { color: #808 } -.yaml_number { color: #800 } -.yaml_reference { color: #088 } -.v_comment { color: gray; font-style: italic } -.v_commentline, .v_commentlinebang { color: red; font-style: italic } -.v_number, .v_preprocessor { color: #099 } -.v_string, .v_stringeol { color: olive } -.v_user{ color: blue; font-weight: bold } -.v_word, .v_word3 { color: navy; font-weight: bold } -.v_word2 { color: green; font-weight: bold } -/* END OF code.css */ -/* @import url(code.css); */ - -/* Styles for the page editing form */ -#edit #rows { float: right; font-size: 80% } -#edit #rows select { font-size: 90% } -#edit #text { clear: both; width: 100% } -#edit .wikitoolbar { float: left; } -#changeinfo { padding: .5em } -#changeinfo .field { float: left; margin: 0 1em .5em 0 } -#changeinfo br { clear: left } -#changeinfo .options { padding: 0 0 1em 1em } -#changeinfo .options, #changeinfo .buttons { clear: left } -#delete { margin-left: 6em } -#preview { - background: #f4f4f4 url(../draft.png); - margin: 1em 0 2em; - overflow: auto; -} - -/* Diff view */ -#overview .multi { color: #999 } -#overview .ipnr { color: #999; font-size: 80% } -#overview .comment { padding: 1em 0 0 } - -/* Styles for the page history table - (extends the styles for "table.listing") */ -#wikihist td { padding: 0 .5em } -#wikihist td.date, #wikihist td.diff, #wikihist td.version, -#wikihist td.author { - white-space: nowrap; -} -#wikihist td.version { text-align: center } -#wikihist td.comment { width: 100% } - -@media print { - th.diff, td.diff { display: none } -} - -/* Styles for the TracGuideToc wikimacro */ -.wiki-toc { - padding: .5em 1em; - margin: 0 0 2em 1em; - float: right; - border: 1px solid #bce715; - background: #edf9c0; - font-size: 85%; - position: relative; -} -.wiki-toc h4 { font-size: 12px; margin: 0; color: #444444; } -.wiki-toc ul, .wiki-toc ol { list-style: none; padding: 0; margin: 0 } -.wiki-toc ul ul, .wiki-toc ol ol { padding-left: 1.2em } -.wiki-toc li { margin: 0; padding: 0 } -.wiki-toc .active { background: #ddf482; position: relative; padding: 2px 0 2px 5px; border-left: 2px solid #bce715; } diff --git a/docs/_themes/twistedtrac/static/ctxt_grad.png b/docs/_themes/twistedtrac/static/ctxt_grad.png deleted file mode 100644 index 606c94d6ec3..00000000000 Binary files a/docs/_themes/twistedtrac/static/ctxt_grad.png and /dev/null differ diff --git a/docs/_themes/twistedtrac/static/extlink.gif b/docs/_themes/twistedtrac/static/extlink.gif deleted file mode 100644 index d47e14ca58d..00000000000 Binary files a/docs/_themes/twistedtrac/static/extlink.gif and /dev/null differ diff --git a/docs/_themes/twistedtrac/static/footer_grad.png b/docs/_themes/twistedtrac/static/footer_grad.png deleted file mode 100644 index 1092409c655..00000000000 Binary files a/docs/_themes/twistedtrac/static/footer_grad.png and /dev/null differ diff --git a/docs/_themes/twistedtrac/static/main_grad.png b/docs/_themes/twistedtrac/static/main_grad.png deleted file mode 100644 index 889d05ceb43..00000000000 Binary files a/docs/_themes/twistedtrac/static/main_grad.png and /dev/null differ diff --git a/docs/_themes/twistedtrac/static/menu_grad.png b/docs/_themes/twistedtrac/static/menu_grad.png deleted file mode 100644 index 608b6eeab0b..00000000000 Binary files a/docs/_themes/twistedtrac/static/menu_grad.png and /dev/null differ diff --git a/docs/_themes/twistedtrac/static/tab.png b/docs/_themes/twistedtrac/static/tab.png deleted file mode 100644 index 4c3099c3690..00000000000 Binary files a/docs/_themes/twistedtrac/static/tab.png and /dev/null differ diff --git a/docs/_themes/twistedtrac/static/top_grad.png b/docs/_themes/twistedtrac/static/top_grad.png deleted file mode 100644 index cda17dfee52..00000000000 Binary files a/docs/_themes/twistedtrac/static/top_grad.png and /dev/null differ diff --git a/docs/_themes/twistedtrac/static/trac_banner.png b/docs/_themes/twistedtrac/static/trac_banner.png deleted file mode 100644 index b1d9e317bbc..00000000000 Binary files a/docs/_themes/twistedtrac/static/trac_banner.png and /dev/null differ diff --git a/docs/_themes/twistedtrac/static/twisted-icon.ico b/docs/_themes/twistedtrac/static/twisted-icon.ico deleted file mode 100644 index 341658c2801..00000000000 Binary files a/docs/_themes/twistedtrac/static/twisted-icon.ico and /dev/null differ diff --git a/docs/_themes/twistedtrac/static/twistedtrac.css b/docs/_themes/twistedtrac/static/twistedtrac.css deleted file mode 100644 index 0e85d077303..00000000000 --- a/docs/_themes/twistedtrac/static/twistedtrac.css +++ /dev/null @@ -1,457 +0,0 @@ -/** - * Sphinx stylesheet -- twistedtrac theme - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * (inherits from basic theme) - * - */ - -@import url("css/trac.css"); - -/* -- overrides to trac.css ------------------------------------------------- */ -#mainnav li { color: #FFFFFF; padding: 0; } -#mainnav { padding-right: 0px; } - -/* -- main layout ----------------------------------------------------------- */ - -div.clearer { - clear: both; -} - -/* -- relbar ---------------------------------------------------------------- */ - -div.related { - width: 100%; - font-size: 90%; -} - -div.related h3 { - display: none; -} - -div.related ul { - margin: 0; - padding: 0 0 0 10px; - list-style: none; -} - -div.related li { - display: inline; -} - -div.related li.right { - float: right; - margin-right: 5px; -} - -/* -- sidebar --------------------------------------------------------------- */ - -div.sphinxsidebarwrapper { - padding: 10px 5px 0 10px; -} - -div.sphinxsidebar { - float: right; - width: 230px; - margin-left: -230px%; - font-size: 90%; - padding-right: 40px; /* use padding here? or corresponding margin? */ -} - -div.sphinxsidebar ul { - list-style: none; - padding-left: 10px; -} - -div.sphinxsidebar ul ul, -div.sphinxsidebar ul.want-points { - margin-left: 20px; - list-style: square; -} - -div.sphinxsidebar ul ul { - margin-top: 0; - margin-bottom: 0; -} - -div.sphinxsidebar form { - margin-top: 10px; -} - -div.sphinxsidebar input { - border: 1px solid #98dbcc; - font-family: sans-serif; - font-size: 1em; -} - -img { - border: 0; -} - -/* -- search page ----------------------------------------------------------- */ - -ul.search { - margin: 10px 0 0 20px; - padding: 0; -} - -ul.search li { - padding: 5px 0 5px 20px; - background-image: url(file.png); - background-repeat: no-repeat; - background-position: 0 7px; -} - -ul.search li a { - font-weight: bold; -} - -ul.search li div.context { - color: #888; - margin: 2px 0 0 30px; - text-align: left; -} - -ul.keywordmatches li.goodmatch a { - font-weight: bold; -} - -/* -- index page ------------------------------------------------------------ */ - -table.contentstable { - width: 90%; -} - -table.contentstable p.biglink { - line-height: 150%; -} - -a.biglink { - font-size: 1.3em; -} - -span.linkdescr { - font-style: italic; - padding-top: 5px; - font-size: 90%; -} - -/* -- general index --------------------------------------------------------- */ - -table.indextable td { - text-align: left; - vertical-align: top; -} - -table.indextable dl, table.indextable dd { - margin-top: 0; - margin-bottom: 0; -} - -table.indextable tr.pcap { - height: 10px; -} - -table.indextable tr.cap { - margin-top: 10px; - background-color: #f2f2f2; -} - -img.toggler { - margin-right: 3px; - margin-top: 3px; - cursor: pointer; -} - -/* -- general body styles --------------------------------------------------- */ - -a.headerlink { - visibility: hidden; -} - -h1:hover > a.headerlink, -h2:hover > a.headerlink, -h3:hover > a.headerlink, -h4:hover > a.headerlink, -h5:hover > a.headerlink, -h6:hover > a.headerlink, -dt:hover > a.headerlink { - visibility: visible; -} - -div.body p.caption { - text-align: inherit; -} - -div.body td { - text-align: left; -} - -.field-list ul { - padding-left: 1em; -} - -.first { - margin-top: 0 !important; -} - -p.rubric { - margin-top: 30px; - font-weight: bold; -} - -/* -- sidebars -------------------------------------------------------------- */ - -div.sidebar { - margin: 0 0 0.5em 1em; - border: 1px solid #ddb; - padding: 7px 7px 0 7px; - background-color: #ffe; - width: 40%; - float: right; -} - -p.sidebar-title { - font-weight: bold; -} - -/* -- topics ---------------------------------------------------------------- */ - -div.topic { - border: 1px solid #ccc; - padding: 7px 7px 0 7px; - margin: 10px 0 10px 0; -} - -p.topic-title { - font-size: 1.1em; - font-weight: bold; - margin-top: 10px; -} - -/* -- admonitions ----------------------------------------------------------- */ - -div.admonition { - margin-top: 10px; - margin-bottom: 10px; - padding: 7px; - background-color: #FFFFCC; -} - -div.admonition.warning { - background-color: #FFCCCC; -} - -div.admonition dt { - font-weight: bold; -} - -div.admonition dl { - margin-bottom: 0; -} - -p.admonition-title { - margin: 0px 10px 5px 0px; - font-weight: bold; -} - -div.body p.centered { - text-align: center; - margin-top: 25px; -} - -/* -- tables ---------------------------------------------------------------- */ - -table.docutils { - border: 0; - border-collapse: collapse; -} - -table.docutils td, table.docutils th { - padding: 1px 8px 1px 0; - border-top: 0; - border-left: 0; - border-right: 0; - border-bottom: 1px solid #aaa; -} - -table.field-list td, table.field-list th { - border: 0 !important; -} - -table.footnote td, table.footnote th { - border: 0 !important; -} - -th { - text-align: left; - padding-right: 5px; -} - -/* -- other body styles ----------------------------------------------------- */ - -dl { - margin-bottom: 15px; -} - -dd p { - margin-top: 0px; -} - -dd ul, dd table { - margin-bottom: 10px; -} - -dd { - margin-top: 3px; - margin-bottom: 10px; - margin-left: 30px; -} - -dt:target, .highlight { - /* background-color: #fbe54e; */ - background-color: #eeffcc; -} - -dl.glossary dt { - font-weight: bold; - font-size: 1.1em; -} - -.field-list ul { - margin: 0; - padding-left: 1em; -} - -.field-list p { - margin: 0; -} - -.refcount { - color: #060; -} - -.optional { - font-size: 1.3em; -} - -.versionmodified { - font-style: italic; -} - -.system-message { - background-color: #fda; - padding: 5px; - border: 3px solid red; -} - -.footnote:target { - background-color: #ffa -} - -.line-block { - display: block; - margin-top: 1em; - margin-bottom: 1em; -} - -.line-block .line-block { - margin-top: 0; - margin-bottom: 0; - margin-left: 1.5em; -} - -/* -- code displays --------------------------------------------------------- */ - -pre { - overflow: auto; - - /* optional? */ - padding: 10px; -} - -td.linenos pre { - padding: 5px 0px; - border: 0; - background-color: transparent; - color: #aaa; -} - -table.highlighttable { - margin-left: 0.5em; -} - -table.highlighttable td { - padding: 0 0.5em 0 0.5em; -} - -tt.descname { - background-color: transparent; - font-weight: bold; - font-size: 1.2em; -} - -tt.descclassname { - background-color: transparent; -} - -tt.xref, a tt { - background-color: transparent; - font-weight: bold; -} - -h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { - background-color: transparent; -} - -/* -- math display ---------------------------------------------------------- */ - -img.math { - vertical-align: middle; -} - -div.body div.math p { - text-align: center; -} - -span.eqno { - float: right; -} - -/* -- printout stylesheet --------------------------------------------------- */ - -/* ----- -@media print { - div.document, - div.documentwrapper, - div.bodywrapper { - margin: 0 !important; - width: 100%; - } - - div.sphinxsidebar, - div.related, - div.footer, - #top-link { - display: none; - } -} - ------ */ - -div.documentwrapper { - float: left; - /* padding: 0 30px; */ /* use padding here? or margin in bodywrapper? */ - /* width: 70%; */ - margin-right: -300px; - width: 100%; -} - -div.bodywrapper { - margin-right: 300px; - padding-left: 40px; -} - -a.api { - font-family: monospace; -} diff --git a/docs/_themes/twistedtrac/theme.conf b/docs/_themes/twistedtrac/theme.conf deleted file mode 100644 index 73821c39a51..00000000000 --- a/docs/_themes/twistedtrac/theme.conf +++ /dev/null @@ -1,5 +0,0 @@ -[theme] -inherit = basic -stylesheet = twistedtrac.css -pygments_style = sphinx - diff --git a/docs/conf.py b/docs/conf.py index 5cfd895499f..8e7853e7936 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,6 +18,8 @@ from datetime import date from pprint import pprint +import sphinx_rtd_theme + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -45,8 +47,6 @@ except ImportError: pass -extensions.append("traclinks") - from twisted import version as twisted_version_object # Add any paths that contain templates here, relative to this directory. @@ -96,18 +96,9 @@ # -- Options for HTML output ---------------------------------------------- -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. - -# See Read The Docs environment variables -# https://docs.readthedocs.io/en/stable/builds.html#build-environment -on_rtd = os.environ.get("READTHEDOCS", None) == "True" - -if not on_rtd: - html_theme = "twistedtrac" - -# Add any paths that contain custom themes here, relative to this directory. -html_theme_path = ["_themes"] +# Only the RTD theme is used. Both for local development and for the public site. +html_theme = "sphinx_rtd_theme" +html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, @@ -194,18 +185,6 @@ pprint(dict(os.environ)) print("======") -# Base url for API docs -api_base_url = f"/documents/{release}/api/" -if on_rtd: - # For a PR the link is like: - # https://twisted--1422.org.readthedocs.build/en/1422/ - # For a release: - # https://docs.twistedmatrix.com/en/twisted-20.3.0/ - # https://docs.twistedmatrix.com/en/latest/ - api_base_url = "/{}/{}/api/".format( - os.environ["READTHEDOCS_LANGUAGE"], - os.environ["READTHEDOCS_VERSION"], - ) # Try to find URL fragment for the GitHub source page based on current # branch or tag. @@ -236,8 +215,6 @@ pydoctor_url_path = "/en/{rtd_version}/api/" -traclinks_base_url = "https://twistedmatrix.com/trac" - # A dict mapping unique IDs (which can be used to disambiguate references) to a # tuple of (, ). # The inventory file may be None to use the default location at the given URI. diff --git a/setup.cfg b/setup.cfg index 3b0419da96c..b15704a7d51 100644 --- a/setup.cfg +++ b/setup.cfg @@ -58,9 +58,9 @@ test = dev_release = towncrier ~= 22.8 pydoctor ~= 22.7.0 - sphinx-rtd-theme ~= 0.5 + sphinx_rtd_theme ~= 1.0 readthedocs-sphinx-ext ~= 2.1 - sphinx >= 4.1.2, <6 + sphinx >= 5.0, <6 ; All the extra tools used to help with the development process. dev = diff --git a/src/twisted/newsfragments/11573.misc b/src/twisted/newsfragments/11573.misc new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/twisted/python/_release.py b/src/twisted/python/_release.py index b405f731935..3236ea5a9b3 100644 --- a/src/twisted/python/_release.py +++ b/src/twisted/python/_release.py @@ -20,22 +20,9 @@ from zope.interface import Interface, implementer from twisted.python.compat import execfile -from twisted.python.filepath import FilePath # Types of newsfragments. NEWSFRAGMENT_TYPES = ["doc", "bugfix", "misc", "feature", "removal"] -intersphinxURLs = [ - "https://docs.python.org/3/objects.inv", - "https://cryptography.io/en/latest/objects.inv", - "https://pyopenssl.readthedocs.io/en/stable/objects.inv", - "https://hyperlink.readthedocs.io/en/stable/objects.inv", - "https://twisted.org/constantly/docs/objects.inv", - "https://twisted.org/incremental/docs/objects.inv", - "https://python-hyper.org/projects/hyper-h2/en/stable/objects.inv", - "https://priority.readthedocs.io/en/stable/objects.inv", - "https://zopeinterface.readthedocs.io/en/latest/objects.inv", - "https://automat.readthedocs.io/en/latest/objects.inv", -] def runCommand(args, **kwargs): @@ -263,88 +250,6 @@ class NoDocumentsFound(Exception): """ -class SphinxBuilder: - """ - Generate HTML documentation using Sphinx. - - Generates and runs a shell command that looks something like:: - - sphinx-build -b html -d [BUILDDIR]/doctrees - [DOCDIR]/source - [BUILDDIR]/html - - where DOCDIR is a directory containing another directory called "source" - which contains the Sphinx source files, and BUILDDIR is the directory in - which the Sphinx output will be created. - """ - - def main(self, args): - """ - Build the main documentation. - - @type args: list of str - @param args: The command line arguments to process. This must contain - one string argument: the path to the root of a Twisted checkout. - Additional arguments will be ignored for compatibility with legacy - build infrastructure. - """ - output = self.build(FilePath(args[0]).child("docs")) - if output: - sys.stdout.write(f"Unclean build:\n{output}\n") - raise sys.exit(1) - - def build(self, docDir, buildDir=None, version=""): - """ - Build the documentation in C{docDir} with Sphinx. - - @param docDir: The directory of the documentation. This is a directory - which contains another directory called "source" which contains the - Sphinx "conf.py" file and sphinx source documents. - @type docDir: L{twisted.python.filepath.FilePath} - - @param buildDir: The directory to build the documentation in. By - default this will be a child directory of {docDir} named "build". - @type buildDir: L{twisted.python.filepath.FilePath} - - @param version: The version of Twisted to set in the docs. - @type version: C{str} - - @return: the output produced by running the command - @rtype: L{str} - """ - if buildDir is None: - buildDir = docDir.parent().child("doc") - - doctreeDir = buildDir.child("doctrees") - - output = runCommand( - [ - "sphinx-build", - "-q", - "-b", - "html", - "-d", - doctreeDir.path, - docDir.path, - buildDir.path, - ] - ).decode("utf-8") - - # Delete the doctrees, as we don't want them after the docs are built - doctreeDir.remove() - - for path in docDir.walk(): - if path.basename() == "man": - segments = path.segmentsFrom(docDir) - dest = buildDir - while segments: - dest = dest.child(segments.pop(0)) - if not dest.parent().isdir(): - dest.parent().makedirs() - path.copyTo(dest) - return output - - def filePathDelta(origin, destination): """ Return a list of strings that represent C{destination} as a path relative diff --git a/src/twisted/python/test/test_release.py b/src/twisted/python/test/test_release.py index d55a40e6dc9..5283f1b03ea 100644 --- a/src/twisted/python/test/test_release.py +++ b/src/twisted/python/test/test_release.py @@ -13,10 +13,6 @@ import shutil import sys import tempfile -import textwrap -from io import StringIO -from subprocess import CalledProcessError -from unittest import skipIf from incremental import Version @@ -27,7 +23,6 @@ IVCSCommand, NotWorkingDirectory, Project, - SphinxBuilder, filePathDelta, findTwistedProjects, getRepositoryCommand, @@ -35,7 +30,6 @@ runCommand, ) from twisted.python.filepath import FilePath -from twisted.python.procutils import which from twisted.trial.unittest import TestCase if sys.platform != "win32": @@ -355,160 +349,6 @@ def test_filePathDeltaSimilarEndElements(self): ) -@skipIf(not which("sphinx-build"), "Sphinx not available.") -class SphinxBuilderTests(TestCase): - """ - Tests for L{SphinxBuilder}. - - @note: This test case depends on twisted.web, which violates the standard - Twisted practice of not having anything in twisted.python depend on - other Twisted packages and opens up the possibility of creating - circular dependencies. Do not use this as an example of how to - structure your dependencies. - - @ivar builder: A plain L{SphinxBuilder}. - - @ivar sphinxDir: A L{FilePath} representing a directory to be used for - containing a Sphinx project. - - @ivar sourceDir: A L{FilePath} representing a directory to be used for - containing the source files for a Sphinx project. - """ - - confContent = """\ - source_suffix = '.rst' - master_doc = 'index' - """ - confContent = textwrap.dedent(confContent) - - indexContent = """\ - ============== - This is a Test - ============== - - This is only a test - ------------------- - - In case you hadn't figured it out yet, this is a test. - """ - indexContent = textwrap.dedent(indexContent) - - def setUp(self): - """ - Set up a few instance variables that will be useful. - """ - self.builder = SphinxBuilder() - - # set up a place for a fake sphinx project - self.twistedRootDir = FilePath(self.mktemp()) - self.sphinxDir = self.twistedRootDir.child("docs") - self.sphinxDir.makedirs() - self.sourceDir = self.sphinxDir - - def createFakeSphinxProject(self): - """ - Create a fake Sphinx project for test purposes. - - Creates a fake Sphinx project with the absolute minimum of source - files. This includes a single source file ('index.rst') and the - smallest 'conf.py' file possible in order to find that source file. - """ - self.sourceDir.child("conf.py").setContent(self.confContent.encode()) - self.sourceDir.child("index.rst").setContent(self.indexContent.encode()) - - def verifyFileExists(self, fileDir, fileName): - """ - Helper which verifies that C{fileName} exists in C{fileDir} and it has - some content. - - @param fileDir: A path to a directory. - @type fileDir: L{FilePath} - - @param fileName: The last path segment of a file which may exist within - C{fileDir}. - @type fileName: L{str} - - @raise FailTest: If C{fileDir.child(fileName)}: - - 1. Does not exist. - - 2. Is empty. - - 3. In the case where it's a path to a C{.html} file, the - content looks like an HTML file. - - @return: L{None} - """ - # check that file exists - fpath = fileDir.child(fileName) - self.assertTrue(fpath.exists()) - - # check that the output files have some content - fcontents = fpath.getContent() - self.assertTrue(len(fcontents) > 0) - - # check that the html files are at least html-ish - # this is not a terribly rigorous check - if fpath.path.endswith(".html"): - self.assertIn(b"