parameters: (file_, path='')
return_statement: return id_, lines
docstring: Parses %!include: value and extract file contents
docstring_summary: Parses %!include: value and extract file contents
docstring_tokens: Parses %!include : value and extract file contents
function: def get_include_contents(file_, path=''):
  	"Parses %!include: value and extract file contents"
  	ids = {'`':'verb', '"':'raw', "'":'tagged' }
  	id_ = 't2t'
  	# Set include type and remove identifier marks
  	mark = file_[0]
  	if mark in ids.keys():
  		if file_[:2] == file_[-2:] == mark*2:
  			id_ = ids[mark]      # set type
  			file_ = file_[2:-2]  # remove marks
  	# Handle remote dir execution
  	filepath = os.path.join(path, file_)
  	# Read included file contents
  	lines = Readfile(filepath, remove_linebreaks=1)
  	# Default txt2tags marked text, just BODY matters
  	if id_ == 't2t':
  		lines = get_file_body(filepath)
  		#TODO fix images relative path if file has a path, ie.: chapter1/index.t2t (wait until tree parsing)
  		#TODO for the images path fix, also respect outfile path, if different from infile (wait until tree parsing)
  		lines.insert(0, '%%INCLUDED(%s) starts here: %s'%(id_,file_))
  		# This appears when included hit EOF with verbatim area open
  		#lines.append('%%INCLUDED(%s) ends here: %s'%(id_,file_))
  	return id_, lines
function_tokens: def get_include_contents ( file_ , path = '' ) : ids = { '`' : 'verb' , '"' : 'raw' , "'" : 'tagged' } id_ = 't2t' # Set include type and remove identifier marks mark = file_ [ 0 ] if mark in ids . keys ( ) : if file_ [ : 2 ] == file_ [ - 2 : ] == mark * 2 : id_ = ids [ mark ] # set type file_ = file_ [ 2 : - 2 ] # remove marks # Handle remote dir execution filepath = os . path . join ( path , file_ ) # Read included file contents lines = Readfile ( filepath , remove_linebreaks = 1 ) # Default txt2tags marked text, just BODY matters if id_ == 't2t' : lines = get_file_body ( filepath ) #TODO fix images relative path if file has a path, ie.: chapter1/index.t2t (wait until tree parsing) #TODO for the images path fix, also respect outfile path, if different from infile (wait until tree parsing) lines . insert ( 0 , '%%INCLUDED(%s) starts here: %s' % ( id_ , file_ ) ) # This appears when included hit EOF with verbatim area open #lines.append('%%INCLUDED(%s) ends here: %s'%(id_,file_)) return id_ , lines