Skip to content

Instantly share code, notes, and snippets.

@shdwkl
Created September 10, 2021 01:24
Show Gist options
  • Select an option

  • Save shdwkl/fcb1b2303c42b586050a3988d73e4325 to your computer and use it in GitHub Desktop.

Select an option

Save shdwkl/fcb1b2303c42b586050a3988d73e4325 to your computer and use it in GitHub Desktop.
Conver and <FILE>.rst into <FILE>.md
import os
import click
@click.command()
@click.option('--file', '-f', help='RST file to convert into Markdown. ')
def file_convert(file):
click.echo(f'Converting {file}....')
click.echo(f"Check Your dirictory for {str(file).replace('rst','md')}")
os.mkdir('created')
os.system(f"pandoc {file} -f rst -t markdown -o ./created/{file}.md")
if __name__ == '__main__':
file_convert()
@shdwkl
Copy link
Copy Markdown
Author

shdwkl commented Sep 10, 2021

It's Working on my machine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment