def notebook_substitute_ref_with_url(ntbk, cr):
    """
    In markdown cells of notebook object `ntbk`, replace sphinx
    cross-references with links to online docs. Parameter `cr` is a
    CrossReferenceLookup object.
    """

    # Iterate over cells in notebook
    for n in range(len(ntbk['cells'])):
        # Only process cells of type 'markdown'
        if ntbk['cells'][n]['cell_type'] == 'markdown':
            # Get text of markdown cell
            txt = ntbk['cells'][n]['source']
            # Replace links to online docs with sphinx cross-references
            txt = cr.substitute_ref_with_url(txt)
            # Replace current cell text with processed text
            ntbk['cells'][n]['source'] = txt
def notebook_substitute_ref_with_url ( ntbk , cr ) : for n in range ( len ( ntbk [ 'cells' ] ) ) : if ntbk [ 'cells' ] [ n ] [ 'cell_type' ] == 'markdown' : txt = ntbk [ 'cells' ] [ n ] [ 'source' ] txt = cr . substitute_ref_with_url ( txt ) ntbk [ 'cells' ] [ n ] [ 'source' ] = txt
In markdown cells of notebook object `ntbk`, replace sphinx
    cross-references with links to online docs. Parameter `cr` is a
    CrossReferenceLookup object.