ioam / ioam-builder

Code for building documentation and running tests across IOAM
1 stars 1 forks source link

Extended notebook directive #5

Closed jlstevens closed 7 years ago

jlstevens commented 7 years ago

This PR aims to add support for notebook slicing via the sphinx directive. For instance you could use:

.. notebook:: holoviews Homepage.ipynb
   :substring: Fundamentally, a HoloViews object
   :end: %%opts Points [scaling_factor=50]

Which includes everything in the notebook from the substring match to the end match (inclusive of both cells). Alternatively you can do:

.. notebook:: holoviews Homepage.ipynb
   :substring: Fundamentally, a HoloViews object
   :end: 3

Where :end: is a count, starting the the cell where the substring matched (inclusive).

The directive raises an exception when substrings don't match which acts as a partial guard against unexpected notebook changes.

Action items

jlstevens commented 7 years ago

I've now ticked off the remaining tasks. Note that docbuilder needs to be updated to include this commit.

jlstevens commented 7 years ago

@philippjfr This will need some refining no doubt but I think it is probably best to merge and polish later.

philippjfr commented 7 years ago

Looks pretty reasonable. Can make fixes later, merging.