The Codeblog CLI lets you write React.js components and use them on Codeblog. When you publish a component on Codeblog, anyone else can use it immediately.
Code from your local development environment and debug/test it on https://codeblog.com/write. Codeblog will automatically reload your component as you edit it in your local text editor.
When you're ready to show it to other people, run
codeblog publish and other people will be able to see and use your component.
Publishing components on Codeblog is a really easy way to make stuff and show people.
Before we get started, you'll need to you have Node.js (v8+) installed.
To install the CLI, run the following command in your terminal
npm install -g codeblog
codeblog new HelloCodeblog
After you enter a filename, this will create two files in the current directory:
The first file is your code. The second file is the metadata required for Codeblog to know how to use your component. You might not need to mess with the second file.
Immediately after creating the files, it will open the files in your text editor and then run codeblog dev for you, kicking off the development server.
To launch the dev server, run this command:
This launches a dev server with instant code reloading. You develop in your local code editor, and it shows up on https://codeblog.com/write.
Note: if you don't publish your components, they won't show up for anyone other than you.
To publish your components, run this command:
codeblog publish HelloCodeblog
This will make your component show up on search and show your name as the author.
The source code for your component will be published on GitHub. For example, here's the source code for the code snippet component.