Metadata-Version: 1.1
Name: draftjs_exporter_markdown
Version: 0.1.0
Summary: Library to convert rich text from Draft.js raw ContentState to Markdown, based on draftjs_exporter
Home-page: https://github.com/thibaudcolas/draftjs_exporter_markdown
Author: Thibaud Colas
Author-email: thibaudcolas@gmail.com
License: MIT
Description-Content-Type: UNKNOWN
Description: Draft.js exporter 🐍 - Markdown edition ` <https://pypi.python.org/pypi/draftjs_exporter_markdown>`_ ` <https://travis-ci.org/thibaudcolas/draftjs_exporter_markdown>`_ ` <https://coveralls.io/github/thibaudcolas/draftjs_exporter_markdown?branch=master>`_
        ==============================================================================================================================================================================================================================================================
        
        > Library to convert rich text from Draft.js raw ContentState to Markdown, based on `Draft.js exporter <https://github.com/springload/draftjs_exporter>`_.
        >
        > 🚧 This is an experimental exporter with limited Markdown support – please use with caution.
        
        Usage
        -----
        
        This package is a Markdown export configuration for the `Draft.js exporter <https://github.com/springload/draftjs_exporter>`_. Specifically, it provides:
        
        * A Markdown-friendly exporter engine, with fallbacks to HTML tags.
        * Configuration for basic Markdown formatting.
        
        First, install the package:
        
        .. code-block:: sh
        
            pip install draftjs_exporter_markdown
            
        
        
        Then, to convert Draft.js content to Markdown:
        
        And in Python:
        
        .. code-block:: py
        
            from draftjs_exporter.html import HTML
            from draftjs_exporter_markdown import BLOCK_MAP, ENGINE, ENTITY_DECORATORS, STYLE_MAP
            
            # Initialise the exporter.
            exporter = HTML({
                # Those configurations are overridable like for draftjs_exporter.
                'block_map': BLOCK_MAP,
                'style_map': STYLE_MAP,
                'entity_decorators': ENTITY_DECORATORS,
                'engine': ENGINE,
            })
            
            markdown = exporter.render({
                'entityMap': {},
                'blocks': [{
                    'key': '6mgfh',
                    'text': 'Hello, world!',
                    'type': 'unstyled',
                    'depth': 0,
                    'inlineStyleRanges': [],
                    'entityRanges': []
                }]
            })
            
            print(markdown)
            
        
        
        You can also run an example by downloading this repository and then using `python example.py`.
        
        Configuration
        ~~~~~~~~~~~~~
        
        Please refer to the `Draft.js exporter configuration documentation <https://github.com/springload/draftjs_exporter#configuration>`_.
        
        Supported Markdown formatting
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        
        The built-in configuration provides support for:
        
        * Inline styles: bold, italic, strikethrough, code
        * Blocks: paragraphs, heading levels, bullet and number lists, code blocks, blockquote
        * Images, links, and horizontal rules
        
        Contrary to the main Draft.js exporter,
        
        * Nested / overlapping styles aren't supported.
        * None of the content is escaped (HTML escaping is unnecessary for Markdown, and there is no Markdown escaping).
        
        Development
        -----------
        
        > Requirements: `virtualenv`, `pyenv`, `twine`
        
        .. code-block:: sh
        
            git clone git@github.com:thibaudcolas/draftjs_exporter_markdown.git
            cd draftjs_exporter_markdown/
            
            # Install the git hooks.
            ./.githooks/deploy
            
            # Install dependencies
            nvm install
            npm install
            
            # Install the Python environment.
            virtualenv .venv
            source ./.venv/bin/activate
            make init
            
            # Install required Python versions
            pyenv install --skip-existing 2.7.11
            pyenv install --skip-existing 3.6.3
            # Make required Python versions available globally.
            pyenv global system 2.7.11 3.6.3
            
            # Run the built-in example.
            make dev
            
        
        
        Releases
        ~~~~~~~~
        
        Use `make release`, which uses `standard-version <https://github.com/conventional-changelog/standard-version>`_ to generate the CHANGELOG and decide on the version bump based on the commits since the last release.
        
        Credits
        -------
        
        View the full list of `contributors <https://github.com/thibaudcolas/draftjs_exporter_markdown/graphs/contributors>`_. `MIT <LICENSE>`_ licensed.
        
Keywords: draftjs,exporter,markdown,content
Platform: UNKNOWN
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Internet :: WWW/HTTP :: Site Management
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Editors :: Word Processors
