Coder Social home page Coder Social logo

hexo-hackmd's Introduction

hexo-hackmd

This is a Hexo plugin for HackMD, it helps you simplify downloanding HackMD note to Hexo local environment.

How hexo-hackmd works

It copies all the content from a HackMD note, noticing that the title and tags of HackMD note will not be considered, you should write them in the content as mete data if you need.

It also downloads all images found in the content to local dir, where alt will be the file name of image. For example: ![alt text](https://hackmd.io/_uploads/XXX.png) will be saved as alt-text.png, and the url will be revised as /images/XXX.png if img_dir is not specified.

You should noticed that repetitive alt will cause images to be replaced.

How to use

Install

npm install hexo-hackmd

Config

Add hackmd_token in your hexo config:

hackmd_token: your_hackmd_token

You can issue your HackMD API token following this guide: How to issue an API token

Usage

hexo hackmd <url> <title>

url is the hackmd note url, it should be in the format: https://hackmd.io/<note_id>. title is the file name for post, for example, test title will be saved as test-title.md, this is arg is actually optional, if you do not specify a title, the dafault title is dafault-title.

Options

Default post_dir is source/_posts and img_dir is source/images, if you want to sepecify dirs, you can use options:

hexo hackmd <url> <title> -p <post_dir> -i <img_dir>

The dir can only start with source/.

Help

You can also find the usage guide with:

hexo help hackmd

hexo-hackmd's People

Contributors

mengchiehliu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.