()
Master function for examples list generation.

    This function initializes SDC data structures, and parses required templates for
    Final RST file generation that lists all the examples.
Master function for examples list generation.
Master function for examples list generation .
def generate_examples():
    """
    Master function for examples list generation.

    This function initializes SDC data structures, and parses required templates for
    Final RST file generation that lists all the examples.
    """
    init_sdc_structure()

    all_examples = []
    for templ_fname in APIREF_TEMPLATE_FNAMES:
        all_examples += get_tmpl_examples(templ_fname)

    if not EXAMPLES_REL_PATH.exists():
        EXAMPLES_REL_PATH.mkdir(parents=True, exist_ok=True)

    examples_rst_path = EXAMPLES_REL_PATH / 'examples.rst'
    with examples_rst_path.open('w', encoding='utf-8') as fd:
        for examples in all_examples:
            fd.write(examples + '\n')
def generate_examples ( ) : init_sdc_structure ( ) all_examples = [ ] for templ_fname in APIREF_TEMPLATE_FNAMES : all_examples += get_tmpl_examples ( templ_fname ) if not EXAMPLES_REL_PATH . exists ( ) : EXAMPLES_REL_PATH . mkdir ( parents = True , exist_ok = True ) examples_rst_path = EXAMPLES_REL_PATH / 'examples.rst' with examples_rst_path . open ( 'w' , encoding = 'utf-8' ) as fd : for examples in all_examples : fd . write ( examples + '\n' )