Package docs :: Package latex :: Module fetch_docstrings :: Class Fetch_docstrings
[hide private]
[frames] | no frames]

Class Fetch_docstrings

source code

Instance Methods [hide private]
 
__init__(self, file='docstring.tex')
Fetch all the docstrings of the user functions and format them LaTeX style.
source code
 
break_functions(self, text)
Allow the function text to be broken nicely across lines.
source code
 
build_arg_defaults(self)
Create the user function argument default section.
source code
 
build_description(self)
Create the user function argument default section.
source code
 
build_kargs(self)
Create the user function keyword argument section.
source code
 
build_synopsis(self)
Create the user function synopsis.
source code
 
build_uf(self)
Create the user function sectioning.
source code
 
indexing(self, index, bold=False)
Insert index marks into the text, word by word.
source code
 
index_entries(self)
Function for returning a data structure containing all words which should be indexed.
source code
 
latex_formatting(self, string)
Function for handling LaTeX maths environments.
source code
 
latex_quotes(self, string)
Function for changing the quotes for LaTeX processing.
source code
 
latex_special_chars(self, string)
Function for handling LaTeX special characters.
source code
 
quotes(self, index)
Function for placing quotes within the quote environment.
source code
 
safe_replacement(self, string, text, latex)
Only replace in safe places within the text.
source code
list of bool
tabular_wrapping(self, table, max_char=100)
Determine if column wrapping should occur.
source code
str
word_formatting(self, text, bold=False)
Format the text, word by word.
source code
 
write_item_list(self, item_list)
Format and write out an itemised list.
source code
 
write_list(self, list)
Format and write out a list.
source code
 
write_paragraph(self, text)
Format and write out the paragraph.
source code
 
write_prompt_example(self, list)
Format and write out the prompt UI examples.
source code
 
write_table(self, label)
Format and write out a table.
source code
 
write_verbatim(self, text)
Format and write out the verbatim text.
source code
Method Details [hide private]

break_functions(self, text)

source code 

Allow the function text to be broken nicely across lines.

The '' character will be added later by the latex_special_chars() method.

indexing(self, index, bold=False)

source code 

Insert index marks into the text, word by word.

Parameters:
  • index (int) - The index of the word in the self.words data structure.
  • bold (bool) - A flag which if True will cause the index entries to be in bold font.

tabular_wrapping(self, table, max_char=100)

source code 

Determine if column wrapping should occur.

Parameters:
  • table (list of lists of str) - The table.
  • max_char (int) - The maximum number of characters a column is allowed before wrapping is applied.
Returns: list of bool
The list of flags for wrapping columns.

word_formatting(self, text, bold=False)

source code 

Format the text, word by word.

Parameters:
  • text (str) - The text to format.
  • bold (bool) - A flag for the indexing which if True will cause index entries to be in bold font.
Returns: str
The formatted text.

write_item_list(self, item_list)

source code 

Format and write out an itemised list.

Parameters:
  • item_list (list of list of str) - The list of items and description lists.

write_list(self, list)

source code 

Format and write out a list.

Parameters:
  • list (list of str) - The list.

write_paragraph(self, text)

source code 

Format and write out the paragraph.

Parameters:
  • text (str) - The single line of text to convert into a LaTeX paragraph.

write_prompt_example(self, list)

source code 

Format and write out the prompt UI examples.

Parameters:
  • list (list of str) - The list of prompt UI examples.

write_table(self, label)

source code 

Format and write out a table.

Parameters:
  • label (list of lists of str) - The unique table label.

write_verbatim(self, text)

source code 

Format and write out the verbatim text.

Parameters:
  • text (str) - The text to write out in a LaTeX verbatim environment.