Table of Contents

Class: DocumentClass ../HappyDoc-r2_1/happydoclib/docstring/StructuredText/ClassicDocumentClass.py

Class instance calls [ex.=> x()] require a structured text structure. Doc will then parse each paragraph in the structure and will find the special structures within each paragraph. Each special structure will be stored as an instance. Special structures within another special structure are stored within the top structure EX : -underline this- => would be turned into an underline instance. '-underline this' would be stored as an underline instance with a strong instance stored in its string

Methods   
__call__
color_paragraphs
color_text
doc_bullet
doc_description
doc_emphasize
doc_header
doc_href
doc_href1
doc_href2
doc_inner_link
doc_literal
doc_named_link
doc_numbered
doc_strong
doc_table
doc_underline
parse
  __call__ 
__call__ ( self,  doc )

  color_paragraphs 
color_paragraphs (
        self,
        raw_paragraphs,
        type=type,
        sequence_types=(type([] ), type(() ) ),
        st=type( '' ),
        )

  color_text 
color_text (
        self,
        str,
        types=None,
        )

Search the paragraph for each special structure

  doc_bullet 
doc_bullet (
        self,
        paragraph,
        expr=re.compile( '\s*[-*o]\s+' ).match,
        )

  doc_description 
doc_description (
        self,
        paragraph,
        delim=re.compile( '\s+--\s+' ).search,
        nb=re.compile( r'[^\000- ]' ).search,
        )

  doc_emphasize 
doc_emphasize (
        self,
        s,
        expr=re.compile( '\s*\*([ \n%s0-9.:/;,\'\"\?\=\-\>\<\(\)]+)\*(?!\*|-)' % letters ).search,
        )

  doc_header 
doc_header (
        self,
        paragraph,
        expr=re.compile( '[ %s0-9.:/,-_*<>\?\'\"]+' % letters ).match,
        )

  doc_href 
doc_href (
        self,
        s,
        expr,
        punctuation=re.compile( "[\,\.\?\!\;]+" ).match,
        )

  doc_href1 
doc_href1 (
        self,
        s,
        expr=re.compile( "(\"[ %s0-9\n\-\.\,\;\(\)\/\:\/\*\']+\")(:)([a-zA-Z0-9\@\.\,\?\!\/\:\;\-\#\~]+)([,]*\s*)" % letters ).search,
        )

  doc_href2 
doc_href2 (
        self,
        s,
        expr=re.compile( '(\"[ %s0-9\n\-\.\:\;\(\)\/\*\']+\")([,]+\s+)([a-zA-Z0-9\@\.\,\?\!\/\:\;\-\#\~]+)(\s*)' % letters ).search,
        )

  doc_inner_link 
doc_inner_link (
        self,
        s,
        expr1=re.compile( "\.\.\s*" ).search,
        expr2=re.compile( "\[[%s0-9]+\]" % letters ).search,
        )

  doc_literal 
doc_literal (
        self,
        s,
        expr=re.compile( "(?:\s|^)'" "([^ \t\n\r\f\v']|[^ \t\n\r\f\v'][^\n']*[^ \t\n\r\f\v'])" "'(?:\s|[,.;:!?]|$)" ).search,
        )

  doc_named_link 
doc_named_link (
        self,
        s,
        expr=re.compile( r"(\.\.\s)(\[[%s0-9]+\])" % letters ).search,
        )

  doc_numbered 
doc_numbered (
        self,
        paragraph,
        expr=re.compile( '(\s*[%s]+\.)|(\s*[0-9]+\.)|(\s*[0-9]+\s+)' % letters ).match,
        )

  doc_strong 
doc_strong (
        self,
        s,
        expr=re.compile( '\s*\*\*([ \n%s0-9.:/;\-,!\?\'\"]+)\*\*' % letters ).search,
        )

  doc_table 
doc_table (
        self,
        paragraph,
        expr=re.compile( '(\s*)([||]+)' ).match,
        )

  doc_underline 
doc_underline (
        self,
        s,
        expr=re.compile( "_([%s0-9\s\.,\?\/]+)_" % letters ).search,
        )

  parse 
parse (
        self,
        raw_string,
        text_type,
        type=type,
        st=type( '' ),
        lt=type([] ),
        )

Parse accepts a raw_string, an expr to test the raw_string, and the raw_string's subparagraphs.

Parse will continue to search through raw_string until all instances of expr in raw_string are found.

If no instances of expr are found, raw_string is returned. Otherwise a list of substrings and instances is returned


Table of Contents

This document was automatically generated on Sat Aug 24 16:57:29 2002 by HappyDoc version 2.1