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