Skip to content

Project to upload the rendered version of a Markdown file to a specified Google Drive Folder.

License

Notifications You must be signed in to change notification settings

raphaelrubrice/MD2GD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MD2GD (Markdown 2 Google Drive)

Project to upload the rendered version of a Markdown file (Markdown to PDF Converter) to a specified Google Drive Folder.

Table of Contents

Prerequisites

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

Installation

  1. Clone the Repository

    git clone https://github.com/raphaelrubrice/MD2GD.git
    cd MD2GD

    OR

    git clone [email protected]:raphaelrubrice/MD2GD.git
    cd MD2GD
  2. Run setup.sh

    bash setup.sh

You're all set :D ! See usage below.

Configuration

  1. 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.

Usage

  1. 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
  2. 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.

Troubleshooting

  • Common Issues:
    • If you encounter a FileNotFoundError for credentials.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.

Contributing

Feel free to submit issues and pull requests!

License

MIT License

About

Project to upload the rendered version of a Markdown file to a specified Google Drive Folder.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published