Active Plugin Info

linkWelcome to the Active Plugin Info Plugin!

Thank you for using the Active Plugin Info plugin, your go-to tool for understanding the active plugins in your Ample-note's note-taking environment. This plugin streamlines the process of tracking and reporting plugin configurations Options by extracting specific details from your notes. It organizes and displays your Active Plugin data into clear, actionable summaries, making it easier to stay on top of your workflows and plugin usage. Whether you're searching for options, documentation, or simply curious about your active plugins, this tool has you covered.


Designed with ease of use and flexibility in mind, this plugin automatically fetches and sorts your plugin-related notes, scans for key features or options, and generates both concise summaries and detailed reports. With timestamped reports, intuitive formatting, and integrated navigation, it’s perfect for those who want to keep their plugin management efficient and transparent. Dive into the notes generated by this plugin to unlock valuable insights and maintain full control over your note-taking ecosystem! More features are on its way.


linkDemo:

linkGeneral - Calling the Plugin - Active Plugin Info




linkDocumentation:

linkHow to Use

Set Up the Code: Add the code to the appropriate plugin or script location within the Ample note's environment.

Define Keywords: Update the searchWords array if additional plugin options need to be tracked.

Run the Function: Trigger the appOption using `ctrl+o` function. Ensure the app object is passed correctly.

Review Reports:

Navigate to the concise summary note for a quick overview.

Open the detailed report for in-depth plugin analysis.


linkTable - Plugin Parameters:

name

Active Plugin Info

icon

info

description

Get the List of Active Plugin Info + Its Available Options.
Active Plugin Info Docs

setting

Active Plugins List Note. [Do not Edit!]


linkCode Base:

{
async appOption(app) {
// Function to find specific words within code blocks in a markdown string
const findWordsInCodeBlocks = (markdown, words) => {
const codeBlockRegex = /```([\s\S]*?)```/g; // Matches code blocks enclosed by ```
const matches = [];
let match;
 
// Iterate through all code blocks
while ((match = codeBlockRegex.exec(markdown)) !== null) {
const codeContent = match[1]; // Extract content inside the code block
words.forEach(word => {
if (codeContent.includes(word)) {
matches.push(word); // Add the word if found in the code block
}
});
}
return matches;
};
 
// Plugin-related constants and search words
const notesGroup = "plugin";
const searchWords = [
"appOption", "dailyJotOption", "eventOption", "imageOption",
"insertText", "linkOption", "linkTarget", "noteOption",
"onEmbedCall", "renderEmbed", "replaceText", "taskOption"
];
 
// Generate a summary report for active plugins and their options
let pluginInfo = `## Active Plugins and Their Options\n\n`;
let notesGroupNames = new Set();
 
// Fetch notes in the specified group and sort them by name
const notesG = await app.filterNotes({ group: notesGroup });
notesG.sort((a, b) => a.name.localeCompare(b.name));
 
// Iterate through notes to extract and format plugin information
for (const noteHandleG of notesG) {
const noteName = noteHandleG.name || "Untitled Note";
const noteUUID = noteHandleG.uuid;
 
// Add note name to the group names
notesGroupNames.add(`- [${noteName}](https://www.amplenote.com/notes/${noteUUID})`);
 
// Extract content and find relevant words in code blocks
const markdown = await app.getNoteContent({ uuid: noteUUID });
const foundWords = findWordsInCodeBlocks(markdown, searchWords);
const formattedFoundWords = foundWords.map(word => ` - ${word}`).join("\n");
 
// Append plugin details to the report
pluginInfo += `### ${noteName}<!-- {"collapsed":true} -->\n`;
pluginInfo += `${formattedFoundWords}\n\n`;
}
 
// Finalize plugin info and group names
pluginInfo += `\n---`;
const results = Array.from(notesGroupNames);
const resultText = results.join("\n");
 
// Generate a timestamped filename
const now = new Date();
const YYMMDD = now.toISOString().slice(2, 10).replace(/-/g, '');
const HHMMSS = now.toTimeString().slice(0, 8).replace(/:/g, '');
const filename = `Active_Plugin_Info_${YYMMDD}_${HHMMSS}`;
 
// Create or update the Active Plugins List report note
const APLNoteName = `Active_Plugin_Info`;
const APLTagName = ['-reports/-active-plugin-info'];
const APLnoteUUID = await (async () => {
const existingUUID = await app.settings["Active Plugins List Note. [Do not Edit!]"];
if (existingUUID) return existingUUID;
const newUUID = await app.createNote(APLNoteName, APLTagName);
const noteHandle = await app.findNote({ uuid: newUUID });
await app.setSetting("Active Plugins List Note. [Do not Edit!]", noteHandle.uuid);
return noteHandle.uuid;
})();
 
// Update or create the report notes
await app.replaceNoteContent({ uuid: APLnoteUUID }, resultText);
const noteUUID = await app.createNote(`${filename}`, ["-reports/-active-plugin-info"]);
await app.replaceNoteContent({ uuid: noteUUID }, pluginInfo);
 
// Navigate to the new note
await app.navigate(`https://www.amplenote.com/notes/${noteUUID}`);
}
}
 

linkAdditional Information:


linkChange Log:

November 20th, 2024: Identified a need to understand how what all options a Active Plugins provide. Currently was able to identify the Options that Amplenote API provides, next would like to add what are all the options that each Amplenote API Options provide through the customized Plugin, or the Functions which these Options provide in the execution phase.


linkImplemented & Upcoming:

Utilized metadata code for groups - to get plugins.

Then for those notes searched the code, for the API Keywords using a function.

Then displaying them in a new note. Separate note is defined for the list of Active Plugins, and gets updated on each run.

Future Ideas in the Bucket:

Add the Detailed Options under the Amplenote Options.


Code Explanation! For Curious Readers and Explores! Thank you if you have made till here. You are Awesome, if you are reading this! 😀. Have a Great Day Ahead!


Time Invested For this Plugin: 2h 31m = 2h 31m [Not including the ideas popping up randomly when doing daily rituals, only Screen Time.]