Skip to content

RST nodes to ipynb mapping

AakashGC edited this page Feb 12, 2020 · 35 revisions

Nodes from docutils (scroll down to see nodes added by sphinx and sphinxcontrib-jupyter)

Elements Links Ipynb representation
Structural Elements
document doc, source {"cells": [ ] }
section doc, source Every section starts with a title and in a new cell, Example:- "source": ["## Competitive Equilibrium with Distorting Taxes\n ..... "]
topic doc, source No direct mapping
sidebar doc, source No direct mapping, creates a new cell
Structural Subelements
title doc, source One or more #, Example:-"# Title"
subtitle doc, source Creates a new cell starting from subtitle and with one heading level lower then title and is preceded by the title cell. Example:- "source": ["## Subtitle\n ... "]
decoration doc, source No direct mapping `import numpy as np
print(x)`

| | docinfo | doc, source | As a definition list <dt> for ipynb target in sphinxcontrib-jupyter | | transition | doc, source | No direct mapping | Bibliographic Elements | | | | address | doc, source | Address key implemented as dt and value implemented as dd in sphinxcontrib-jupyter | author | doc, source | Author key implemented as dt and value implemented as dd in sphinxcontrib-jupyter | authors | doc, source | Authors key implemented as dt and value implemented as dd in sphinxcontrib-jupyter | contact | doc, source | contact key implemented as dt and value implemented as dd in sphinxcontrib-jupyter | copyright | doc, source | copyright key implemented as dt and value implemented as dd in sphinxcontrib-jupyter | date | doc, source | date key implemented as dt and value implemented as dd in sphinxcontrib-jupyter | organization | doc, source | organization key implemented as dt and value implemented as dd in sphinxcontrib-jupyter | revision | doc, source | revision key implemented as dt and value implemented as dd in sphinxcontrib-jupyter | status | doc, source | status key implemented as dt and value implemented as dd in sphinxcontrib-jupyter | version | doc, source | version key implemented as dt and value implemented as dd in sphinxcontrib-jupyter | Decorative Elements | | | | footer | doc, source | No direct mapping | header | doc, source | No direct mapping | Body Elements | | Simple Body Elements | comment | doc, source | No direct mapping | doctest_block | doc, source | Triple nested block quote because of the syntax | image | doc, source | ![]() as markdown or html img tag which gives more formatting control | literal_block | doc, source | code cell | math_block | doc, source | "$$ ... $$" or can also render MathJax subset of Tex and LaTeX | paragraph | doc, source | Rendered as simple text, no extra syntax | pending | doc, source | No direct mapping | raw | doc, source | | rubric | doc, source | | substitution_definition | doc, source | | target | doc, source | | Simple Body Subelements | attribution | doc, source | | caption | doc, source | | classifier | doc, source | | colspec | doc, source | | field_name | doc, source | | label | doc, source | | line | doc, source | | option_argument | doc, source | | option_string | doc, source | | term | doc, source | | Compound Body Elements | admonition | doc, source | | attention | doc, source | | block_quote | doc, source |
| bullet_list | doc, source | | caution | doc, source | | citation | doc, source | | compound | doc, source | | container| doc, source | | danger | doc, source | | definition_list | doc, source | | enumerated_list| doc, source | | error| doc, source | | field_list| doc, source | | figure| doc, source |
| footnote| doc, source | | hint| doc, source | | important| doc, source | | line_block| doc, source | | note| doc, source | | option_list| doc, source | | system_message| doc, source | | table| doc, source | | tip| doc, source | | warning| doc, source | | Compound Body Subelements | definition| doc, source | | definition_list_item| doc, source |
| description| doc, source | | entry| doc, source | | field| doc, source | | field_body| doc, source | | legend| doc, source | | list_item| doc, source | | option| doc, source | | option_group| doc, source | | option_list_item| doc, source | | row| doc, source | | tbody| doc, source | | tgroup| doc, source | | thead| doc, source | | Inline Elements | abbreviation| doc, source | | acronym| doc, source | | citation_reference| doc, source | | emphasis| doc, source | | footnote_reference| doc, source | | generated| doc, source | | inline| doc, source | | literal| doc, source | | math| doc, source | | problematic| doc, source | | reference| doc, source | | strong| doc, source | | subscript| doc, source | | substitution_reference| doc, source | | superscript| doc, source | | title_reference| doc, source |

Clone this wiki locally