{"id":13500898,"url":"https://github.com/aaren/notedown","last_synced_at":"2025-10-21T19:04:43.218Z","repository":{"id":14213911,"uuid":"16920686","full_name":"aaren/notedown","owner":"aaren","description":"Markdown \u003c=\u003e IPython Notebook","archived":false,"fork":false,"pushed_at":"2021-10-18T21:21:21.000Z","size":364,"stargazers_count":855,"open_issues_count":46,"forks_count":115,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-03-05T20:36:54.701Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aaren.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-17T17:28:59.000Z","updated_at":"2025-02-20T09:53:35.000Z","dependencies_parsed_at":"2022-08-07T07:16:25.448Z","dependency_job_id":null,"html_url":"https://github.com/aaren/notedown","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaren%2Fnotedown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaren%2Fnotedown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaren%2Fnotedown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaren%2Fnotedown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aaren","download_url":"https://codeload.github.com/aaren/notedown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246155998,"owners_count":20732355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T22:01:18.422Z","updated_at":"2025-10-21T19:04:38.176Z","avatar_url":"https://github.com/aaren.png","language":"Jupyter Notebook","funding_links":[],"categories":["Jupyter Notebook","Jupyter-Notebook分享与格式转换"],"sub_categories":[],"readme":"*Python 2/3 and IPython 4 / Jupyter compatible!* \u003ca href='https://travis-ci.org/aaren/wavelets'\u003e \u003cimg src='https://secure.travis-ci.org/aaren/wavelets.png?branch=master'\u003e\u003c/a\u003e\n\nConvert IPython Notebooks to markdown (and back)\n------------------------------------------------\n\n[notedown] is a simple tool to create [IPython notebooks][ipython]\nfrom markdown (and r-markdown).\n\n[ipython]: http://www.ipython.org/notebook\n[notedown]: http://github.com/aaren/notedown\n\n`notedown` separates your markdown into code and not code. Code\nblocks (fenced or indented) go into input cells, everything else\ngoes into markdown cells.\n\nUsage:\n\n    notedown input.md \u003e output.ipynb\n\nInstallation:\n\n    pip install notedown\n\nor the latest on github:\n\n    pip install https://github.com/aaren/notedown/tarball/master\n\n\n### Conversion to markdown\n\nConvert a notebook into markdown, stripping all outputs:\n\n    notedown input.ipynb --to markdown --strip \u003e output.md\n\nConvert a notebook into markdown, with output JSON intact:\n\n    notedown input.ipynb --to markdown \u003e output_with_outputs.md\n\nThe outputs are placed as JSON in a code-block immediately after the\ncorresponding input code-block. `notedown` understands this\nconvention as well, so it is possible to convert this\nmarkdown-with-json back into a notebook.\n\nThis means it is possible to edit markdown, convert to notebook,\nplay around a bit and convert back to markdown.\n\nNB: currently, notebook and cell metadata is not preserved in the\nconversion.\n\nStrip the output cells from markdown:\n\n    notedown with_output_cells.md --to markdown --strip \u003e no_output_cells.md\n\n\n### Running an IPython Notebook\n\n    notedown notebook.md --run \u003e executed_notebook.ipynb\n\n### Editing in the browser *(new!)*\n\nYou can configure IPython / Jupyter to seamlessly use markdown as its storage\nformat. Add the following to your config file:\n\n    c.NotebookApp.contents_manager_class = 'notedown.NotedownContentsManager'\n\n\nNow you can edit your markdown files in the browser, execute code,\ncreate plots - all stored in markdown!\n\nFor Jupyter, your config file is `jupyter_notebook_config.py` in `~/.jupyter`.\nFor IPython your config is `ipython_notebook_config.py` in your ipython\nprofile (probably `~/.ipython/profile_default`):\n\n\n### Editing in vim\n\nThere is a [vim plugin][vimplug] that allows editing notebooks (ipynb files)\ndirectly in vim. They will be automatically converted to markdown on opening the\nfile, and converted back to the original json format on writing.\n\n[vimplug]: https://github.com/goerz/ipynb_notedown.vim\n\n\n### R-markdown\n\nYou can use `notedown` to convert r-markdown as well. We just need\nto tell `notedown` to use [knitr] to convert the r-markdown.\nThis requires that you have R installed with [knitr].\n\nConvert r-markdown into markdown:\n\n    notedown input.Rmd --to markdown --knit \u003e output.md\n\nConvert r-markdown into an IPython notebook:\n\n    notedown input.Rmd --knit \u003e output.ipynb\n\n- `--rmagic` will add `%load_ext rpy2.ipython` at the start of the\n  notebook, allowing you to execute code cells using the rmagic\n  extension (requires [rpy2]). notedown does the appropriate `%R`\n  cell magic automatically.\n\n[knitr]: yihui.name/knitr\n[rpy2]: http://rpy.sourceforge.net/\n\n\n### Magic\n\nFenced code blocks annotated with a language other than python are\nread into cells using IPython's `%%` [cell magic][].\n\n[cell magic]: http://nbviewer.ipython.org/github/ipython/ipython/blob/1.x/examples/notebooks/Cell%20Magics.ipynb\n\nYou can disable this with `--nomagic`.\n\n- `--pre` lets you add arbitrary code to the start of the notebook.\n  e.g. `notedown file.md --pre '%matplotlib inline' 'import numpy as np'`\n\n\n### How do I put a literal code block in my markdown?\n\nBy using the `--match` argument. `notedown` defaults to converting\n*all* code-blocks into code-cells. This behaviour can be changed by\ngiving a different argument to `--match`:\n\n- `--match=all`: convert all code blocks (the default)\n- `--match=fenced`: only convert fenced code blocks\n- `--match=language`: only convert fenced code blocks with\n  'language' as the syntax specifier (or any member of the block\n  attributes)\n- `--match=strict`: only convert code blocks with Pandoc style\n  attributes containing 'python' and 'input' as classes. i.e. code\n  blocks must look like\n\n        ```{.python .input}\n        code\n        ```\n\n### This isn't very interactive!\n\nTry editing the markdown in the IPython Notebook using the\n`NotedownContentsManager` (see above).\n\nYou can get an interactive ipython session in vim by using\n[vim-ipython], which allows you to connect to a running ipython\nkernel. You can send code from vim to ipython and get code\ncompletion from the running kernel. Try it!\n\n[vim-ipython]: http://www.github.com/ivanov/vim-ipython\n\n\n### Where's my syntax highlighting?!\n\nTry using either [vim-markdown] or [vim-pandoc]. Both are clever\nenough to highlight code in markdown.\n\n[vim-markdown]: https://github.com/tpope/vim-markdown\n[vim-pandoc]: https://github.com/vim-pandoc/vim-pandoc\n\n\n### Rendering outputs in markdown\n\nThis is experimental!\n\nConvert a notebook into markdown, rendering cell outputs as native\nmarkdown elements:\n\n    notedown input.ipynb --render\n\nThis means that e.g. png outputs become `![](data-uri)` images and\nthat text is placed in the document.\n\nOf course, you can use this in conjuntion with runipy to produce\nmarkdown-with-code-and-figures from markdown-with-code:\n\n    notedown input.md --run --render \u003e output.md\n\nNot a notebook in sight!\n\nThe `--render` flag forces the output format to markdown.\n\n\n### TODO\n\n- [x] Python 3 support\n- [x] unicode support\n- [x] IPython 3 support\n- [x] IPython 4 (Jupyter) support\n- [ ] Allow kernel specification\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaren%2Fnotedown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faaren%2Fnotedown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaren%2Fnotedown/lists"}