Skip to content

Commit

Permalink
chore(codebase): mark apply method within JSDocs and //!
Browse files Browse the repository at this point in the history
  • Loading branch information
Falcion committed Oct 22, 2024
1 parent 7a38b2c commit 270eac2
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions source/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,32 @@ export default class UNITADE_PLUGIN extends Plugin {
this.__apply();
}

//! MAIN METHOD OF ENTIRE PLUGIN:
//! Configures and applies everything from the settings.
/**
* This method configures and applies the settings for grouped extensions, mobile settings,
* and forced extensions in the UNITADE plugin. It parses and applies configurations based on
* the current plugin settings. The method works differently for grouped extensions, mobile extensions,
* and forced extensions, handling each case according to the settings provided by the user.
*
* ### Grouped Extensions:
* If the `is_grouped` setting is enabled, it parses the `grouped_extensions` string into key-value pairs
* where each key is a view (such as 'markdown', 'pdf') and each value is an array of extensions. The method
* applies these configurations for each view by calling `__applyCfg`.
*
* ### Mobile Settings:
* If the plugin is running in a mobile environment (`is_mobile` is true), the mobile extensions are configured.
* It applies either the mobile-specific extensions or falls back to the default extensions, then configures
* the 'markdown' view for those extensions.
*
* ### Forced Extensions:
* The method also processes forced extensions, registering custom views for each forced extension defined
* in the settings. If an error occurs during this registration, it logs the error in the `errors` object and
* optionally displays a notification or logs a debug message if `silence_errors` is enabled.
*
* @private
* @returns {void}
*/
private __apply(): void {
if (this.settings.is_grouped) {
const data: { [key: string]: string[] } = parsegroup(this.settings.grouped_extensions);
Expand Down

0 comments on commit 270eac2

Please sign in to comment.