[RUBY] Let's write a Qiita article in org-mode of Emacs !!

!macOS-11.1!ruby-2.7.2p137

Preface (Introduction)

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.

install

I wrote the various settings from the installation in detail in the article below, so please refer to that.

From creating a Qiita article to posting it

Qiita article creation

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) 

Upload article to Qiita

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

Reference material

About the command of qiita \ _org

Recommended Posts

Let's write a Qiita article in org-mode of Emacs !!
Let's create a TODO application in Java 4 Implementation of posting function
Spring Data JPA: Write a query in Pure SQL in @Query of Repository
Let's create a TODO application in Java 6 Implementation of search function
Let's create a TODO application in Java 8 Implementation of editing function
I made a gem to post the text of org-mode to qiita
Let's create a TODO application in Java 1 Brief explanation of MVC
Let's write a test code for login function in Spring Boot
Let's create a TODO application in Java 5 Switch the display of TODO
[Swift / Beginner] Let's write the functions around communication in a separate file
Acquisition of article information in ruby ​​scraping
The story of writing Java in Emacs
Write the movement of Rakefile in the runbook
I made a sample of how to write delegate in SwiftUI 2.0 using MapKit
Stuck in an enum in front of a blacksmith
Measure the size of a folder in Java
Let's create a custom tab view in SwiftUI 2.0
Let's create a super-simple web framework in Java
A quick review of Java learned in class
Create a native extension of Ruby in Rust
Let's write a proxy integrated Lambda function of Amazon API Gateway with Spring Cloud Function
Write a test by implementing the story of Mr. Nabeats in the world with ruby