Last active
June 26, 2023 16:27
-
-
Save oguna/9683208 to your computer and use it in GitHub Desktop.
Github APIを用いてMarkdownをHTMLに変換するPythonスクリプト
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
| #!/usr/bin/env python | |
| # this script on only PYTHON3 | |
| import urllib.request | |
| import urllib.parse | |
| with open('index.md','br') as file: | |
| data = file.read() | |
| request = urllib.request.Request('https://api.github.com/markdown/raw') | |
| request.add_header('Content-Type','text/plain') | |
| f = urllib.request.urlopen(request,data) | |
| with open('index.html','bw') as file: | |
| file.write(f.read()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment