-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Feature: Description of timers and projects parsed as Markdown #122
base: master
Are you sure you want to change the base?
Feature: Description of timers and projects parsed as Markdown #122
Conversation
c019aae
to
179fa57
Compare
This is technically ready to ship. Considered out of scope:
|
179fa57
to
f8f6593
Compare
Published a pre-release version with all 2 features and 1 fix currently in PR! See 0.10.0+87c4156 for instructions on how to test! |
Cool feature! IMO I think this is a very niche option, as most users probably don't want raw Markdown syntax in their time entries (since it's not rendered anywhere outside of Obsidian) But I don't see any harm in releasing this since it's opt-in. I'll release it after doing some further testing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's still some minor concerns here, let me know if you want to iterate.
|
||
export const renderMarkdown = (markdown: string) => { | ||
const el = document.createElement("span"); | ||
MarkdownPreviewView.renderMarkdown(markdown, el, "", null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I'll have to find a way to pass the reference through the context, I think.
<span class="timer-description">{timer.description}</span> | ||
<span class="timer-description"> | ||
{#if $settingsStore.parseMarkdown} | ||
{@html renderMarkdown(timer.description)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This correctly renders the Markdown as a link, but clicking the link doesn't actually open the related page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's odd. I'll investigate.
<span> | ||
<span> | ||
{#if $settingsStore.parseMarkdown} | ||
{@html d.title ? renderMarkdown(d.title) : "(No project)"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if project titles should also be parsed as Markdown, only time entries make sense I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, I'll revert this bit and experiment with the suggestion below.
I have thought before to link projects to pages in the opposite direction, namely using the frontmatter of a note we can store to which Toggl project it is related. I think that makes the UX a little better for non-power users like yourself, what are your thoughts? |
Thanks for the review @mcndt! I had checked out for the past six months, focused on work. 😅 Linking projects to pages in the opposite direction makes sense! I can prototype something with it separately. I hadn't thought about that before. I also didn't like how it made the Toggl interface less usable. (And tinkering with user scripts to parse Markdown everywhere turned out to be a pointless task.) |
Feature
Interpret the description of time entries as Markdown. This enables using the description to link to project notes.
Before:
After:
Remaining work
Completed partially