To be honest, it's annoying to go back and forth between the browser and the terminal when creating a Qiita article & # x2026;
Therefore, a tool called qiita \ _org was created with the idea of solving everything by creating a Qiita article on the terminal.
With this, you can do everything from article creation to uploading more smoothly.
I wrote the various settings from the installation in detail in the article below, so please refer to that.
First, prepare a template to create an article.
> qiita template
Then you will be asked the following, so choose the one you like. I chose y for everything.
ProductName: macOS
ProductVersion: 11.1
BuildVersion: 20C69
cp /Users/[User name]/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/qiita_org-0.1.35/lib/qiita_org/template.org template.org
Write MacOS version?(y/n) y
Write ruby version?(y/n) y
When I displayed the contents of the current directory with the ls command, template.org was certainly created.
> ls .
-> template.org
Now let's take a look at the contents.
> cat template.org
#+OPTIONS: ^:{}
#+STARTUP: indent nolineimages
#+TITLE: title
#+AUTHOR: [Your Name]
#+EMAIL: (concat "[email protected]")
#+LANGUAGE: jp
# +OPTIONS: H:4 toc:t num:2
#+OPTIONS: toc:nil
#+TAG: tag1, tag2
#+TWITTER: off
# +SETUPFILE: ~/.emacs.d/org-mode/theme-readtheorg.setup
![macOS-11.1](https://img.shields.io/badge/macOS-11.1-brightgreen)![ruby-2.7.2p137](https://img.shields.io/badge/ruby-2.7.2p137-brightgreen)
Since it's a big deal, let's upload this template.org to Qiita.
The command to upload to Qiita is
> qiita post template.org
Immediately the following output comes out
#<CommandLine::Result:0x00007f8443922420 @stdout="", @stderr="", @status=#<Process::Status: pid 4887 exit 0>>
["qiita", "https://qiita.com/"]
["path", "api/v2/items"]
"https://qiita.com/api/v2/items"
"Created"
rendered_body brabrabra...
body brabrabra...
coediting false
comments_count 0
created_at 2020-12-28T20:44:04+09:00
group
id 48bd0edb7d39039fd8d1
likes_count 0
private true
reactions_count 0
tags [{"name"=>"tag2", "versions"=>[]}, {"name"=>"tag1", "versions"=>[]}]
title title
updated_at 2020-12-28T20:44:04+09:00
url https://qiita.com/[Your Qiita ID]/private/48bd0edb7d39039fd8d1
user {"description"=>"", "facebook_id"=>"", "followees_count"=>1, "followers_count"=>1, "github_login_name"=>"[Your Account]", "id"=>"[Your Qiita ID]", "items_count"=>1, "linkedin_id"=>"", "location"=>"", "name"=>"[Your Name]", "organization"=>"", "permanent_id"=>266153, "profile_image_url"=>"https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/266153/profile-images/1566019128", "team_only"=>false, "twitter_screen_name"=>nil, "website_url"=>""}
page_views_count
Switch to the default browser. For reference, put Result on your Mac.
At this time, as a caveat, the Qiita article is published as a limited share, so after doing the above method, click "Publish to the whole" from the article settings.
When uploading, type the command as follows.
> qiita post template.org public
About the command of qiita \ _org
Recommended Posts