← 输入框|github.com|刷新
Skip to content

html documentation does not show comments in code blocks #59088

Closed

Description

@alexgarel
mannequin
BPO 14883
Nosy @ezio-melotti
Superseder
  • bpo-12947: doctest directive examples in library/doctest.html lack the flags
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2012-05-22.14:18:23.317>
    created_at = <Date 2012-05-22.14:15:30.438>
    labels = ['type-bug', 'docs']
    title = 'html documentation does not show comments in code blocks'
    updated_at = <Date 2012-05-22.14:18:23.315>
    user = 'https://bugs.python.org/alexgarel'

    bugs.python.org fields:

    activity = <Date 2012-05-22.14:18:23.315>
    actor = 'ezio.melotti'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2012-05-22.14:18:23.317>
    closer = 'ezio.melotti'
    components = ['Documentation']
    creation = <Date 2012-05-22.14:15:30.438>
    creator = 'alexgarel'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 14883
    keywords = []
    message_count = 2.0
    messages = ['161351', '161353']
    nosy_count = 3.0
    nosy_names = ['ezio.melotti', 'docs@python', 'alexgarel']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '12947'
    type = 'behavior'
    url = 'https://bugs.python.org/issue14883'
    versions = ['Python 2.7', 'Python 3.2', 'Python 3.3']

    Activity

    1. alexgarel commented on May 22, 2012

      alexgarelmannequin
      MannequinAuthor

      Just under http://docs.python.org/library/doctest.html#doctest.REPORTING_FLAGS documentation speaks about how Doctest directives maybe expressed as special Python comments.

      There are some example along with the narrative story, however comments which here are the important part, are not displayed in code snippet.

      Looking at the sphinx source for this page : http://docs.python.org/_sources/library/doctest.txt the comments are present. Eg.

         >>> print range(20) #doctest: +NORMALIZE_WHITESPACE
         [0,   1,  2,  3,  4,  5,  6,  7,  8,  9,
         10,  11, 12, 13, 14, 15, 16, 17, 18, 19]

      However in the generated html, they are not:

      <span class="k">print</span> <span class="nb">range</span>
      <span class="p">(</span><span class="mi">20</span><span class="p">)</span>
      <span class="go">[0, 1, 2, 3, 4, 5, 6, 7, 8, 9,</span>

      Note that this issue is not present in python 2.6.8 documentation http://docs.python.org/release/2.6.8/library/doctest.html#doctest.REPORTING_FLAGS and also 3.1.5 is ok.

      It appears versions at 3.2.1 and 2.7.3

    2. added
      docs
      type-bug
      on May 22, 2012
    3. ezio-melotti commented on May 22, 2012

      @ezio-melotti
      Member

      This is a duplicate of bpo-12947.

    4. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      docstype-bug

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions