Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: you can now edit the render toggle key #144

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifest.json
@@ -1,7 +1,7 @@
{
"id": "aprils-automatic-timelines",
"name": "April's Automatic Timelines",
"version": "0.13.1",
"version": "0.13.2",
"minAppVersion": "0.15.0",
"description": "Simple timeline generator for story tellers",
"author": "April Gras",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "obsidian-auto-timelines",
"version": "0.13.1",
"version": "0.13.2",
"description": "This Obsidian (https://obsidian.md) plugin aims to simplify creating and maintaining timelines in different a project",
"main": "main.js",
"type": "module",
Expand Down
8 changes: 1 addition & 7 deletions src/cardData.ts
Expand Up @@ -8,11 +8,6 @@ import {
getTagsFromMetadataOrTagObject,
} from "./cardDataExtraction";

/**
* A un-changeable key used to check if a note is eligeable for render.
*/
const RENDER_GREENLIGHT_METADATA_KEY = ["aat-render-enabled"];

/**
* Provides additional context for the creation cards in the DOM.
*
Expand All @@ -28,8 +23,7 @@ export async function getDataFromNoteMetadata(
const { frontmatter: metaData, tags } = cachedMetadata;

if (!metaData) return undefined;
if (!RENDER_GREENLIGHT_METADATA_KEY.some((key) => metaData[key] === true))
return undefined;
if (metaData[settings.eventRenderToggleKey] !== true) return undefined;

const timelineTags = getTagsFromMetadataOrTagObject(
settings,
Expand Down
2 changes: 2 additions & 0 deletions src/locales/en.json
Expand Up @@ -65,6 +65,7 @@
"dateFontSize": "Override the font size of the date in the timeline cards (value in pixels)",
"titleFontSize": "Override the font size of the title in the timeline cards (value in pixels)",
"bodyFontSize": "Override the font size of the body in the timeline cards (value in pixels)",
"eventRenderToggleKey": "Render toggle key",
"configureSingleDateToken": {
"type": "The type of the token",
"conditionalFormatting": "Add additional formatting"
Expand Down Expand Up @@ -106,6 +107,7 @@
"lookForInlineEventsInNotes": "Check {linkText} on how to create inline events.",
"applyAdditonalConditionFormatting": "Toggle on to allow date tokens conditional formatting to be allowed. When set to false this feature will be skipped. This could save you a few milliseconds off every card render.",
"stylizeDateInline": "Turn on for a more compact display in your timeline event cards. Or turn off for more space.",
"eventRenderToggleKey": "The key used to control if a perculiar event is rendered or not",
"configureSingleDateToken": {
"STRING": "A string typed date token represents something akin to our months. tl;dr, they are written using letter and not numbers",
"NUMBER": "A numerical typed date token is your stardard number representing a date. Just make sure to configure it's mininal lengh. For example a minimal length set to 2 will result in the 6th day being written as \"06\""
Expand Down
2 changes: 1 addition & 1 deletion src/markdownBlockData.ts
Expand Up @@ -51,7 +51,7 @@ export const acceptedSettingsOverride = [
"dateFontSize",
"titleFontSize",
"bodyFontSize",
] as const;
] satisfies (keyof AutoTimelineSettings)[];

/**
* Checks if a given string is part of the settings keys that can be overriden.
Expand Down
1 change: 1 addition & 0 deletions src/settings.ts
Expand Up @@ -21,6 +21,7 @@ export const SETTINGS_DEFAULT = {
dateDisplayFormat: "{day}/{month}/{year}",
dateParserGroupPriority: "year,month,day",
dateParserRegex: "(?<year>-?[0-9]*)-(?<month>-?[0-9]*)-(?<day>-?[0-9]*)",
eventRenderToggleKey: "aat-render-enabled",
inlineEventEndOfBodyMarker: "%%aat-event-end-of-body%%",
markdownBlockTagsToFindSeparator: ",",
metadataKeyEventBodyOverride: "aat-event-body",
Expand Down
1 change: 1 addition & 0 deletions src/views/VSettings.vue
Expand Up @@ -28,6 +28,7 @@ const generalSettingKeys = [
"markdownBlockTagsToFindSeparator",
"noteInlineEventKey",
"inlineEventEndOfBodyMarker",
"eventRenderToggleKey",
] satisfies (keyof PickByType<AutoTimelineSettings, string>)[];

const fantasyCalendarPreset: Record<
Expand Down
3 changes: 2 additions & 1 deletion versions.json
Expand Up @@ -38,5 +38,6 @@
"0.12.1": "0.15.0",
"0.12.2": "0.15.0",
"0.13.0": "0.15.0",
"0.13.1": "0.15.0"
"0.13.1": "0.15.0",
"0.13.2": "0.15.0"
}