<s> """<STR_LIT>""" <EOL> from flask import Blueprint , current_app , render_template , safe_join <EOL> from flaskrst . parsers import rstDocument <EOL> page = Blueprint ( '<STR_LIT>' , __name__ ) <EOL> @ page . route ( '<STR_LIT:/>' , defaults = { '<STR_LIT>' : '<STR_LIT:index>' } ) <EOL> @ page . route ( '<STR_LIT>' ) <EOL> def show ( file_path ) : <EOL> if file_path . endswith ( '<STR_LIT:/>' ) : <EOL> file_path += "<STR_LIT:index>" <EOL> rst_file = safe_join ( current_app . config [ '<STR_LIT>' ] , file_path + '<STR_LIT>' ) <EOL> rst = rstDocument ( rst_file ) <EOL> return render_template ( "<STR_LIT>" , page = rst ) <EOL> def setup ( app , cfg ) : <EOL> app . register_blueprint ( page ) </s>
