Qiita - Article Management

Site: qiita|https://qiita.com

Get plain text:

curl -H "Accept: text/plain" https://jugoya.ai/guides/qiita/article-management

Overview

Create, edit, and publish articles on Qiita. Includes draft management, CodeMirror editor handling, and Advent Calendar integration for scheduled publishing.

Note: Replace {username} with your actual Qiita username in all URLs.

URLs

PageURLPurpose
New Drafthttps://qiita.com/drafts/newCreate new article
My Draftshttps://qiita.com/draftsList drafts
Edit Drafthttps://qiita.com/drafts/{draft_id}/editEdit existing draft
Edit Publishedhttps://qiita.com/{username}/items/{item_id}/editEdit published article
My Articleshttps://qiita.com/{username}Published articles

Critical Constraints

  • CodeMirror Editor: Body uses CodeMirror, not standard textarea. Requires JavaScript execution to set content reliably.
  • Tag Limit: Maximum 5 tags, space-separated
  • Image Upload: Manual only - drag & drop into editor
  • React State: Must trigger input event after setting content for React to detect changes

Workflow: Create New Article

1. Navigate to New Draft

Navigate to https://qiita.com/drafts/new

2. Input Title

Find the title textbox (placeholder: "タイトルを入力してください") and enter the article title.

3. Input Tags

Find the tags textbox (placeholder: "タグを入力してください。スペース区切りで5つまで") and enter tags separated by spaces.

Example: Python 機械学習 データ分析

4. Input Body (CodeMirror)

The body editor uses CodeMirror. To reliably set content:

  1. Target the .cm-content element
  2. Set textContent with the article body
  3. Dispatch an input event with {bubbles: true} for React to detect changes

JavaScript function pattern:

() => {
    const editor = document.querySelector('.cm-content');
    if (editor) {
        editor.textContent = "Your article content here";
        editor.dispatchEvent(new Event('input', {bubbles: true}));
        return 'success';
    }
    return 'editor not found';
}

5. Save Draft

Click the "下書き保存" button. Browser redirects to draft list after saving.

Publishing Options

Public Article (即時公開)

From draft edit page:

  1. Click "公開設定へ" button
  2. Ensure "公開範囲" is set to public
  3. Click "記事を投稿する"

Limited Sharing Article (限定共有記事)

  1. Click "公開設定へ" button
  2. Select "限定共有" from the "公開範囲" dropdown
  3. Click "記事を投稿する"

Result: Article gets a private URL https://qiita.com/{username}/private/XXXXX

Scheduled Publishing via Advent Calendar

Register a limited sharing article to an Advent Calendar for automatic publication at 7:00 AM on the scheduled day.

Rules:

  • Must register by the day before scheduled date
  • Articles posted after October 31, 2025 can be registered
  • Limited sharing articles can be registered regardless of post date

Workflow:

  1. Publish article as "限定共有記事" first
  2. Navigate to the Advent Calendar page
  3. Click the edit button for your scheduled day
  4. Enter the article URL in the URL field
  5. Click update button

Calendar Title Behavior: The title displayed in the calendar syncs from the article title. To change the displayed title, edit the article itself (not the calendar entry).

Editing Published Articles

URL Pattern

TypeURL Pattern
Drafthttps://qiita.com/drafts/{draft_id}/edit
Publishedhttps://qiita.com/{username}/items/{item_id}/edit

Workflow

  1. Navigate to the edit URL
  2. Wait for page to fully load (CodeMirror may take 1-2 seconds)
  3. Edit title, tags, or body as needed
  4. Click "公開設定へ" to open update modal
  5. Click "記事を更新する" to save changes

Key Differences from Draft

AspectDraftPublished
Save button下書き保存(auto-save, no button)
Publish button記事を投稿する記事を更新する

Page Structure Reference

New Draft Page Elements

ElementDescription
Title textboxPlaceholder "タイトルを入力してください"
Tags textboxPlaceholder "タグを入力してください。スペース区切りで5つまで"
Body editorCodeMirror editor, target .cm-content
下書き保存Save draft button
公開設定へOpen publish settings modal

Publish Settings Modal

ElementDescription
公開範囲Dropdown: public or "限定共有"
記事を投稿するPublish button (new articles)
記事を更新するUpdate button (existing articles)

Qiita Markdown Notes

Note Syntax

:::note info
Information note
:::

:::note warn
Warning note
:::

:::note alert
Alert note
:::

Math Formulas (MathJax)

Inline math: $\odot$ for element-wise product

Block math (for complex formulas):

```math
C_t = \underbrace{f_t \odot C_{t-1}}_{\text{古い記憶}}
```

Notes:

  • $$...$$ is NOT recommended (escape issues)
  • Complex formulas with \underbrace → use ```math
  • \text{} supports Japanese

Troubleshooting

IssueCauseSolution
Body not savedInput event not triggeredDispatch input event with {bubbles: true}
Page elements not foundPage not fully loadedWait 1-2 seconds after navigation
Tags not savedWrong formatUse space-separated, max 5 tags
公開範囲 not foundModal not openClick "公開設定へ" first