How to use the tldr.parser.parse_page function in tldr

To help you get started, we’ve selected a few tldr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lord63 / tldr.py / tests / test_parse.py View on Github external
},
            'platform': 'linux',
            'repo_directory': '/tmp/tldr'
        }
        expected_result = (
            '\n'
            '\x1b[0m\x1b[34m  Main node command\n'
            '\x1b[0m\n\x1b[0m\x1b[32m- Call an interactive node shell'
            '\n\x1b[0m\n\x1b[0m\x1b[36m  node\n'
            '\x1b[0m\n\x1b[0m\x1b[32m- Execute node on a JS file\n'
            '\x1b[0m\n\x1b[0m\x1b[36m  node {{FILENAME}}.js\n'
            '\x1b[0m\n\x1b[0m'
        )
        with mock.patch('tldr.parser.get_config', return_value=mock_config):
            with mock.patch('io.open', mock.mock_open(read_data=page_content)):
                result = parse_page('/repo_directory/pages/common/node.md')
                assert ''.join(result) == expected_result
github lord63 / tldr.py / tldr / cli.py View on Github external
def parse_man_page(command, platform):
    """Parse the man page and return the parsed lines."""
    page_path = find_page_location(command, platform)
    output_lines = parse_page(page_path)
    return output_lines

tldr

command line client for tldr

MIT
Latest version published 12 months ago

Package Health Score

74 / 100
Full package analysis