Project to upload the rendered version of a Markdown file (Markdown to PDF Converter) to a specified Google Drive Folder.
List any software or libraries required before using the project:
- Python 3.x
- Required Python libraries:
google-api-python-client
google-auth-httplib2
google-auth-oauthlib
markdown
markdown2
weasyprint
-
Clone the Repository
git clone https://github.com/raphaelrubrice/MD2GD.git cd MD2GD
OR
git clone [email protected]:raphaelrubrice/MD2GD.git cd MD2GD
-
Run setup.sh
bash setup.sh
- Google Drive API Credentials
- Go to the Google Developers Console.
- Create a new project.
- Enable the Google Drive API for that project.
- Create OAuth 2.0 credentials and download the
credentials.json
file. - Place
credentials.json
in the project directory.
-
Run the Script
source ~/md2gd/bin/activate md2gd <path/to/your_markdown_file.md> <https://drive.google.com/drive/folders/your_folder_id> <path_to_credentials_file> <output_file_name> deactivate
- Replace
<path/to/your_markdown_file.md>
with the path to your Markdown file. - Replace
<https://drive.google.com/drive/folders/your_folder_id>
with the link to the Google Drive folder where you want to upload the PDF. - Replace
<path_to_credentials_file>
with the actual path to your credentials.json file - Replace
<output_file_name>
with the desired output name
- Replace
-
Authentication
- The first time you run the script, it will prompt you to authenticate with your Google account. Follow the on-screen instructions to grant access.
- Common Issues:
- If you encounter a
FileNotFoundError
forcredentials.json
, make sure the file is in the project directory. - If you see a Google API error, ensure the Drive API is enabled for your project in the Google Developers Console.
- If you encounter a
Feel free to submit issues and pull requests!
MIT License