def get_course_syllabus_section(course, section_key):
 if (section_key in ['syllabus', 'guest_syllabus']):
  try:
   filesys = course.system.resources_fs
   dirs = [(path('syllabus') / course.url_name), path('syllabus')]
   filepath = find_file(filesys, dirs, (section_key + '.html'))
   with filesys.open(filepath) as html_file:
    return replace_static_urls(html_file.read().decode('utf-8'), getattr(course, 'data_dir', None), course_id=course.id, static_asset_path=course.static_asset_path)
  except ResourceNotFoundError:
   log.exception(u'Missing syllabus section %s in course %s', section_key, course.location.to_deprecated_string())
   return '! Syllabus missing !'
 raise KeyError(('Invalid about key ' + str(section_key)))

def get_course_syllabus_section ( course , section_key ) : if ( section_key in [ 'syllabus' , 'guest_syllabus' ] ) : try : filesys = course . system . resources_fs dirs = [ ( path ( 'syllabus' ) / course . url_name ) , path ( 'syllabus' ) ] filepath = find_file ( filesys , dirs , ( section_key + '.html' ) ) with filesys . open ( filepath ) as html_file : return replace_static_urls ( html_file . read ( ) . decode ( 'utf-8' ) , getattr ( course , 'data_dir' , None ) , course_id = course . id , static_asset_path = course . static_asset_path ) except ResourceNotFoundError : log . exception ( u'Missing syllabus section %s in course %s' , section_key , course . location . to_deprecated_string ( ) ) return '! Syllabus missing !' raise KeyError ( ( 'Invalid about key ' + str ( section_key ) ) )
this returns the snippet of html to be rendered on the syllabus page .