예제 #1
0
파일: rst.py 프로젝트: satra/nbconvert
    def render_pyout(self, output):
        lines = ['Out[%s]:' % self._get_prompt_number(output), '']

        # output is a dictionary like object with type as a key
        if 'latex' in output:
            lines.extend(rst_directive('.. math::', output.latex))

        if 'text' in output:
            lines.extend(rst_directive('.. parsed-literal::', output.text))

        return lines
예제 #2
0
파일: rst.py 프로젝트: patonelli/nbconvert
    def render_pyout(self, output):
        lines = ["Out[%s]:" % self._get_prompt_number(output), ""]

        # output is a dictionary like object with type as a key
        if "latex" in output:
            lines.extend(rst_directive(".. math::", output.latex))

        if "text" in output:
            lines.extend(rst_directive(".. parsed-literal::", output.text))

        return lines
예제 #3
0
파일: rst.py 프로젝트: dkua/nbconvert
    def render_pyout(self, output):
        lines = ['Out[%s]:' % output.prompt_number, '']

        # output is a dictionary like object with type as a key
        if 'latex' in output:
            lines.extend(rst_directive('.. math::', output.latex))

        if 'text' in output:
            lines.extend(rst_directive('.. parsed-literal::', output.text))

        return lines
예제 #4
0
파일: rst.py 프로젝트: dkua/nbconvert
    def render_code(self, cell):
        if not cell.input:
            return []

        lines = ['In[%s]:' % cell.prompt_number, '']
        lines.extend(rst_directive('.. code:: python', cell.input))

        for output in cell.outputs:
            conv_fn = self.dispatch(output.output_type)
            lines.extend(conv_fn(output))

        return lines
예제 #5
0
파일: rst.py 프로젝트: satra/nbconvert
    def render_code(self, cell):
        # Note: cell has type 'IPython.nbformat.v3.nbbase.NotebookNode'
        if not cell.input:
            return []

        lines = ['In[%s]:' % self._get_prompt_number(cell), '']
        lines.extend(rst_directive('.. code:: python', cell.input))

        for output in cell.outputs:
            conv_fn = self.dispatch(output.output_type)
            lines.extend(conv_fn(output))

        return lines
예제 #6
0
파일: rst.py 프로젝트: patonelli/nbconvert
    def render_code(self, cell):
        # Note: cell has type 'IPython.nbformat.v3.nbbase.NotebookNode'
        if not cell.input:
            return []

        lines = ["In[%s]:" % self._get_prompt_number(cell), ""]
        lines.extend(rst_directive(".. code:: python", cell.input))

        for output in cell.outputs:
            conv_fn = self.dispatch(output.output_type)
            lines.extend(conv_fn(output))

        return lines
예제 #7
0
파일: rst.py 프로젝트: patonelli/nbconvert
 def render_display_format_javascript(self, output):
     return rst_directive(".. raw:: javascript", output.javascript)
예제 #8
0
파일: rst.py 프로젝트: patonelli/nbconvert
 def render_display_format_json(self, output):
     return rst_directive(".. raw:: json", output.json)
예제 #9
0
파일: rst.py 프로젝트: patonelli/nbconvert
 def render_display_format_latex(self, output):
     return rst_directive(".. math::", output.latex)
예제 #10
0
파일: rst.py 프로젝트: patonelli/nbconvert
 def render_display_format_html(self, output):
     return rst_directive(".. raw:: html", output.html)
예제 #11
0
파일: rst.py 프로젝트: patonelli/nbconvert
 def _unknown_lines(self, data):
     return rst_directive(".. warning:: Unknown cell") + [data]
예제 #12
0
파일: rst.py 프로젝트: patonelli/nbconvert
 def render_display_format_text(self, output):
     return rst_directive(".. parsed-literal::", output.text)
예제 #13
0
파일: rst.py 프로젝트: satra/nbconvert
 def render_display_format_text(self, output):
     return rst_directive('.. parsed-literal::', output.text)
예제 #14
0
파일: rst.py 프로젝트: satra/nbconvert
 def _unknown_lines(self, data):
     return rst_directive('.. warning:: Unknown cell') + [data]
예제 #15
0
파일: rst.py 프로젝트: satra/nbconvert
 def render_display_format_html(self, output):
     return rst_directive('.. raw:: html', output.html)
예제 #16
0
파일: rst.py 프로젝트: satra/nbconvert
 def render_display_format_javascript(self, output):
     return rst_directive('.. raw:: javascript', output.javascript)
예제 #17
0
파일: rst.py 프로젝트: satra/nbconvert
 def render_display_format_json(self, output):
     return rst_directive('.. raw:: json', output.json)
예제 #18
0
파일: rst.py 프로젝트: satra/nbconvert
 def render_display_format_latex(self, output):
     return rst_directive('.. math::', output.latex)