diff --git a/apps/client/src/widgets/type_widgets/content_widget.ts b/apps/client/src/widgets/type_widgets/content_widget.ts index 48f64735b..3283672a4 100644 --- a/apps/client/src/widgets/type_widgets/content_widget.ts +++ b/apps/client/src/widgets/type_widgets/content_widget.ts @@ -44,6 +44,7 @@ import { t } from "i18next"; import LanguageOptions from "./options/i18n/language.js"; import type BasicWidget from "../basic_widget.js"; import CodeTheme from "./options/code_notes/code_theme.js"; +import RelatedSettings from "./options/related_settings.js"; const TPL = /*html*/`
+
+`; + +interface RelatedSettingsConfig { + items: { + title: string; + targetPage: OptionPages; + }[]; +} + +const RELATED_SETTINGS: Record = { + "_optionsAppearance": { + items: [ + { + title: "Color scheme for code blocks in text notes", + targetPage: "_optionsTextNotes" + }, + { + title: "Color scheme for code notes", + targetPage: "_optionsCodeNotes" + } + ] + } +}; + +export default class RelatedSettings extends OptionsWidget { + + doRender() { + this.$widget = $(TPL); + + const config = this.noteId && RELATED_SETTINGS[this.noteId]; + if (!config) { + return; + } + + const $relatedSettings = this.$widget.find(".related-settings"); + $relatedSettings.empty(); + for (const item of config.items) { + const $item = $("
  • "); + const $link = $("").text(item.title); + + $item.append($link); + $link.attr("href", `#root/_hidden/_options/${item.targetPage}`); + $relatedSettings.append($item); + } + } + + isEnabled() { + return (!!this.noteId && this.noteId in RELATED_SETTINGS); + } + + async refreshWithNote(note: FNote | null | undefined) { + console.log("Got note ", note); + } + +} diff --git a/docs/Release Notes/Release Notes/v0.94.0.md b/docs/Release Notes/Release Notes/v0.94.0.md index 1fa332c77..37d2ddc00 100644 --- a/docs/Release Notes/Release Notes/v0.94.0.md +++ b/docs/Release Notes/Release Notes/v0.94.0.md @@ -34,6 +34,7 @@ * Added the GDScript (Godot) language. * Added the Nix language (and also in code blocks for text notes). * Mermaid diagrams: basic syntax highlight (not all diagram types are supported) and code folding. +* Slight organization in Appearance settings: code block themes are now in "Text Notes", added a "Related settings" section in Appearance. ## 📖 Documentation