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
| Page | URL | Purpose |
|---|---|---|
| New Draft | https://qiita.com/drafts/new | Create new article |
| My Drafts | https://qiita.com/drafts | List drafts |
| Edit Draft | https://qiita.com/drafts/{draft_id}/edit | Edit existing draft |
| Edit Published | https://qiita.com/{username}/items/{item_id}/edit | Edit published article |
| My Articles | https://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
inputevent 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:
- Target the
.cm-contentelement - Set
textContentwith the article body - Dispatch an
inputevent 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:
- Click "公開設定へ" button
- Ensure "公開範囲" is set to public
- Click "記事を投稿する"
Limited Sharing Article (限定共有記事)
- Click "公開設定へ" button
- Select "限定共有" from the "公開範囲" dropdown
- 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:
- Publish article as "限定共有記事" first
- Navigate to the Advent Calendar page
- Click the edit button for your scheduled day
- Enter the article URL in the URL field
- 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
| Type | URL Pattern |
|---|---|
| Draft | https://qiita.com/drafts/{draft_id}/edit |
| Published | https://qiita.com/{username}/items/{item_id}/edit |
Workflow
- Navigate to the edit URL
- Wait for page to fully load (CodeMirror may take 1-2 seconds)
- Edit title, tags, or body as needed
- Click "公開設定へ" to open update modal
- Click "記事を更新する" to save changes
Key Differences from Draft
| Aspect | Draft | Published |
|---|---|---|
| Save button | 下書き保存 | (auto-save, no button) |
| Publish button | 記事を投稿する | 記事を更新する |
Page Structure Reference
New Draft Page Elements
| Element | Description |
|---|---|
| Title textbox | Placeholder "タイトルを入力してください" |
| Tags textbox | Placeholder "タグを入力してください。スペース区切りで5つまで" |
| Body editor | CodeMirror editor, target .cm-content |
| 下書き保存 | Save draft button |
| 公開設定へ | Open publish settings modal |
Publish Settings Modal
| Element | Description |
|---|---|
| 公開範囲 | 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
| Issue | Cause | Solution |
|---|---|---|
| Body not saved | Input event not triggered | Dispatch input event with {bubbles: true} |
| Page elements not found | Page not fully loaded | Wait 1-2 seconds after navigation |
| Tags not saved | Wrong format | Use space-separated, max 5 tags |
| 公開範囲 not found | Modal not open | Click "公開設定へ" first |