<s> """<STR_LIT>""" <EOL> from textwrap import dedent <EOL> from docutils import nodes <EOL> from docutils . parsers . rst import directives <EOL> from docutils . parsers . rst import Directive <EOL> class EmptyDiv ( Directive ) : <EOL> """<STR_LIT>""" <EOL> has_content = False <EOL> required_arguments = <NUM_LIT:1> <EOL> final_argument_whitespace = <NUM_LIT:1> <EOL> def run ( self ) : <EOL> html = '<STR_LIT>' . format ( meta = self . arguments [ <NUM_LIT:0> ] ) <EOL> return [ nodes . raw ( '<STR_LIT>' , html , format = '<STR_LIT:html>' ) ] <EOL> def create_simple_html_directive ( name , pre , post , <EOL> has_content = True , match_titles = False ) : <EOL> """<STR_LIT>""" <EOL> node_class = type ( <EOL> name . replace ( '<STR_LIT:->' , '<STR_LIT:_>' ) , ( nodes . General , nodes . Element ) , { } <EOL> ) <EOL> def visit_html ( self , node ) : <EOL> self . body . append ( pre ) <EOL> def depart_html ( self , node ) : <EOL> self . body . append ( post ) <EOL> def run_directive ( self ) : <EOL> node = node_class ( ) <EOL> if has_content : <EOL> text = self . content <EOL> self . state . nested_parse ( text , self . content_offset , <EOL> node , match_titles = match_titles ) <EOL> self . state . document . settings . record_dependencies . add ( __file__ ) <EOL> return [ node ] <EOL> directive_class = type ( name . title ( ) + '<STR_LIT>' , ( Directive , ) , { <EOL> "<STR_LIT>" : has_content , <EOL> "<STR_LIT>" : run_directive , <EOL> } ) <EOL> def setup ( app ) : <EOL> app . add_node ( node_class , <EOL> html = ( visit_html , depart_html ) ) <EOL> app . add_directive ( name , directive_class ) <EOL> return node_class , directive_class , setup <EOL> intro_text , IntroTextDirective , intro_text_setup = ( <EOL> create_simple_html_directive ( <EOL> "<STR_LIT>" , <EOL> pre = dedent ( """<STR_LIT>""" ) , <EOL> post = dedent ( """<STR_LIT>""" ) , <EOL> ) ) <EOL> tutorial_step_condensed , TutorialStepCondensedDirective , tutorial_step_condensed_setup = ( <EOL> create_simple_html_directive ( <EOL> "<STR_LIT>" , <EOL> pre = dedent ( """<STR_LIT>""" ) , <EOL> post = dedent ( """<STR_LIT>""" ) , <EOL> match_titles = True , <EOL> ) ) <EOL> tutorial_step , TutorialStepDirective , tutorial_step_setup = ( <EOL> create_simple_html_directive ( <EOL> "<STR_LIT>" , <EOL> pre = dedent ( """<STR_LIT>""" ) , <EOL> post = dedent ( """<STR_LIT>""" ) , <EOL> match_titles = True , <EOL> ) ) <EOL> noscript_content , NoScriptContentDirective , noscript_content_setup = ( <EOL> create_simple_html_directive ( <EOL> "<STR_LIT>" , <EOL> pre = dedent ( """<STR_LIT>""" ) , <EOL> post = dedent ( """<STR_LIT>""" ) , <EOL> match_titles = True , <EOL> ) ) <EOL> mobile_label , MobileLabelDirective , mobile_label_setup = ( <EOL> create_simple_html_directive ( <EOL> "<STR_LIT>" , <EOL> pre = dedent ( """<STR_LIT>""" ) , <EOL> post = dedent ( """<STR_LIT>""" ) , <EOL> ) ) <EOL> parallel , ParallelDirective , parallel_setup = ( <EOL> create_simple_html_directive ( <EOL> "<STR_LIT>" , <EOL> pre = dedent ( """<STR_LIT>""" ) , <EOL> post = dedent ( """<STR_LIT>""" ) , <EOL> match_titles = True , <EOL> ) ) <EOL> logo , LogoDirective , logo_setup = ( <EOL> create_simple_html_directive ( <EOL> "<STR_LIT>" , <EOL> pre = dedent ( """<STR_LIT>""" ) , <EOL> post = dedent ( """<STR_LIT>""" ) , <EOL> has_content = False , <EOL> ) ) <EOL> def setup ( app ) : <EOL> """<STR_LIT>""" <EOL> directives . register_directive ( '<STR_LIT>' , EmptyDiv ) <EOL> intro_text_setup ( app ) <EOL> noscript_content_setup ( app ) <EOL> tutorial_step_condensed_setup ( app ) <EOL> tutorial_step_setup ( app ) <EOL> mobile_label_setup ( app ) <EOL> parallel_setup ( app ) <EOL> logo_setup ( app ) </s>
