Skip to content

fiddus/markdown-gist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Markdown WordPress Post With Gist Code Blocks

This project is intend to replace code blocks from markdown to github gist code blocks in a WordPress post.

To use this project you will need to have NodeJS, a GitHub token, a working WordPress account, and the oEmbed Gist plugin

Right now it is working just for GitHub Flavored Markdown syntax.

Usage

  1. Clone this repo

     git clone git@github.com:fiddus/markdown-gist.git
    
  2. Create a .configs file with the follow content

     {
         "github": {
             "type": "oauth",
             "token": "insert your token here"
         }
     }
    
  3. Now execute the file with the markdown file with code blocks you want to display github blocks

     node main.js <file.md>
    

Test if it worked

node main.js spec/helpers/test.md

If every thing went well, you get some answer like this on your console

****************************************************************
*** Your file has been generated.
*** Copy the text between dashed lines
****************************************************************
----------------------------------------------------------------
# Lets See

https://gist.github.com/<user>/798316497939f203a323#file-test-0-js

## Other html

https://gist.github.com/<user>/798316497939f203a323#file-test-1-html

End of File
---

----------------------------------------------------------------

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published