dispatch/modules/content/render.py
def content_to_json(content):
    """Returns article/page content as JSON"""

    def render_node(node):
        """Renders node as JSON"""

        if node['type'] == 'paragraph':
            return node
        else:
            return {
                'type': node['type'],
                'data': embeds.to_json(node['type'], node['data'])
            }

    return map(render_node, content)
def content_to_json(content):
    """Returns article/page content as JSON"""

    def render_node(node):
        """Renders node as JSON"""

        if node['type'] == 'paragraph':
            return node
        else:
            return {
                'type': node['type'],
                'data': embeds.to_json(node['type'], node['data'])
            }

    return map(render_node, content)
def content_to_json ( content ) : def render_node ( node ) : """Renders node as JSON""" if node [ 'type' ] == 'paragraph' : return node else : return { 'type' : node [ 'type' ] , 'data' : embeds . to_json ( node [ 'type' ] , node [ 'data' ] ) } return map ( render_node , content )
Returns article/page content as JSON
Returns article / page content as JSON