Skip to content

bruce3x/WriteMarkdownLazily

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WriteMarkdownLazily

This is a Python script which using for changing references of local image source files in Markdown file to urls.

中文版点我

Usage

  1. You need to install tinify package:

    pip install --upgrade tinify
    

    see TinyPNG – API Reference

  2. You need to install leancloud-sdk package:

    pip install leancloud-sdk
    

    or

    easy_install leancloud-sdk
    

    see LeanCloud Python Doc

  3. Input your api key in replace_image_in_md.py:

    TINY_API_KEY = "your_tiny_png_api_key"
    LEAN_CLOUD_API_ID = "your_lean_cloud_app_id"
    LEAN_CLOUD_API_KEY = "your_lean_cloud_api_key"

    get TinyPNG api key

    get LeanCloud api key & id

  4. Write your Markdown file and reference local image files:

    this is a image 
    ![](img/monkey.jpg)
    
  5. Use script:

    python replace_image_in_md.py your.md output.md
    

    then all local image files references will be replaced with urls of compressed image files.

Credits

Brucezz

License

Copyright 2016 Jaeger Chen

Licensed under the Apache License, Version 2.0 (the "License");	you may not use this file except in compliance with the License.
You may obtain a copy of the License at

	http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

This is a Python script which using for changing references of local image source files in Markdown file to urls.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%