Skip to main content

An example project that shows how to use nbdev-org-babel

Project description

An nbdev-org-babel example

Literate Programming using nbdev, org-babel and emacs-jupyter

An nbdev-org-babel example

Literate Programming using nbdev, org-babel and emacs-jupyter

Installation

See this link for the jekyll website documentation generated using nbdev_build_docs_from_org.

There are currently (as of 2020-05-29) many unmentioned dependencies in nbdev-org-babel, such as ox-ipynb, xq, moreutils (sponge) and various emacs libraries. Checkout the bash script in the source code in nbdev-org-babel, to figure those out if you are missing some. I hope nbdev-org-babel gets rewritten in python and merged to fastai's nbdev master in some distant future.

Install procedure(assuming you have dependencies installed):

git clone https://github.com/methuselah-0/nbdev-org-babel.git

cd to nbdev-org-babel

pip install -e .

cd ~/src

nbdev_new my_new_project

cd my_new_project

Edit the settings.ini file as you normally would with any nbdev project.

However, make sure that the following two settings correspond to the github repo name isntead of the defaults:

doc_baseurl = /nbdev-org-babel-example/

git_url = https://github.com/%(user)s/nbdev-org-babel-example/tree/%(branch)s/

create an index.org file in your nbs_path directory.

create a directory inside the nbs_path directory with the same name as lib_name (as defined in settings.ini)

create your literate program in /path/to/repo_name/nbs_path/lib_name/my_project.org

create index.org in /path/to/repo_name/nbs_path/.

Run nbdev_install_git_hooks.

Finally, run nbdev_build_docs_from_org which will create the needed library and documentation for your project.

Note that if you don't want to run the whole procedure from org-files, to ipynb files to building the docs, you can do for example nbdev_build_docs --force_all '*' to just rebuild the html docs from current ipynb files.

To see the results of the .github/workflows/main.yml CI-definition; Click Actions -> Click some commit-message -> Click Build in the left pane -> Click the 3 dots in the upper right corner -> view raw logs

If you are using some dependency packages, make sure to add those in settings.ini under requirements, e.g. requirements = scipy>=1.4.1 numpy>=1.18.4 matplotlib>=3.2.1.

Also, see how to setup console scripts, and how to upload your project to pypi. However, you might find 2 problems out-of-the-box when running make release. In the Makefile from the nbdev template project, you may need to change python setup.py sdist bdist_wheel to python3 set.... Secondly, you may need to install the wheel and twine packages: pip install wheel twine.

Emacs Python Setup Suggestions

List of stuff that is useful for Python LP-programming in emacs:

  • repl: interactively exploring and testing code (emacs-jupyter)
  • version control (git)
  • automatic check for the code's adherence to best practices and syntax highlighting (flycheck-pycheckers)
  • debugging, debugger (real-gud)
  • code definition lookup (emacs-jupyter, ag)
  • docs-generation (org-babel, nbdev, pandoc)
  • code generation & completion (yasnippet, jedi)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ob_example-0.0.3.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ob_example-0.0.3-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file ob_example-0.0.3.tar.gz.

File metadata

  • Download URL: ob_example-0.0.3.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.4

File hashes

Hashes for ob_example-0.0.3.tar.gz
Algorithm Hash digest
SHA256 3cdebf742874759bad1ea95782828aa505fd39deaa245f4a036d2cde820f4cef
MD5 ff0f9308bc7e74e6f4745854196973bb
BLAKE2b-256 3cd7cf7defc4c70e67c8151a571cbb94bad9e6420239495af7fd89d5fbd4f985

See more details on using hashes here.

File details

Details for the file ob_example-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: ob_example-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.4

File hashes

Hashes for ob_example-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 818942d9683fab42e3219832a91be9fea1d4f346aaf5e792bc05be633fb7d12f
MD5 9389cff372e1c9ce04c98375c9188f1a
BLAKE2b-256 66d900be868da957b861d233fce7751845018ddd5eadb005c5800b0a91e661c4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page