Code Monkey home page Code Monkey logo

mdtorst's Introduction

mdToRst

Tool and library to convert markdown to restructed text (md to rst).

This tool performs some basic conversions to attempt to generate a restructed text document (RST) which renders the same, or as close as possible to a provided markdown (md).

This tool is not perfect, and may require that you write your markdown in a certain way that is apt toward conversion, but it does save a lot of time and prevent error.

Why?

It does not make sense and is very error prone to manage two different copies of the same documentation.

I really like markdown, and I absolutely despise restructed text. Unfortunately, github prefers markdown and pypi will only use RST, so all of my python projects need to have a distinct MD and RST.

The goal here is to simplify things to where you only have to write and maintain a markdown copy (README.md), and after changes you simply run README.md through mdToRst in order to output README.rst .

Usage

Usage: mdToRst [filename]
	Converts a provided markdown file (.md) to restructed text (.rst)

If "filename" is provided as "--", the markdown will be read from stdin.

Example Usage:

	mdToRst README.md | tee README.rst  # Read in README.md, convert to rst, 
										#  and output both to stdout and "README.rst"


	cat README.md | mdToRst         # Pipe in the contents of "README.md", and
									#  output the converted document to stdout

Modification

If you have a usage scenario where mdToRst generates incorrect or suboptimal results, please submit an issue detailing:

  • How to reproduce the issue

  • What the expected result is

  • Why this makes sense

  • How to achieve the equivilant in RST

and optionally submit a patch as well.

mdtorst's People

Contributors

kata198 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

emacsway bttb123

mdtorst's Issues

-bash: mdToRst: command not found

simontekiMacBook-Pro:mdToRst-1.1.0 simon$ sudo python setup.py install
Password:
running install
running bdist_egg
running egg_info
writing mdToRst.egg-info/PKG-INFO
writing top-level names to mdToRst.egg-info/top_level.txt
writing dependency_links to mdToRst.egg-info/dependency_links.txt
reading manifest file 'mdToRst.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'mdToRst.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.13-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib
creating build/lib/md_to_rst
copying md_to_rst/__init__.py -> build/lib/md_to_rst
creating build/bdist.macosx-10.13-x86_64
creating build/bdist.macosx-10.13-x86_64/egg
creating build/bdist.macosx-10.13-x86_64/egg/md_to_rst
copying build/lib/md_to_rst/__init__.py -> build/bdist.macosx-10.13-x86_64/egg/md_to_rst
byte-compiling build/bdist.macosx-10.13-x86_64/egg/md_to_rst/__init__.py to __init__.pyc
creating build/bdist.macosx-10.13-x86_64/egg/EGG-INFO
installing scripts to build/bdist.macosx-10.13-x86_64/egg/EGG-INFO/scripts
running install_scripts
running build_scripts
creating build/scripts-2.7
copying and adjusting mdToRst -> build/scripts-2.7
changing mode of build/scripts-2.7/mdToRst from 644 to 755
creating build/bdist.macosx-10.13-x86_64/egg/EGG-INFO/scripts
copying build/scripts-2.7/mdToRst -> build/bdist.macosx-10.13-x86_64/egg/EGG-INFO/scripts
changing mode of build/bdist.macosx-10.13-x86_64/egg/EGG-INFO/scripts/mdToRst to 755
copying mdToRst.egg-info/PKG-INFO -> build/bdist.macosx-10.13-x86_64/egg/EGG-INFO
copying mdToRst.egg-info/SOURCES.txt -> build/bdist.macosx-10.13-x86_64/egg/EGG-INFO
copying mdToRst.egg-info/dependency_links.txt -> build/bdist.macosx-10.13-x86_64/egg/EGG-INFO
copying mdToRst.egg-info/top_level.txt -> build/bdist.macosx-10.13-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/mdToRst-1.1.0-py2.7.egg' and adding 'build/bdist.macosx-10.13-x86_64/egg' to it
removing 'build/bdist.macosx-10.13-x86_64/egg' (and everything under it)
Processing mdToRst-1.1.0-py2.7.egg
Copying mdToRst-1.1.0-py2.7.egg to /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
Adding mdToRst 1.1.0 to easy-install.pth file
Installing mdToRst script to /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin

Installed /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mdToRst-1.1.0-py2.7.egg
Processing dependencies for mdToRst==1.1.0
Finished processing dependencies for mdToRst==1.1.0
simontekiMacBook-Pro:md2rst simon$ mdToRst README.md | tee README.rst
-bash: mdToRst: command not found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.