NiklasRosenstein / pydoc-markdown

Create Python API documentation in Markdown format.
http://niklasrosenstein.github.io/pydoc-markdown/
Other
460 stars 105 forks source link

Convert README.md to ReST for PyPI #17

Closed NiklasRosenstein closed 7 years ago

NiklasRosenstein commented 7 years ago

Stolen from craftr-build/craftr

def readme():
  if os.path.isfile('README.md') and any('dist' in x for x in sys.argv[1:]):
    if os.system('pandoc -s README.md -o README.rst') != 0:
      print('-----------------------------------------------------------------')
      print('WARNING: README.rst could not be generated, pandoc command failed')
      print('-----------------------------------------------------------------')
      if sys.stdout.isatty():
        input("Enter to continue... ")
    else:
      print("Generated README.rst with Pandoc")

  if os.path.isfile('README.rst'):
    with open('README.rst') as fp:
      return fp.read()
  return ''
NiklasRosenstein commented 7 years ago

Actually, gotta reopen this. Even though it uses the converted RST content now, it's still rendered in plain text. Not sure why..

2017-05-27 12_30_57-pydoc-markdown 2 0 1 _ python package index