qiita \ _org is a gem that posts text written in emacs org-mode to Qiita. I created it based on the idea that it would be nice if cui could be used to create and post articles.
This article describes a usage example of qiita \ _org, how to install and initialize it. Please refer to https://qiita.com/yamatoken/items/9314161758e778fd82c0 for the command of qiita \ _org.
Note: Since command \ _line is used, please set the ruby version to 2.4.0 or higher. We also recommend emacs version 26.3 or higher.
In windows, we have confirmed the operation in the following environment.
However, please enter'n'on MacOS when executing qiita template.
First, get the post template of org-mode. Type'qiita template', decide whether to write the environment, and create template.org. ![img](// qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/612049/76dc9d92-3a77-5523-7a21-571f691402bb.png)
Then, such an org is created. ![img](// qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/612049/4a38e62f-9cae-1bf1-ee51-080706c64f6f.png)
Change the title and tag here to those for putting on qiita, and then just write the text as before.
Once the text is created, all you have to do is execute the posting command. When I try to post to the limited shared post, it looks like this. ![img](// qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/612049/3f7179f4-e150-7a63-b8ba-e936b925d7be.png)
It will appear sloppy, but if the settings are done properly, the posting will be completed and the page posted in Safari will open.
The posted article will show you in which directory the original org text is located as Source, which should be useful even if you want to edit a previous article. .. ..
gem install qiita_org
If qiita and the list of commands are displayed, the installation is completed successfully.
on mac
brew install pandoc
ubuntu
sudo apt update
sudo apt install pandoc
qiita config global
And create a configuration file in your home directory.
At https://qiita.com/settings/applications
Click'Issue a new token'for your personal access token. ![img](// qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/612049/de93b61e-b42d-8364-7282-ee1bdbd572ad.png)
Write a description of the access token, and check all the scopes as shown in the image. Then issue it. ![img](// qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/612049/7012077d-fba8-e823-d29c-dc93939b4d6b.png)
When the page moves, the access token is displayed in the personal access token, so copy it. (Please note that this character string cannot be displayed again when the page is moved.)
Return to the terminal and execute as follows.
qiita config global access_token 'your accesstoken'
Paste the access token you copied earlier in place of'your access token'.
qiita config global name 'your name'
qiita config global email 'your email'
It is necessary to use the option called'teams', so if you have a Qiita Team to which you belong, please do this setting. If not, you don't have to set it.
qiita config global teams_url 'https://foge.qiita.com/'
Be careful not to forget to add a'/' at the end of the URL.
See the article below for more information on ox-qmd. Reference: I made a package to export Qiita compliant Markdown from Org-mode
https://github.com/0x60df/ox-qmd ox-qmd.el'~ / .emacs.d / site Create it in \ _lisp'.
To put it in the PATH to emacs, add the following to init.el.
init.el
;;Set the location of el files
(setq load-path (cons "~/.emacs.d/site_lisp" load-path))
...
(require 'ox-qmd)
(add-to-list 'ox-qmd-language-keyword-alist '("ruby" . "ruby"))
If you belong to multiple Teams, or if you want to set an email address for each directory, you can specify a local configuration file.
In the directory where you want to create the configuration file
qiita config local set
And you can write in the same way as the above initial settings.
Recommended Posts