Show
Ignore:
Timestamp:
02/04/2008 05:52:40 PM (11 months ago)
Author:
dave
Message:

modify docutils beps.py to use pep_base_url.

I tried using bep_base_url to disambiguate the base URL for beps and peps, but this required reaching
into the source code for restructured text (which has some hard-coded notion of PEPs). I decided
not to touch that code just now.

regenerate updated html files.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dotorg/trunk_fixed/html/beps/bep_0002.html

    r10505 r10535  
     1<?xml version="1.0" encoding="utf-8" ?> 
     2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
     4<head> 
     5<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
     6<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" /> 
     7<title></title> 
     8<link rel="stylesheet" href="../css/bep.css" type="text/css" /> 
     9</head> 
     10<body> 
     11<div class="document"> 
     12 
     13<div id="upper" class="clear"> 
     14<div id="wrap"> 
     15<div id="header"> 
     16<h1><a href="../index.html">BitTorrent<span>.org</span></a></h1> 
     17</div> 
     18<div id="nav"> 
     19<ul> 
     20<li><a href="../index.html">Home</a></li> 
     21<li><a href="../introduction.html">For Users</a></li> 
     22<li><span>For Developers</span></li> 
     23<!-- <li><a href="./blog">Blog</a></li> --> 
     24<li><a href="../donate.html">Donate!</a></li> 
     25</ul> 
     26</div> <!-- nav --> 
     27<!-- ### Begin Content ### --> 
     28<div id="second"> 
     29 
     30 
     31 
     32<table class="rfc2822 docutils field-list" frame="void" rules="none"> 
     33<col class="field-name" /> 
     34<col class="field-body" /> 
     35<tbody valign="top"> 
     36<tr class="field"><th class="field-name">BEP:</th><td class="field-body">2</td> 
     37</tr> 
     38<tr class="field"><th class="field-name">Title:</th><td class="field-body">Sample reStructured Text BEP Template</td> 
     39</tr> 
     40<tr class="field"><th class="field-name">Version:</th><td class="field-body">$Revision$</td> 
     41</tr> 
     42<tr class="field"><th class="field-name">Last-Modified:</th><td class="field-body"><a class="reference external" href="https://svn.bittorrent.com/trac.cgi/browser/dotorg/trunk/html/beps/bep_0002.rst">$Date$</a></td> 
     43</tr> 
     44<tr class="field"><th class="field-name">Author:</th><td class="field-body">David Harrison &lt;dave&#32;&#97;t&#32;bittorrent.com&gt;</td> 
     45</tr> 
     46<tr class="field"><th class="field-name">Status:</th><td class="field-body">Active</td> 
     47</tr> 
     48<tr class="field"><th class="field-name">Type:</th><td class="field-body">Process</td> 
     49</tr> 
     50<tr class="field"><th class="field-name">Content-Type:</th><td class="field-body"><a class="reference external" href="http://www.bittorrent.org/beps/bep-0012">text/x-rst</a></td> 
     51</tr> 
     52<tr class="field"><th class="field-name">Created:</th><td class="field-body">02-Feb-2008</td> 
     53</tr> 
     54<tr class="field"><th class="field-name">Post-History:</th><td class="field-body"></td> 
     55</tr> 
     56</tbody> 
     57</table> 
     58<hr /> 
     59<div class="contents topic" id="contents"> 
     60<p class="topic-title first">Contents</p> 
     61<ul class="simple"> 
     62<li><a class="reference internal" href="#abstract" id="id22">Abstract</a></li> 
     63<li><a class="reference internal" href="#rationale" id="id23">Rationale</a></li> 
     64<li><a class="reference internal" href="#how-to-use-this-template" id="id24">How to Use This Template</a></li> 
     65<li><a class="reference internal" href="#restructuredtext-bep-formatting-requirements" id="id25">ReStructuredText BEP Formatting Requirements</a><ul> 
     66<li><a class="reference internal" href="#general" id="id26">General</a></li> 
     67<li><a class="reference internal" href="#section-headings" id="id27">Section Headings</a></li> 
     68<li><a class="reference internal" href="#paragraphs" id="id28">Paragraphs</a></li> 
     69<li><a class="reference internal" href="#inline-markup" id="id29">Inline Markup</a></li> 
     70<li><a class="reference internal" href="#block-quotes" id="id30">Block Quotes</a></li> 
     71<li><a class="reference internal" href="#literal-blocks" id="id31">Literal Blocks</a></li> 
     72<li><a class="reference internal" href="#lists" id="id32">Lists</a></li> 
     73<li><a class="reference internal" href="#tables" id="id33">Tables</a></li> 
     74<li><a class="reference internal" href="#hyperlinks" id="id34">Hyperlinks</a></li> 
     75<li><a class="reference internal" href="#footnotes" id="id35">Footnotes</a></li> 
     76<li><a class="reference internal" href="#images" id="id36">Images</a></li> 
     77<li><a class="reference internal" href="#comments" id="id37">Comments</a></li> 
     78<li><a class="reference internal" href="#escaping-mechanism" id="id38">Escaping Mechanism</a></li> 
     79</ul> 
     80</li> 
     81<li><a class="reference internal" href="#habits-to-avoid" id="id39">Habits to Avoid</a></li> 
     82<li><a class="reference internal" href="#resources" id="id40">Resources</a></li> 
     83<li><a class="reference internal" href="#acknowledgements" id="id41">Acknowledgements</a></li> 
     84<li><a class="reference internal" href="#references" id="id42">References</a></li> 
     85<li><a class="reference internal" href="#copyright" id="id43">Copyright</a></li> 
     86</ul> 
     87</div> 
     88<div class="section" id="abstract"> 
     89<h1>Abstract</h1> 
     90<p>This BEP provides a boilerplate or sample template for creating your 
     91own reStructuredText BEPs.  In conjunction with the content guidelines 
     92in BEP 1 <a class="footnote-reference" href="#bep-1" id="id1">[1]</a>, this should make it easy for you to conform your own 
     93BEPs to the format outlined below.</p> 
     94<p>Note: if you are reading this BEP via the web, you should first grab 
     95the text (reStructuredText) source of this BEP in order to complete 
     96the steps below.  <strong>DO NOT USE THE HTML FILE AS YOUR TEMPLATE!</strong></p> 
     97<p>To get the source this (or any) BEP, look at the top of the HTML page 
     98and click on the date &amp; time on the &quot;Last-Modified&quot; line.  It is a 
     99link to the source text in the BitTorrent.org subversion repository.</p> 
     100</div> 
     101<div class="section" id="rationale"> 
     102<h1>Rationale</h1> 
     103<p>BEP submissions come in a wide variety of forms, not all adhering 
     104to the format guidelines set forth below.  Use this template, in 
     105conjunction with the format guidelines below, to ensure that your 
     106BEP submission won't get automatically rejected because of form.</p> 
     107<p>ReStructuredText is offered as an alternative to plaintext BEPs, to 
     108allow BEP authors more functionality and expressivity, while 
     109maintaining easy readability in the source text.  The processed HTML 
     110form makes the functionality accessible to readers: live hyperlinks, 
     111styled text, tables, images, and automatic tables of contents, among 
     112other advantages.</p> 
     113</div> 
     114<div class="section" id="how-to-use-this-template"> 
     115<h1>How to Use This Template</h1> 
     116<p>To use this template you must first decide whether your BEP is going 
     117to be an Informational or Standards Track BEP.  Most BEPs are 
     118Standards Track because they propose a new feature for the BitTorrent 
     119system including the BitTorrent suite of protocols.  When in doubt, 
     120read BEP 1 for details or contact the BEP editors 
     121&lt;<a class="reference external" href="mailto:editor&#37;&#52;&#48;bittorrent&#46;org">editor<span>&#64;</span>bittorrent<span>&#46;</span>org</a>&gt;.</p> 
     122<p>Once you've decided which type of BEP yours is going to be, follow the 
     123directions below.</p> 
     124<ul> 
     125<li><p class="first">Make a copy of this file (<tt class="docutils literal"><span class="pre">.rst</span></tt> file, <strong>not</strong> HTML!)  and perform 
     126the following edits.</p> 
     127</li> 
     128<li><p class="first">Replace the &quot;BEP: 2&quot; header with &quot;BEP: XXX&quot; since you don't yet have 
     129a BEP number assignment.</p> 
     130</li> 
     131<li><p class="first">Change the Title header to the title of your BEP.</p> 
     132</li> 
     133<li><p class="first">Leave the Version and Last-Modified headers alone; we'll take care 
     134of those when we check your BEP into BitTorrent's Subversion repository. 
     135These headers consist of keywords (&quot;Revision&quot; and &quot;Date&quot; enclosed in 
     136&quot;$&quot;-signs) which are automatically expanded by the repository. 
     137Please do not edit the expanded date or revision text.</p> 
     138</li> 
     139<li><p class="first">Change the Author header to include your name, and optionally your 
     140email address.  Be sure to follow the format carefully: your name 
     141must appear first, and it must not be contained in parentheses. 
     142Your email address may appear second (or it can be omitted) and if 
     143it appears, it must appear in angle brackets.  It is okay to 
     144obfuscate your email address.</p> 
     145</li> 
     146<li><p class="first">If there is a mailing list for discussion of your new feature, add a 
     147Discussions-To header right after the Author header.  You should not 
     148add a Discussions-To header if the mailing list to be used is 
     149<a class="reference external" href="mailto:bittorrent-list&#37;&#52;&#48;bittorrent&#46;org">bittorrent-list<span>&#64;</span>bittorrent<span>&#46;</span>org</a>, or if discussions should be sent to 
     150you directly.  Most Informational BEPs don't have a Discussions-To 
     151header.</p> 
     152</li> 
     153<li><p class="first">Change the Status header to &quot;Draft&quot;.</p> 
     154</li> 
     155<li><p class="first">For Standards Track BEPs, change the Type header to &quot;Standards 
     156Track&quot;.</p> 
     157</li> 
     158<li><p class="first">For Informational BEPs, change the Type header to &quot;Informational&quot;.</p> 
     159</li> 
     160<li><p class="first">For Standards Track BEPs, if your feature depends on the acceptance 
     161of some other currently in-development BEP, add a Requires header 
     162right after the Type header.  The value should be the BEP number of 
     163the BEP yours depends on.  Don't add this header if your dependent 
     164feature is described in a Final BEP.</p> 
     165</li> 
     166<li><p class="first">Change the Created header to today's date.  Be sure to follow the 
     167format carefully: it must be in <tt class="docutils literal"><span class="pre">dd-mmm-yyyy</span></tt> format, where the 
     168<tt class="docutils literal"><span class="pre">mmm</span></tt> is the 3 English letter month abbreviation, i.e. one of Jan, 
     169Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec.</p> 
     170</li> 
     171<li><p class="first">Leave Post-History alone for now; you'll add dates to this header 
     172each time you post your BEP to <a class="reference external" href="mailto:bittorrent-list&#37;&#52;&#48;bittorrent&#46;org">bittorrent-list<span>&#64;</span>bittorrent<span>&#46;</span>org</a>.  If 
     173you posted your BEP to the lists on August 14, 2001 and September 3, 
     1742001, the Post-History header would look like:</p> 
     175<pre class="literal-block"> 
     176Post-History: 14-Aug-2001, 03-Sept-2001 
     177</pre> 
     178<p>You must manually add new dates and check them in.  If you don't 
     179have check-in privileges, send your changes to the BEP editors.</p> 
     180</li> 
     181<li><p class="first">Add a Replaces header if your BEP obsoletes an earlier BEP.  The 
     182value of this header is the number of the BEP that your new BEP is 
     183replacing.  Only add this header if the older BEP is in &quot;final&quot; 
     184form, i.e. is either Accepted, Final, or Rejected.  You aren't 
     185replacing an older open BEP if you're submitting a competing idea.</p> 
     186</li> 
     187<li><p class="first">Now write your Abstract, Rationale, and other content for your BEP, 
     188replacing all this gobbledygook with your own text. Be sure to 
     189adhere to the format guidelines below, specifically on the 
     190prohibition of tab characters and the indentation requirements.</p> 
     191</li> 
     192<li><p class="first">Update your References and Copyright section.  Usually you'll place 
     193your BEP into the public domain, in which case just leave the 
     194Copyright section alone.  Alternatively, you can use the <a class="reference external" href="http://www.opencontent.org/openpub/">Open 
     195Publication License</a> <a class="footnote-reference" href="#id14" id="id15">[6]</a>, but public domain is still strongly 
     196preferred.</p> 
     197</li> 
     198<li><p class="first">Leave the Emacs stanza at the end of this file alone, including the 
     199formfeed character (&quot;^L&quot;, or <tt class="docutils literal"><span class="pre">\f</span></tt>).</p> 
     200</li> 
     201<li><p class="first">Send your BEP submission to the BEP editors at <a class="reference external" href="mailto:editor&#37;&#52;&#48;bittorrent&#46;org">editor<span>&#64;</span>bittorrent<span>&#46;</span>org</a>.</p> 
     202</li> 
     203</ul> 
     204</div> 
     205<div class="section" id="restructuredtext-bep-formatting-requirements"> 
     206<h1>ReStructuredText BEP Formatting Requirements</h1> 
     207<p>The following is a BEP-specific summary of reStructuredText syntax. 
     208For the sake of simplicity and brevity, much detail is omitted.  For 
     209more detail, see <a class="reference internal" href="#resources">Resources</a> below.  <a class="reference internal" href="#literal-blocks">Literal blocks</a> (in which no 
     210markup processing is done) are used for examples throughout, to 
     211illustrate the plaintext markup.</p> 
     212<div class="section" id="general"> 
     213<h2>General</h2> 
     214<p>You must adhere to the Emacs convention of adding two spaces at the 
     215end of every sentence.</p> 
     216<p>Tab characters must never appear in the document at all.  A BEP should 
     217include the standard Emacs stanza included by example at the bottom of 
     218this BEP.</p> 
     219</div> 
     220<div class="section" id="section-headings"> 
     221<h2>Section Headings</h2> 
     222<p>BEP headings must begin in column zero and the initial letter of each 
     223word must be capitalized as in book titles.  Acronyms should be in all 
     224capitals.  Section titles must be adorned with an underline, a single 
     225repeated punctuation character, which begins in column zero and must 
     226extend at least as far as the right edge of the title text (4 
     227characters minimum).  First-level section titles are underlined with 
     228&quot;=&quot; (equals signs), second-level section titles with &quot;-&quot; (hyphens), 
     229and third-level section titles with &quot;'&quot; (single quotes or 
     230apostrophes).  For example:</p> 
     231<pre class="literal-block"> 
     232First-Level Title 
     233================= 
     234 
     235Second-Level Title 
     236------------------ 
     237 
     238Third-Level Title 
     239''''''''''''''''' 
     240</pre> 
     241<p>If there are more than three levels of sections in your BEP, you may 
     242insert overline/underline-adorned titles for the first and second 
     243levels as follows:</p> 
     244<pre class="literal-block"> 
     245============================ 
     246First-Level Title (optional) 
     247============================ 
     248 
     249----------------------------- 
     250Second-Level Title (optional) 
     251----------------------------- 
     252 
     253Third-Level Title 
     254================= 
     255 
     256Fourth-Level Title 
     257------------------ 
     258 
     259Fifth-Level Title 
     260''''''''''''''''' 
     261</pre> 
     262<p>You shouldn't have more than five levels of sections in your BEP.  If 
     263you do, you should consider rewriting it.</p> 
     264<p>You must use two blank lines between the last line of a section's body 
     265and the next section heading.  If a subsection heading immediately 
     266follows a section heading, a single blank line in-between is 
     267sufficient.</p> 
     268<p>The body of each section is not normally indented, although some 
     269constructs do use indentation, as described below.  Blank lines are 
     270used to separate constructs.</p> 
     271</div> 
     272<div class="section" id="paragraphs"> 
     273<h2>Paragraphs</h2> 
     274<p>Paragraphs are left-aligned text blocks separated by blank lines. 
     275Paragraphs are not indented unless they are part of an indented 
     276construct (such as a block quote or a list item).</p> 
     277</div> 
     278<div class="section" id="inline-markup"> 
     279<h2>Inline Markup</h2> 
     280<p>Portions of text within paragraphs and other text blocks may be 
     281styled.  For example:</p> 
     282<pre class="literal-block"> 
     283Text may be marked as *emphasized* (single asterisk markup, 
     284typically shown in italics) or **strongly emphasized** (double 
     285asterisks, typically boldface).  ``Inline literals`` (using double 
     286backquotes) are typically rendered in a monospaced typeface.  No 
     287further markup recognition is done within the double backquotes, 
     288so they're safe for any kind of code snippets. 
     289</pre> 
     290</div> 
     291<div class="section" id="block-quotes"> 
     292<h2>Block Quotes</h2> 
     293<p>Block quotes consist of indented body elements.  For example:</p> 
     294<pre class="literal-block"> 
     295This is a paragraph. 
     296 
     297    This is a block quote. 
     298 
     299    A block quote may contain many paragraphs. 
     300</pre> 
     301<p>Block quotes are used to quote extended passages from other sources. 
     302Block quotes may be nested inside other body elements.  Use 4 spaces 
     303per indent level.</p> 
     304</div> 
     305<div class="section" id="literal-blocks"> 
     306<h2>Literal Blocks</h2> 
     307<!-- In the text below, double backquotes are used to denote inline 
     308literals.  "``::``" is written so that the colons will appear in a 
     309monospaced font; the backquotes (``) are markup, not part of the 
     310text.  See "Inline Markup" above. 
     311 
     312By the way, this is a comment, described in "Comments" below. --> 
     313<p>Literal blocks are used for code samples or preformatted ASCII art. To 
     314indicate a literal block, preface the indented text block with 
     315&quot;<tt class="docutils literal"><span class="pre">::</span></tt>&quot; (two colons).  The literal block continues until the end of 
     316the indentation.  Indent the text block by 4 spaces.  For example:</p> 
     317<pre class="literal-block"> 
     318This is a typical paragraph.  A literal block follows. 
     319 
     320:: 
     321 
     322    for a in [5,4,3,2,1]:   # this is program code, shown as-is 
     323        print a 
     324    print &quot;it's...&quot; 
     325    # a literal block continues until the indentation ends 
     326</pre> 
     327<p>The paragraph containing only &quot;<tt class="docutils literal"><span class="pre">::</span></tt>&quot; will be completely removed from 
     328the output; no empty paragraph will remain.  &quot;<tt class="docutils literal"><span class="pre">::</span></tt>&quot; is also 
     329recognized at the end of any paragraph.  If immediately preceded by 
     330whitespace, both colons will be removed from the output.  When text 
     331immediately precedes the &quot;<tt class="docutils literal"><span class="pre">::</span></tt>&quot;, <em>one</em> colon will be removed from 
     332the output, leaving only one colon visible (i.e., &quot;<tt class="docutils literal"><span class="pre">::</span></tt>&quot; will be 
     333replaced by &quot;<tt class="docutils literal"><span class="pre">:</span></tt>&quot;).  For example, one colon will remain visible 
     334here:</p> 
     335<pre class="literal-block"> 
     336Paragraph:: 
     337 
     338    Literal block 
     339</pre> 
     340</div> 
     341<div class="section" id="lists"> 
     342<h2>Lists</h2> 
     343<p>Bullet list items begin with one of &quot;-&quot;, &quot;*&quot;, or &quot;+&quot; (hyphen, 
     344asterisk, or plus sign), followed by whitespace and the list item 
     345body.  List item bodies must be left-aligned and indented relative to 
     346the bullet; the text immediately after the bullet determines the 
     347indentation.  For example:</p> 
     348<pre class="literal-block"> 
     349This paragraph is followed by a list. 
     350 
     351* This is the first bullet list item.  The blank line above the 
     352  first list item is required; blank lines between list items 
     353  (such as below this paragraph) are optional. 
     354 
     355* This is the first paragraph in the second item in the list. 
     356 
     357  This is the second paragraph in the second item in the list. 
     358  The blank line above this paragraph is required.  The left edge 
     359  of this paragraph lines up with the paragraph above, both 
     360  indented relative to the bullet. 
     361 
     362  - This is a sublist.  The bullet lines up with the left edge of 
     363    the text blocks above.  A sublist is a new list so requires a 
     364    blank line above and below. 
     365 
     366* This is the third item of the main list. 
     367 
     368This paragraph is not part of the list. 
     369</pre> 
     370<p>Enumerated (numbered) list items are similar, but use an enumerator 
     371instead of a bullet.  Enumerators are numbers (1, 2, 3, ...), letters 
     372(A, B, C, ...; uppercase or lowercase), or Roman numerals (i, ii, iii, 
     373iv, ...; uppercase or lowercase), formatted with a period suffix 
     374(&quot;1.&quot;, &quot;2.&quot;), parentheses (&quot;(1)&quot;, &quot;(2)&quot;), or a right-parenthesis 
     375suffix (&quot;1)&quot;, &quot;2)&quot;).  For example:</p> 
     376<pre class="literal-block"> 
     3771. As with bullet list items, the left edge of paragraphs must 
     378   align. 
     379 
     3802. Each list item may contain multiple paragraphs, sublists, etc. 
     381 
     382   This is the second paragraph of the second list item. 
     383 
     384   a) Enumerated lists may be nested. 
     385   b) Blank lines may be omitted between list items. 
     386</pre> 
     387<p>Definition lists are written like this:</p> 
     388<pre class="literal-block"> 
     389what 
     390    Definition lists associate a term with a definition. 
     391 
     392how 
     393    The term is a one-line phrase, and the definition is one 
     394    or more paragraphs or body elements, indented relative to 
     395    the term. 
     396</pre> 
     397</div> 
     398<div class="section" id="tables"> 
     399<h2>Tables</h2> 
     400<p>Simple tables are easy and compact but you are not required to use 
     401simple tables:</p> 
     402<pre class="literal-block"> 
     403=====  =====  ======= 
     404  A      B    A and B 
     405=====  =====  ======= 
     406False  False  False 
     407True   False  False 
     408False  True   False 
     409True   True   True 
     410=====  =====  ======= 
     411</pre> 
     412<p>There must be at least two columns in a table (to differentiate from 
     413section titles).  Column spans use underlines of hyphens (&quot;Inputs&quot; 
     414spans the first two columns):</p> 
     415<pre class="literal-block"> 
     416=====  =====  ====== 
     417   Inputs     Output 
     418------------  ------ 
     419  A      B    A or B 
     420=====  =====  ====== 
     421False  False  False 
     422True   False  True 
     423False  True   True 
     424True   True   True 
     425=====  =====  ====== 
     426</pre> 
     427<p>Text in a first-column cell starts a new row.  No text in the first 
     428column indicates a continuation line; the rest of the cells may 
     429consist of multiple lines.  For example:</p> 
     430<pre class="literal-block"> 
     431=====  ========================= 
     432col 1  col 2 
     433=====  ========================= 
     4341      Second column of row 1. 
     4352      Second column of row 2. 
     436       Second line of paragraph. 
     4373      - Second column of row 3. 
     438 
     439       - Second item in bullet 
     440         list (row 3, column 2). 
     441=====  ========================= 
     442</pre> 
     443</div> 
     444<div class="section" id="hyperlinks"> 
     445<h2>Hyperlinks</h2> 
     446<p>When referencing an external web page in the body of a BEP, you should 
     447include the title of the page in the text, with either an inline 
     448hyperlink reference to the URL or a footnote reference (see 
     449<a class="reference internal" href="#footnotes">Footnotes</a> below).  Do not include the URL in the body text of the 
     450BEP.</p> 
     451<p>Hyperlink references use backquotes and a trailing underscore to mark 
     452up the reference text; backquotes are optional if the reference text 
     453is a single word.  For example:</p> 
     454<pre class="literal-block"> 
     455In this paragraph, we refer to the `BitTorrent web site`_. 
     456</pre> 
     457<p>An explicit target provides the URL.  Put targets in a References 
     458section at the end of the BEP, or immediately after the reference. 
     459Hyperlink targets begin with two periods and a space (the &quot;explicit 
     460markup start&quot;), followed by a leading underscore, the reference text, 
     461a colon, and the URL (absolute or relative):</p> 
     462<pre class="literal-block"> 
     463.. _BitTorrent web site: http://www.bittorrent.org/ 
     464</pre> 
     465<p>The reference text and the target text must match (although the match 
     466is case-insensitive and ignores differences in whitespace).  Note that 
     467the underscore trails the reference text but precedes the target text. 
     468If you think of the underscore as a right-pointing arrow, it points 
     469<em>away</em> from the reference and <em>toward</em> the target.</p> 
     470<p>The same mechanism can be used for internal references.  Every unique 
     471section title implicitly defines an internal hyperlink target.  We can 
     472make a link to the Abstract section like this:</p> 
     473<pre class="literal-block"> 
     474Here is a hyperlink reference to the `Abstract`_ section.  The 
     475backquotes are optional since the reference text is a single word; 
     476we can also just write: Abstract_. 
     477</pre> 
     478<p>Footnotes containing the URLs from external targets will be generated 
     479automatically at the end of the References section of the BEP, along 
     480with footnote references linking the reference text to the footnotes.</p> 
     481<p>Text of the form &quot;BEP x&quot; or &quot;RFC x&quot; (where &quot;x&quot; is a number) will be 
     482linked automatically to the appropriate URLs.</p> 
     483</div> 
     484<div class="section" id="footnotes"> 
     485<h2>Footnotes</h2> 
     486<p>Footnote references consist of a left square bracket, a number, a 
     487right square bracket, and a trailing underscore:</p> 
     488<pre class="literal-block"> 
     489This sentence ends with a footnote reference [1]_. 
     490</pre> 
     491<p>Whitespace must precede the footnote reference.  Leave a space between 
     492the footnote reference and the preceding word.</p> 
     493<p>When referring to another BEP, include the BEP number in the body 
     494text, such as &quot;BEP 1&quot;.  The title may optionally appear.  Add a 
     495footnote reference following the title.  For example:</p> 
     496<pre class="literal-block"> 
     497Refer to BEP 1 [2]_ for more information. 
     498</pre> 
     499<p>Add a footnote that includes the BEP's title and author.  It may 
     500optionally include the explicit URL on a separate line, but only in 
     501the References section.  Footnotes begin with &quot;.. &quot; (the explicit 
     502markup start), followed by the footnote marker (no underscores), 
     503followed by the footnote body.  For example:</p> 
     504<pre class="literal-block"> 
     505References 
     506========== 
     507 
     508.. [2] BEP 1, &quot;BEP Purpose and Guidelines&quot;, Harrison 
     509   (http://www.bittorrent.org/beps/bep_0001) 
     510</pre> 
     511<p>If you decide to provide an explicit URL for a BEP, please use this as 
     512the URL template:</p> 
     513<pre class="literal-block"> 
     514http://www.bittorrent.org/beps/bep_xxxx 
     515</pre> 
     516<p>BEP numbers in URLs must be padded with zeros from the left, so as to 
     517be exactly 4 characters wide, however BEP numbers in the text are 
     518never padded.</p> 
     519<p>During the course of developing your BEP, you may have to add, remove, 
     520and rearrange footnote references, possibly resulting in mismatched 
     521references, obsolete footnotes, and confusion.  Auto-numbered 
     522footnotes allow more freedom.  Instead of a number, use a label of the 
     523form &quot;#word&quot;, where &quot;word&quot; is a mnemonic consisting of alphanumerics 
     524plus internal hyphens, underscores, and periods (no whitespace or 
     525other characters are allowed).  For example:</p> 
     526<pre class="literal-block"> 
     527Refer to BEP 1 [#BEP-1]_ for more information. 
     528 
     529References 
     530========== 
     531 
     532.. [#BEP-1] BEP 1, &quot;BEP Purpose and Guidelines&quot;, Harrison 
     533 
     534   http://www.bittorrent.org/beps/bep-0001 
     535</pre> 
     536<p>Footnotes and footnote references will be numbered automatically, and 
     537the numbers will always match.  Once a BEP is finalized, auto-numbered 
     538labels should be replaced by numbers for simplicity.</p> 
     539</div> 
     540<div class="section" id="images"> 
     541<h2>Images</h2> 
     542<p>If your BEP contains a diagram, you may include it in the processed 
     543output using the &quot;image&quot; directive:</p> 
     544<pre class="literal-block"> 
     545.. image:: diagram.png 
     546</pre> 
     547<p>Any browser-friendly graphics format is possible: .png, .jpeg, .gif, 
     548.tiff, etc.</p> 
     549<p>Since this image will not be visible to readers of the BEP in source 
     550text form, you should consider including a description or ASCII art 
     551alternative, using a comment (below).</p> 
     552</div> 
     553<div class="section" id="comments"> 
     554<h2>Comments</h2> 
     555<p>A comment block is an indented block of arbitrary text immediately 
     556following an explicit markup start: two periods and whitespace.  Leave 
     557the &quot;..&quot; on a line by itself to ensure that the comment is not 
     558misinterpreted as another explicit markup construct.  Comments are not 
     559visible in the processed document.  For the benefit of those reading 
     560your BEP in source form, please consider including a descriptions of 
     561or ASCII art alternatives to any images you include.  For example:</p> 
     562<pre class="literal-block"> 
     563.. image:: dataflow.png 
     564 
     565.. 
     566   Data flows from the input module, through the &quot;black box&quot; 
     567   module, and finally into (and through) the output module. 
     568</pre> 
     569<p>The Emacs stanza at the bottom of this document is inside a comment.</p> 
     570</div> 
     571<div class="section" id="escaping-mechanism"> 
     572<h2>Escaping Mechanism</h2> 
     573<p>reStructuredText uses backslashes (&quot;<tt class="docutils literal"><span class="pre">\</span></tt>&quot;) to override the special 
     574meaning given to markup characters and get the literal characters 
     575themselves.  To get a literal backslash, use an escaped backslash 
     576(&quot;<tt class="docutils literal"><span class="pre">\\</span></tt>&quot;).  There are two contexts in which backslashes have no 
     577special meaning: <a class="reference internal" href="#literal-blocks">literal blocks</a> and inline literals (see <a class="reference internal" href="#inline-markup">Inline 
     578Markup</a> above).  In these contexts, no markup recognition is done, 
     579and a single backslash represents a literal backslash, without having 
     580to double up.</p> 
     581<p>If you find that you need to use a backslash in your text, consider 
     582using inline literals or a literal block instead.</p> 
     583</div> 
     584</div> 
     585<div class="section" id="habits-to-avoid"> 
     586<h1>Habits to Avoid</h1> 
     587<p>Many programmers who are familiar with TeX often write quotation marks 
     588like this:</p> 
     589<pre class="literal-block"> 
     590`single-quoted' or ``double-quoted'' 
     591</pre> 
     592<p>Backquotes are significant in reStructuredText, so this practice 
     593should be avoided.  For ordinary text, use ordinary 'single-quotes' or 
     594&quot;double-quotes&quot;.  For inline literal text (see <a class="reference internal" href="#inline-markup">Inline Markup</a> 
     595above), use double-backquotes:</p> 
     596<pre class="literal-block"> 
     597``literal text: in here, anything goes!`` 
     598</pre> 
     599</div> 
     600<div class="section" id="resources"> 
     601<h1>Resources</h1> 
     602<p>Many other constructs and variations are possible.  For more details 
     603about the reStructuredText markup, in increasing order of 
     604thoroughness, please see:</p> 
     605<ul class="simple"> 
     606<li><a class="reference external" href="http://docutils.sourceforge.net/docs/rst/quickstart.html">A ReStructuredText Primer</a> <a class="footnote-reference" href="#id16" id="id17">[7]</a>, a gentle introduction.</li> 
     607<li><a class="reference external" href="http://docutils.sourceforge.net/docs/rst/quickref.html">Quick reStructuredText</a> <a class="footnote-reference" href="#id18" id="id19">[8]</a>, a users' quick reference.</li> 
     608<li><a class="reference external" href="http://docutils.sourceforge.net/spec/rst/reStructuredText.html">reStructuredText Markup Specification</a> <a class="footnote-reference" href="#id20" id="id21">[9]</a>, the final authority.</li> 
     609</ul> 
     610<p>The processing of reStructuredText BEPs is done using <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> <a class="footnote-reference" href="#id7" id="id9">[3]</a>.  If 
     611you have a question or require assistance with reStructuredText or 
     612Docutils, please <a class="reference external" href="mailto:docutils-users&#37;&#52;&#48;lists&#46;sourceforge&#46;net?subject=BEPs">post a message</a> <a class="footnote-reference" href="#id10" id="id11">[4]</a> to the <a class="reference external" href="http://docutils.sf.net/docs/user/mailing-lists.html#docutils-users">Docutils-users mailing 
     613list</a> <a class="footnote-reference" href="#id12" id="id13">[5]</a>.  The <a class="reference external" href="http://docutils.sourceforge.net/">Docutils project web site</a> <a class="footnote-reference" href="#id7" id="id8">[3]</a> has more information.</p> 
     614<p>This document was derived heavily from PEP-0012 <a class="footnote-reference" href="#pep-12" id="id6">[2]</a>.  In many places 
     615text was simply copied and modified.  Although the PEP-0012 text 
     616was written by David Goodger and Barry Warsaw, they are not 
     617responsible for its use in the BitTorent Enhancement Process, and 
     618should not be bothered with technical questions specific to BitTorrent 
     619or the BEP process.  Please direct all comments to the BitTorrent 
     620editors &lt;<a class="reference external" href="mailto:editor&#37;&#52;&#48;bittorrent&#46;org">editor<span>&#64;</span>bittorrent<span>&#46;</span>org</a>&gt; or the BitTorrent mailing list 
     621&lt;<a class="reference external" href="mailto:bittorrent-list&#37;&#52;&#48;bittorrent&#46;org">bittorrent-list<span>&#64;</span>bittorrent<span>&#46;</span>org</a>&gt;.</p> 
     622</div> 
     623<div class="section" id="acknowledgements"> 
     624<h1>Acknowledgements</h1> 
     625<p>Thanks to Barry Warsaw, David Goodger, and Guido van Rossum for their 
     626guidance.</p> 
     627</div> 
     628<div class="section" id="references"> 
     629<h1>References</h1> 
     630<table class="docutils footnote" frame="void" id="bep-1" rules="none"> 
     631<colgroup><col class="label" /><col /></colgroup> 
     632<tbody valign="top"> 
     633<tr><td class="label"><a class="fn-backref" href="#id1">[1]</a></td><td>BEP_0001. BEP Purpose and Guidelines, Harrison 
     634(<a class="reference external" href="http://www.bittorrent.org/beps/bep_0001">http://www.bittorrent.org/beps/bep_0001</a>)</td></tr> 
     635</tbody> 
     636</table> 
     637<table class="docutils footnote" frame="void" id="pep-12" rules="none"> 
     638<colgroup><col class="label" /><col /></colgroup> 
     639<tbody valign="top"> 
     640<tr><td class="label"><a class="fn-backref" href="#id6">[2]</a></td><td>PEP-0012. Sample reStructuredText PEP Template, Goodger, Warsaw 
     641(<a class="reference external" href="http://www.python.org/peps/pep-0012">http://www.python.org/peps/pep-0012</a>)</td></tr> 
     642</tbody> 
     643</table> 
     644<table class="docutils footnote" frame="void" id="id7" rules="none"> 
     645<colgroup><col class="label" /><col /></colgroup> 
     646<tbody valign="top"> 
     647<tr><td class="label">[3]</td><td><em>(<a class="fn-backref" href="#id8">1</a>, <a class="fn-backref" href="#id9">2</a>)</em> <a class="reference external" href="http://docutils.sourceforge.net/">http://docutils.sourceforge.net/</a></td></tr> 
     648</tbody> 
     649</table> 
     650<table class="docutils footnote" frame="void" id="id10" rules="none"> 
     651<colgroup><col class="label" /><col /></colgroup> 
     652<tbody valign="top"> 
     653<tr><td class="label"><a class="fn-backref" href="#id11">[4]</a></td><td><a class="reference external" href="mailto:docutils-users&#37;&#52;&#48;lists&#46;sourceforge&#46;net?subject=BEPs">mailto:docutils-users<span>&#64;</span>lists<span>&#46;</span>sourceforge<span>&#46;</span>net?subject=BEPs</a></td></tr> 
     654</tbody> 
     655</table> 
     656<table class="docutils footnote" frame="void" id="id12" rules="none"> 
     657<colgroup><col class="label" /><col /></colgroup> 
     658<tbody valign="top"> 
     659<tr><td class="label"><a class="fn-backref" href="#id13">[5]</a></td><td><a class="reference external" href="http://docutils.sf.net/docs/user/mailing-lists.html#docutils-users">http://docutils.sf.net/docs/user/mailing-lists.html#docutils-users</a></td></tr> 
     660</tbody> 
     661</table> 
     662<table class="docutils footnote" frame="void" id="id14" rules="none"> 
     663<colgroup><col class="label" /><col /></colgroup> 
     664<tbody valign="top"> 
     665<tr><td class="label"><a class="fn-backref" href="#id15">[6]</a></td><td><a class="reference external" href="http://www.opencontent.org/openpub/">http://www.opencontent.org/openpub/</a></td></tr> 
     666</tbody> 
     667</table> 
     668<table class="docutils footnote" frame="void" id="id16" rules="none"> 
     669<colgroup><col class="label" /><col /></colgroup> 
     670<tbody valign="top"> 
     671<tr><td class="label"><a class="fn-backref" href="#id17">[7]</a></td><td><a class="reference external" href="http://docutils.sourceforge.net/docs/rst/quickstart.html">http://docutils.sourceforge.net/docs/rst/quickstart.html</a></td></tr> 
     672</tbody> 
     673</table> 
     674<table class="docutils footnote" frame="void" id="id18" rules="none"> 
     675<colgroup><col class="label" /><col /></colgroup> 
     676<tbody valign="top"> 
     677<tr><td class="label"><a class="fn-backref" href="#id19">[8]</a></td><td><a class="reference external" href="http://docutils.sourceforge.net/docs/rst/quickref.html">http://docutils.sourceforge.net/docs/rst/quickref.html</a></td></tr> 
     678</tbody> 
     679</table> 
     680<table class="docutils footnote" frame="void" id="id20" rules="none"> 
     681<colgroup><col class="label" /><col /></colgroup> 
     682<tbody valign="top"> 
     683<tr><td class="label"><a class="fn-backref" href="#id21">[9]</a></td><td><a class="reference external" href="http://docutils.sourceforge.net/spec/rst/reStructuredText.html">http://docutils.sourceforge.net/spec/rst/reStructuredText.html</a></td></tr> 
     684</tbody> 
     685</table> 
     686</div> 
     687<div class="section" id="copyright"> 
     688<h1>Copyright</h1> 
     689<p>This document has been placed in the public domain.</p> 
     690<!-- Local Variables: 
     691mode: indented-text 
     692indent-tabs-mode: nil 
     693sentence-end-double-space: t 
     694fill-column: 70 
     695coding: utf-8 
     696End: --> 
     697</div> 
     698 
     699 
     700</div> 
     701        <div id="footer"> 
     702<hr/> 
     703</div> 
     704 
     705</div> 
     706</body> 
     707</html>