Some cells to test the flags that control doc generation.
exported and shown

hide_input

any flag other that #hide should be ignored in markdown cells

input should be hidden
print('output should be hidden')
from nbdev.showdoc import show_doc
from decision_tree.test.doc import _TstClass

_TstClass.a[source]

_TstClass.a()

no flag

_TstClass.c[source]

_TstClass.c()

hide_input flag

_TstClass.d[source]

_TstClass.d()

hide_output flag

class AnotherTestClass():
    "just another test class"
    def a():
        "with a dummy method"
        pass
class AnotherTestClass[source]

AnotherTestClass()

just another test class

AnotherTestClass.a[source]

AnotherTestClass.a()

with a dummy method

# exports
print('exported and shown')
exported and shown
print('collapse')
collapse
print('collapse_show')
collapse_show
def demo_multi_line_of_code():
    print('collapse-show with multiple lines of code')
demo_multi_line_of_code()
collapse-show with multiple lines of code
#collapse-show
def demo_multi_line_of_code():
    print('collapse-show AND collapse-output with multiple lines of code')
demo_multi_line_of_code()
# Note: nbdev does not allow both input and outout to be collapse - input gets picked up first
collapse-show AND collapse-output with multiple lines of code
print('collapse_hide')
collapse_hide
print('collapse_output')
collapse_output
print('collapse-output\nwith\nmultiple lines of output')
collapse-output
with
multiple lines of output

The cell below hides its input and collapses output

collapse-output
with
multiple lines of output
and hidden input

combine flags that control doc generation and other flags

input should be hidden - even when used with test flag
#  slow
print('output should be hidden - even when used with test flag')

nbdev "0.2.18" (pre-magic) is sensitive to the order of multiple flags

works fine for hide_input/hide_output but misses the hide flags unless it's the 1st thing in the cell

input should be hidden - even when used with test flag
#hide_output
print('output should be hidden - even when used with test flag')