from local.imports import *
from local.notebook.core import *
from local.notebook.export import *
import inspect,enum,nbconvert
from IPython.display import Markdown,display
from IPython.core import page
from nbconvert import HTMLExporter

from local.core import compose, add_docs, chk
from local.data.pipeline import Pipeline
from local.data.external import untar_data, ConfigKey

test_cases = [
    Pipeline,   #Basic class
    ConfigKey,  #Enum
    compose,    #Func with star args and type annotation
    untar_data, #Func with defaults
    add_docs,   #Func with kwargs
    Path.ls     #Monkey-patched
]
###########################
from local.notebook.showdoc import show_doc


def md2html(md):
    "Convert markdown `md` to HTML code"
    if nbconvert.__version__ < '5.5.0': return HTMLExporter().markdown2html(md)
    else: return HTMLExporter().markdown2html(defaultdict(lambda: defaultdict(dict)), md)

############################
# show detailed docs link in notebook 
def doc(elt):
    "Show `show_doc` info in preview window"
    md = show_doc(elt, disp=False)
    output = md2html(md)
    if IN_COLAB: get_ipython().run_cell_magic(u'html', u'', output)
    else:
        try: page.page({'text/html': output})
        except: display(Markdown(md))

doc(untar_data)

08522fbdfdd98ea40b4ba82ce7af12f0be6ca241
<mask token>


def md2html(md):
    """Convert markdown `md` to HTML code"""
    if nbconvert.__version__ < '5.5.0':
        return HTMLExporter().markdown2html(md)
    else:
        return HTMLExporter().markdown2html(defaultdict(lambda :
            defaultdict(dict)), md)


def doc(elt):
    """Show `show_doc` info in preview window"""
    md = show_doc(elt, disp=False)
    output = md2html(md)
    if IN_COLAB:
        get_ipython().run_cell_magic(u'html', u'', output)
    else:
        try:
            page.page({'text/html': output})
        except:
            display(Markdown(md))


<mask token>

<mask token>


def md2html(md):
    """Convert markdown `md` to HTML code"""
    if nbconvert.__version__ < '5.5.0':
        return HTMLExporter().markdown2html(md)
    else:
        return HTMLExporter().markdown2html(defaultdict(lambda :
            defaultdict(dict)), md)


def doc(elt):
    """Show `show_doc` info in preview window"""
    md = show_doc(elt, disp=False)
    output = md2html(md)
    if IN_COLAB:
        get_ipython().run_cell_magic(u'html', u'', output)
    else:
        try:
            page.page({'text/html': output})
        except:
            display(Markdown(md))


doc(untar_data)

<mask token>
test_cases = [Pipeline, ConfigKey, compose, untar_data, add_docs, Path.ls]
<mask token>


def md2html(md):
    """Convert markdown `md` to HTML code"""
    if nbconvert.__version__ < '5.5.0':
        return HTMLExporter().markdown2html(md)
    else:
        return HTMLExporter().markdown2html(defaultdict(lambda :
            defaultdict(dict)), md)


def doc(elt):
    """Show `show_doc` info in preview window"""
    md = show_doc(elt, disp=False)
    output = md2html(md)
    if IN_COLAB:
        get_ipython().run_cell_magic(u'html', u'', output)
    else:
        try:
            page.page({'text/html': output})
        except:
            display(Markdown(md))


doc(untar_data)

from local.imports import *
from local.notebook.core import *
from local.notebook.export import *
import inspect, enum, nbconvert
from IPython.display import Markdown, display
from IPython.core import page
from nbconvert import HTMLExporter
from local.core import compose, add_docs, chk
from local.data.pipeline import Pipeline
from local.data.external import untar_data, ConfigKey
test_cases = [Pipeline, ConfigKey, compose, untar_data, add_docs, Path.ls]
from local.notebook.showdoc import show_doc


def md2html(md):
    """Convert markdown `md` to HTML code"""
    if nbconvert.__version__ < '5.5.0':
        return HTMLExporter().markdown2html(md)
    else:
        return HTMLExporter().markdown2html(defaultdict(lambda :
            defaultdict(dict)), md)


def doc(elt):
    """Show `show_doc` info in preview window"""
    md = show_doc(elt, disp=False)
    output = md2html(md)
    if IN_COLAB:
        get_ipython().run_cell_magic(u'html', u'', output)
    else:
        try:
            page.page({'text/html': output})
        except:
            display(Markdown(md))


doc(untar_data)

from local.imports import *
from local.notebook.core import *
from local.notebook.export import *
import inspect,enum,nbconvert
from IPython.display import Markdown,display
from IPython.core import page
from nbconvert import HTMLExporter

from local.core import compose, add_docs, chk
from local.data.pipeline import Pipeline
from local.data.external import untar_data, ConfigKey

test_cases = [
    Pipeline,   #Basic class
    ConfigKey,  #Enum
    compose,    #Func with star args and type annotation
    untar_data, #Func with defaults
    add_docs,   #Func with kwargs
    Path.ls     #Monkey-patched
]
###########################
from local.notebook.showdoc import show_doc


def md2html(md):
    "Convert markdown `md` to HTML code"
    if nbconvert.__version__ < '5.5.0': return HTMLExporter().markdown2html(md)
    else: return HTMLExporter().markdown2html(defaultdict(lambda: defaultdict(dict)), md)

############################
# show detailed docs link in notebook 
def doc(elt):
    "Show `show_doc` info in preview window"
    md = show_doc(elt, disp=False)
    output = md2html(md)
    if IN_COLAB: get_ipython().run_cell_magic(u'html', u'', output)
    else:
        try: page.page({'text/html': output})
        except: display(Markdown(md))

doc(untar_data)
