README file from
GithubMaps of Content
This plugin provides a dynamic way to extract elements (like lists, tasks, headings, paragraphs, or blockquotes) from your Markdown files that match a specific word filter, automatically generating Map of Content (MOC) indexes in your vault.
It accomplishes this by adding a new moc markdown code block processor.
How to use
In any of your notes, add a code block with the language set to moc and provide a YAML-based configuration.
Here is an example:
Configuration Options
folder(required): The folder path within your vault to search for files. E.g.,DiaryorNotes/Meetings.element(required): The type of element to extract. Can be set toList,Task,Heading,Paragraph, orBlockquote.filter(required): The filter condition to apply to each element. Supported formats include:has_word("word")orcontains("text")orhas_text("text"): Matches elements containing the exact text.matches("regex"): Matches elements using a regular expression.has_tag("#tag"): Matches elements containing the specified tag.is_completed(): Matches only completed tasks (whenelementisTask).is_incomplete(): Matches only incomplete tasks (whenelementisTask).
recursive(optional): A boolean (trueorfalse) that determines whether the search should include subfolders within the specifiedfolder. If omitted, it defaults tofalse.
Result
The plugin will scan all markdown files in the specified folder. For any files containing elements that match your filter, it will dynamically render a section.
The rendered output includes:
- A header with a link back to the source file where the elements were found.
- The matching elements themselves.
Note: The original
moccode block is replaced in reading/preview mode with the dynamically generated content.