A simple but powerful block-based Markdown editor built with Svelte and TypeScript. This project is an experiment in creating a Notion-like editing experience where each line or block (paragraph, heading, code block) is an independent unit. SvelteとTypeScriptで構築された、シンプルかつ強力なブロックベースのMarkdownエディタです。このプロジェクトは、各行やブロック(段落、見出し、コードブロックなど)が独立した単位として扱われる、Notionのような編集体験の実現を目指した実験的なものです。
textarea, allowing for focused editing.textareaとして編集できます。```javascript) that provide a dedicated multi-line editing area with a side-by-side, syntax-highlighted preview pane.```javascript)を作成すると、専用の複数行編集エリアと、シンタックスハイライトされたサイドバイサイドのプレビューペインが表示されます。Enter: Create a new line or split the current one. On an empty list item, it de-indents or removes the list marker.Backspace: At the beginning of a line, it merges with the line above.ArrowUp/ArrowDown: Navigate between lines.Tab/Shift+Tab: Indent and de-indent list items.Enter: 新しい行を作成または現在の行を分割します。空のリスト項目では、インデントを解除するかリストマーカーを削除します。Backspace: 行の先頭で押すと、前の行と結合します。ArrowUp/ArrowDown: 行間を移動します。Tab/Shift+Tab: リスト項目のインデントと解除を行います。Install dependencies: 依存関係をインストールします。
npm install
Run the development server: 開発サーバーを起動します。
npm run dev
Open your browser and navigate to the local server address provided (usually http://localhost:5173).
ブラウザで表示されたローカルサーバーのアドレス(通常 http://localhost:5173)にアクセスしてください。
src/App.svelte: The main application wrapper.src/TextEditor.svelte: The core component that manages all the lines and orchestrates the editing logic.src/lib/Line.svelte: A component representing a single line in the editor. It handles both the preview state and the editing state (textarea).textarea) の両方を扱います。src/lib/editor-utils.ts: A set of utility functions for rendering Markdown, parsing lines, etc.src/lib/types.ts: TypeScript type definitions for the project.