Skip to content
Falcion edited this page Apr 22, 2025 · 4 revisions

Like any other plugin, UNITADE depends on some files, in particular, on the config file. In the Obsidian system it is represented by the data.json file, and in the context of the UNITADE plugin only by it. This plugin does not interact with the file system in any way except for the Obsidian API and therefore, is guided only by this file.

The config, unlike the settings, has hidden fields, "static" (more on this terminology later) fields and other functional grouping.

Config structure

The order of the fields is equivalent to their visual arrangement in the settings (with only a few exceptions), and is divided into several blocks:

  • "external" settings, such settings that designate themselves and are in a "general group" (not to be confused with categories);
  • "nested" settings, they are complex objects and usually designate modules (even more often, they contain the enabled field);
    • nested settings are divided into several groups, which are defined by the functionality and documentation of the plugin:
      • mobile extensions group (designated as mobile_settings);
      • code editor module (designated as code_editor_settings);
      • status bar module (designated as status_bar), which contains a subgroup:
        • file extension registration (as registered_extensions);
  • "confuse" settings, they are hidden or system settings, there are only a few of them:
    • field errors of type Record<string, string>, which indicates errors and their cause (localized);
    • field SYS_FONTSIZE_MIN - static parameter of the minimum font size in the code editor view;
    • field SYS_FONTSIZE_MAX - static parameter of the maximum font size in the code editor view;

Note

Static fields are those config fields that are changed through the data.json config instance itself during subsequent force loading (calling the private loadData() method).

Static field advanced_silencing_errors is affiliated with other feature of UNITADE created and used only for development and advanced usage of Obsidian:
Silencing errors - global

If you don't know how Obsidian, plugin or just code works - do not touch this param under any circumstances.

Default instance of settings

From code's perspective, default settings look like this:

/**
 Where `UNITADE_SETTINGS` is an interface for plugin's settings
 */
export const DEFAULT_SETTINGS: UNITADE_SETTINGS = {
    markdown_overcharge: false,
    extensions: 'txt',
    is_case_insensitive: false,
    is_onload: false,
    is_onload_unsafe: false,
    forced_extensions: '',
    is_ignore: false,
    ignore_extensions: '',
    ignore_masks: '',
    is_grouped: false,
    grouped_extensions: '',

    mobile_settings: {
        enable: false,
        extensions: 'txt',
        stable: true,
    },

    barefiling: true,

    stable: true,
    errors: {},

    debug_mode: false,
    silence_errors: false,
    manifest_version: '',

    compatibility_module: true,
    safe_mode: true,

    code_editor_settings: {
        enabled: true,
        use_default_extensions: true,
        extensions: '',
        folding: true,
        line_numbers: true,
        word_wrapping: false,
        minimapping: true,
        validation_semantic: true,
        validation_syntax: true,
        theme: 'auto',
        force_vanilla_paste: false,
        enable_zoom: true,
        font_size: 14,
        font_family: "'Cascadia Code', 'Fira Code', Consolas, 'Courier New', monospace",
        font_ligatures: true,
    },

    SYS_FONTSIZE_MAX: 32,
    SYS_FONTSIZE_MIN: 5,

    status_bar: {
        enabled: true,
        registered_extensions: {
            enabled: false,
            include_extensions: true,
            include_extensions_grouped: true,
            include_code_editor_extensions: false,
        },
        registered_views: false,
        current_processor: true,
        current_display: true,
        cursor_position: true,
    }

    advanced_silencing_errors: {
        // This are additional signatures that user can silence
        signatures: "",
    }
}

Clone this wiki locally