Repository navigation
Conversation
ノート作成時にサーバーが %%command ...%% を展開する仕組みを追加する。 サードパーティのクライアントからも使え、結果は本文のテキストとして連合する。 - 記法の解析と実行 (packages/backend/src/devuloper/note-commands) - 投稿フォームのボタンとプレビュー (packages/frontend/src/devuloper/note-commands) - コマンド: rand.dice / rand.choose / rand.num / rand.omikuji、font.*、progress、calc、unit、time、banner Closes #6, #11, #15, #16, #19, #20, #21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
ノート作成時にサーバーが
%%command ...%%を展開する仕組み (#6) と、テキストを返すコマンドを追加する。%%name.sub key:value メイン引数 文章%%。全角の%%、:、|、全角スペースも同じ扱い。コードブロックとインラインコードの中は処理しない。本文に%%を書くときは\%\%NOTE_COMMAND_FAILED(400) で投稿を拒否し、理由を日本語で返すnotes/createと予約投稿の両方で動く (NoteCreateService.fetchAndCreateの先頭で展開)。リモートのノートには影響しないdevuloper/note-commands/previewで結果をプレビューしてから記法を挿入する。選択中のテキストは入力欄の初期値になり、挿入時に置き換わる。ボタンからタイムゾーンなどの設定も保存できる (registry のclient/devuloper)rand.dicerand.chooserand.numrand.omikujifont.boldfont.italicfont.bolditalicfont.scriptfont.frakturfont.doublefont.sansfont.monofont.circlefont.flipprogresscalcunittimebannerCloses #6, #11, #15, #16, #19, #20, #21
Why
サードパーティのクライアントからも使え、結果が標準のテキストとして連合する機能を、共通の仕組みの上に作るため。
Additional info (optional)
packages/backend/src/devuloper/とpackages/frontend/src/devuloper/にまとめた。upstream のファイルの変更は、NoteCreateService(3行)、CoreModule(3行)、endpoint-list.tsの末尾 (1行)、MkPostForm.vue(2行) だけlocalesに入れず、フォークのファイルに日本語で書いた。misskey-js の autogen も再生成していない (フロントエンドは型なしで呼ぶ)kindはserverにしている。clientだとApiCallServiceがメッセージをWWW-Authenticateヘッダーに入れ、日本語で 500 になるためcrypto.randomInt。サイコロは 100 個、1000 面まで。timeの入力は既定で Asia/Tokyo、夏時間で存在しない時刻は切り替え後、重複する時刻は先の方。$[unixtime]は他のサーバーで生の文字列になるので付けない。bannerは半角英数字だけで横幅 48 文字まで。calcはevalを使わない自前のパーサー。通貨の換算はしないnotes/createとプレビューを実行し、展開とエラー応答を確認したChecklist