Package: nbjoint
NBJoint - Jupyter Notebook Joint ModuleNBJointgenerates a navigable book-like structure to a collection of Jupyter notebooks.Table of ContentsNamingDescriptionExamplesInstallationDocumentationDevelopmentMaintainerLicenseNamingThis module was renamed fromNBBinder, due to naming conflict withBinder.The new name,NBJoint, is motivated by one of the meanings of the word "joint".According to Merriam-Webster, "joint", as a verb, means"to unite by a joint : fit together"This modulejointsseveral notebooks together, to form a cohesive set of notes, with table of contents, common headers, navigation bars, among other things.DescriptionThe main function in this module is calledjoint(). It reads a collection of Jupyter notebooks from a given directory and, upon configuration,adds atable of contentsto a selected notebook file, with links to the other notebooks;adds aheadercell to each notebook, with custom information about the collection of notebooks;adds abadgecell to each notebook, with links to opening the notebooks in different platforms or formats. For instance, one can include aGoogle Colab badgeand aBinder badge, with links to opening each notebook in these cloud computing plataforms, a badge for showingslidesas exported withnbconvert, and so on.addsnavigator links, at the beggining and at the end of each notebook, with links to traverse to the previous and the next notebook, and to other selected notebooks, such as the Table of Contents and the References;exportsthe notebooks to other formats usingnbconvert, so that, for example,slidescan be generated automatically and in bulk.ExamplesA little tasteFor instance, upon proper configuration (see sectionNotebooks with slides and cloud computing badgesbelow), the collection of bare notebooks in the folderWater bare collectionis bound to the folderWater bound collection, and, in particular, the file00.00-Water_Contents.ipynbreceives a table of contents, a header, navigator cells and the badgesBelow we show some examples in more details.Example with configuration fileThe most convenient way to use the module, or script, is via a configuration file. The configuration files are written in theYAMLformat.For instance, consider the followingconfig_nb_alice.yml, which is included in thetestsfolder of the repository:# Configuration file for the python module NBJointversion:0.13apath_to_notes:nb_builds/nb_alicecontents:toc_nb_name:00.00-Alice's_Adventures_in_Wonderland.ipynbtoc_title:Table of Contentsshow_index_in_toc:Trueheader:"NBJointtestonacollectionofnotebooksnamedafterthechaptersof'Alice'sAdventuresinWonderland'"navigators:core_navigators:-00.00-Alice's_Adventures_in_Wonderland.ipynbshow_nb_title_in_nav:Falseshow_index_in_nav:FalseNotebook collectionThe following collection of indexed notebooks is included in the foldertests/nb_builds/nb_alice:00.00-Alice's_Adventures_in_Wonderland.ipynb
01.00-Down_the_Rabbit-Hole.ipynb
02.00-The_Pool_of_Tears.ipynb
03.00-A_Caucus-Race_and_a_Long_Tale.ipynb
04.00-The_Rabbit_Sends_in_a_Little_Bill.ipynb
05.00-Advice_from_a_Caterpillar.ipynb
06.00-Pig_and_Pepper.ipynb
07.00-A_Mad_Tea-Party.ipynb
08.00-The_Queen's_Croquet-Ground.ipynb
09.00-The_Mock_Turtle's_Story.ipynb
10.00-The_Lobster_Quadrille.ipynb
11.00-Who_Stole_the_Tarts?.ipynb
12.00-Alice's_Evidence.ipynbJointing the collectionOne way to joint the collection of notebooks is to import the module and use thejoint()function with this configuration file as argument:importnbjointasnbjnbj.joint('config_nb_alice.yml')Or we execute it as a script in the command line:./nbjoint.pyconfig_nb_alice.ymlIn thetestsdirectory, the configuration file is actually not in the same folder as the script. The collection is two folders down. This is indicated by the argumentpath_to_notes: nb_builds/nb_alice, given in the configuration file.ResultAfter jointing the notebooks in one of the two ways mentioned above, the following table of contents is inserted in the first notebook00.00-Alice's_Adventures_in_Wonderland.ipynb:Table of Contents
Alice's Adventures in Wonderland
1. Down the Rabbit-Hole
2. The Pool of Tears
3. A Caucus-Race and a Long Tale
4. The Rabbit Sends in a Little Bill
5. Advice from a Caterpillar
6. Pig and Pepper
7. A Mad Tea-Party
8. The Queen's Croquet-Ground
9. The Mock Turtle's Story
10. The Lobster Quadrille
11. Who Stole the Tarts?
12. Alice's EvidenceSee00.00-Alice's_Adventures_in_Wonderland.ipynbfor the actual bound version of the first notebook. Notice theheaderin the begining of the notebook and thenavigatorcells after the header and at the end of the notebook. Experiment with the navigator links to move to the other notebooks.Notebooks with subsectionsBy appropriately naming the files, we can have different formattings for theTable of Contents. For instance, if your list of files is00.00-Front_Page.ipynb
01.00-Introduction.ipynb
02.00-Project_Requirements.ipynb
03.00-The_History_of_Grammar.ipynb
04.00-Parts_of_Speech.ipynb
04.01-Nouns.ipynb
04.02-Verbs.ipynb
04.03-Adjectives.ipynb
04.04-Adverbs.ipynb
05.00-Sentences.ipynb
05.01-Complex_Sentences.ipynb
05.02-Compound_Sentences.ipynb
06.00-Paragraphs.ipynb
06.01-Descriptive.ipynb
06.02-Expository.ipynb
06.03-Narrative.ipynb
06.04-Persuasive.ipynb
07.00-Conclusion.ipynb
A0.00-Appendix.ipynb
BA.00-Glossary.ipynb
BB.00-Bibliography.ipynb
BC.00-Index.ipynbwe get, with a suitable configuration, theTable of ContentsTable of Contents
Front Page
1. Introduction
2. Project Requirements
3. The History of Grammar
4. Parts of Speech
  4.1. Nouns
  4.2. Verbs
  4.3. Adjectives
  4.4. Adverbs
5. Sentences
  5.1. Complex Sentences
  5.2. Compound Sentences
6. Paragraphs
  6.1. Descriptive
  6.2. Expository
  6.3. Narrative
  6.4. Persuasive
7. Conclusion
A. Appendix
Glossary
Bibliography
IndexSee00.00-Front-Page.ipynbfor the actual bound version of the first notebook.The jointer for the notebooks in this collection is configured to includebadgesto render, innbviewer, either the Jupyter notebook itself or the exported version to markdown. Thebadgecell is located just below the header. Just click the badge with themouse right buttonto open it. If clicking it with the right button, from within github, nothing will happen.Notebooks with preheadersThis is particularly useful for lectures notes. For instance, by naming your collection of notebooks as00.00-Introduction.ipynb
01.00.Lecture-Math_Background.ipynb
01.01-Vector_Calculus.ipynb
01.02-Rigid_Motions.ipynb
02.00.Lecture-Kinematics.ipynb
02.01.Lecture-Velocity_and_Acceleration.ipynb
02.02.Lecture-Different_Types_of_Motions_and_Their_Components.ipynb
03.00.Lecture-Dynamics.ipynb
03.01..Part-Force_and_Momentum.ipynb
03.02..Part-Orbits_of_Planets_and_Satellites.ipynb
03.03..Part-Interception_and_Rendezvous.ipynb
04.00.Lecture-Trajectory_Optimization.ipynb
04.01.Lecture.Part-Performance.ipynb
04.02.Lecture.Part-Gravity_Turn.ipynb
04.03.Lecture.Part-Optimization.ipynb
AA.00-References.ipynbwe get, with a suitable configuration, theTable of ContentsContents
Introduction
Lecture 1. Math Background
  1.1. Vector Calculus
  1.2. Rigid Motions
Lecture 2. Kinematics
  Lecture 2.1. Velocity and Acceleration
  Lecture 2.2. Different Types of Motions and Their Components
Lecture 3. Dynamics
  Part 1. Force and Momentum
  Part 2. Orbits of Planets and Satellites
  Part 3. Interception and Rendezvous
Lecture 4. Trajectory Optimization
  Lecture 4. Part 1. Performance
  Lecture 4. Part 2. Gravity Turn
  Lecture 4. Part 3. Optimization
ReferencesSee00.00-Introduction.ipynbfor the actual bound version of the first notebook.Notice, above, different forms of displaying the parts of the same lecture note.The jointer for the notebooks in this collection is configured to include abadgeto open them innbviewer. Thebadgeis located just below the header. Just click the badge with themouse right buttonto open it. If clicking it with the right button, from within github, nothing will happen.Notebooks with slides and cloud computing badgesThe following configuration file is used in the collection of files present in the folderWater:# Configuration file for the python module NBJointversion:0.13apath_to_notes:nb_builds/nb_watercontents:toc_nb_name:00.00-Water_Contents.ipynbtoc_title:Table of Contentsshow_index_in_toc:Trueheader:"[*NBJointtestonacollectionofnotebooksaboutsomethermodynamicproperpertiesofwater*](https://github.com/rmsrosa/nbjoint)"navigators:core_navigators:-00.00-Water_Contents.ipynb-BA.00-References.ipynbshow_nb_title_in_nav:Trueshow_index_in_nav:Falsebadges:-title:Open in Google Colaburl:https://colab.research.google.com/github/rmsrosa/nbjoint/blob/master/tests/nb_builds/nb_watersrc:https://colab.research.google.com/assets/colab-badge.svg-title:Open in binderurl:https://mybinder.org/v2/gh/rmsrosa/nbjoint/master?filepath=tests/nb_builds/nb_watersrc:https://mybinder.org/badge.svg-title:View in NBViewerurl:https://nbviewer.jupyter.org/github/rmsrosa/nbjoint/blob/master/tests/nb_builds/nb_waterlabel:view inmessage:nbviewercolor:orange-title:View Slidesurl:https://nbviewer.jupyter.org/github/rmsrosa/nbjoint/blob/master/tests/nb_builds/nb_water_slidesextension:.slides.htmllabel:viewmessage:slidescolor:darkgreenexports:-export_path:nb_builds/nb_water_slidesexporter_name:slidesexporter_args:reveal_scroll:TrueAfter jointing the collection, the folderWater bound collectionis created. See00.00-Water_Contents.ipynbfor the first notebook, containing the table of contents. Now, each notebook has a badge cell with badges to open the notebooks inGoogle Colab,Binder, andnbviewer, and a final badge to open the associatedReveal.JSslides.For the slides, the folderWater Slidesis created vianbconvert, in accordance to the parameters associated with the keyexportsin the configuration file.Thebadge celllooks likeInstallationThe module is available inPyPIand installation is done withpipinstallnbjointThe module can also be downloaded directly from github.com/rmsrosa/nbjoint.More information about the installation processes on theInstallation section of the NBJoint documentation.DocumentationThe documentation of NBJoint is hosted onnbjoint.readthedocs.io.DevelopmentDuring the current alpha stage of the project, development is being done in themasterbranch, which is currently the only branch in the repository.When the firstbetaversion is released, the latest stable version will stay in themasterbranch and development will belong to a separatedevelopmentbranch.Maintainer@rmsrosaLicenseThe work in this package is licensed under theMIT license.This work is based on a few scripts inPython Data Science Handbook/tools, which is considered as theoriginal work,  licensed byJake VanderPlasunder theMIT license.See the fileLICENSEin the root directory of the project.