Skip to content

Working with extensions

Falcion edited this page Mar 22, 2025 · 4 revisions

The UNITADE Code Editor module works with files in a manner similar to how UNITADE’s default extension core handles basic extensions (referred to here as "extensions-as-markdown"). Its primary functionality identifies the type of "code" you are editing based on file extensions and assigns a custom view (render) accordingly, meaning specific extensions have specific behaviors.

Warning

This page is closely related to a page on a similar topic, which may be helpful to review:
"Extensions"

The Code Editor module's native extension system (referred to here as "extensions-as-code") is distinct from the markdown extension system, yet operates under similar principles (using identical assignment methods), but instead applies them to the Monaco Editor view rather than markdown. While this process is familiar to the user, it involves several internal considerations:

  1. Do not repeat extensions from the extensions-as-markdown system — doing so may lead to crashes or failure in recognition.
  2. The extensions-as-code system is case-insensitive, so using too many combinations could consume extra resources (or even exhaust them). For more information:
  3. This mode assigns a codeview type of view to the extensions specified, allowing users to "implement" the Code Editor module even without directly using this mode by establishing a grouped extensions system. For details, see:

Extensions-as-markdown and extensions-as-code often compete over view assignments, which can result in visual conflicts, performance lags, or render nothing at all. To help users who want to apply their "default" markdown extensions exclusively within the Code Editor, a specific setting has been introduced.

Use Default Extensions

The "Use Default Extensions" mode, as the name suggests, enables extensions from the extensions-as-markdown feature block to replace the "markdown" render-view with a "codeview" render-view. This means any file listed in this setting will be displayed as code rather than in "Obsidian's Markdown Markup"^1.

Note

This setting is dynamic: enabling or disabling it updates the "render behavior" of files in real time, with no need for restarts, registry resets, or additional steps.

Minor Features

The extensions setting has minor features, or "hacks," like it was mentioned in the setting of "extensions as markown":

  1. If you type >> in the input, it will support files without extensions. In the plugin environment, these are called "barefiles," and their support is referred to as "barefiling." After this input, your Vault will accept files like data or config with no extensions.
  2. The input splitter for extensions trims extensions ONLY AT THE START, so you can include spaces to visually "separate" your inputs.
    • If the input is ' ' (or entered as > > by the user), it won't be trimmed and will remain the same.

Clone this wiki locally