-
Notifications
You must be signed in to change notification settings - Fork 20
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
Style note's title when note has a title value set #179
Comments
The main problem it that the Processor is applied to all features? Or I got it wrong? |
You are correct. To rephrase the feature request simply: I want an option to be able to visually detect when a file is displaying a rewritten title. |
If processor was realized like a template with option to set it individually for each feature, would it solve your problem? |
I don't understand, sorry. The goal is: If |
After the release of v2.7.0's #182 Processor pattern: With Using my new Common main template value, I don't think this FR is possible any more. There would need to be a way to trigger styling only if |
You can try to use processor in Function mode with the template var {
groups: {
icon,
t,
basename
},
} = title.match(new RegExp(`(?<icon>.*)\\((?<t>.*)\\)\\((?<basename>.*)\\)`));
console.log("icon = " + icon, "t = " + t, "bs = " + basename)
return `${icon}${t? t+ "*" : basename}` Remove console after test. It just for debugging. |
Console showed e.g. (I had to add a space on the last line to be exactly what I wanted: |
So, what else we should discuss in this issue? |
I am okay with simply adding an asterisk to the displayed titles via your useful function. It isn't however as straightforward as having an option: "Style titles when I don't know how useful others would find this, but I think it's useful being able to look at a note's UI title, without needing to inspect the frontmatter, to see that has been "renamed" via Thank you for your help! |
I put this topic on pause for now and come back after solving other issues. |
I've got the processor feature set to replace the title with the title plus an asterisk (e.g.
My note
->My note *
). This just helps me see that the file is indeed displaying its title and not the original filename. This is because one of my uses for the title is to add emojis to make things more visual (✏️ My note *
). The problem is that this processed title with the asterisk is also used for all link suggestions when the Suggest feature enabled, when I don't really want the asterisk in the Markdown document, only[[✏️ My note]]
.If there was an option to style the title using regex but only for rendering purposes, not for anything that is inserted into a document's source, that would overcome the issue. Or maybe titles could be styled using CSS across Obsidian according to some basic options: Color, italic, bold, etc. Anything that would help identify that I'm looking at a title, not a filename. The problem with CSS is that if Obsidian's theme changes, maybe the title styling would not suit, hence my initial suggestion of only using regex.
Thanks.
The text was updated successfully, but these errors were encountered: