The following are commands in neb in PRs right now. This is not how the textbook developers will create a pdf. The textbook developers will use scripts in cnx-recipes as they have been doing before. We will change the scripts to use neb under the hood.
-
Download the "Introduction to Business" book from production using
neb get
:neb get prod col25734 1.8.5
-
Run
neb assemble
to create a single html with all the modules and TOC. The CLI part is not yet ready so running the python code to get the result:karen@yachiyo:~/src/nebuchadnezzar$ python Python 3.6.7 (default, Oct 22 2018, 11:32:17) [GCC 8.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from nebu.models.binder import Binder >>> from pathlib import Path >>> b = Binder.from_collection_xml(Path('col25734_1.8.5/collection.xml')) >>> b <nebu.models.binder.Binder object at 0x7f7ff7111ac8> >>> from cnxepub.formatters import SingleHTMLFormatter >>> open('col25734_1.8.5/collection.assembled.xhtml', 'w').write(str(SingleHTMLFormatter(b))) 3081300 >>>
-
Run
neb mathify
to transform the math into svg.karen@yachiyo:~/src/nebuchadnezzar$ neb mathify col25734_1.8.5/ Math converted to svg in col25734_1.8.5/collection.mathified.xhtml
To check that math is indeed converted to svg, you can open
col25734_1.8.5/collection.mathified.xhtml
in your browser and search for "The Accounting Equations". "Assets - Liabilities = Owners' equity" should be an svg. -
Run
neb bake
to bake the book with a recipe and add style to the html. You need to have cnx-recipes checked out locally to use the recipes and styles:karen@yachiyo:~/src/nebuchadnezzar$ neb bake -r ../cnx-recipes/recipes/output/intro-business.css -s ../cnx-recipes/styles/output/intro-business.css col25734_1.8.5/ Baked HTML in col25734_1.8.5/collection.baked.xhtml
-
Run
neb pdf
to create a pdf: (You need to pass in the styles again for now)karen@yachiyo:~/src/nebuchadnezzar$ neb pdf -s ../cnx-recipes/styles/output/intro-business.css col25734_1.8.5/ PDF generated col25734_1.8.5/collection.pdf