Created
September 10, 2021 01:24
-
-
Save shdwkl/fcb1b2303c42b586050a3988d73e4325 to your computer and use it in GitHub Desktop.
Conver and <FILE>.rst into <FILE>.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's Working on my machine