obsidian-releases
obsidian-releases copied to clipboard
added entry for obsidian-count-down
I am submitting a new Community Plugin
Repo URL
Link to my plugin: https://github.com/hamolicious/Obsidian-Count-Down
Release Checklist
- [x] I have tested the plugin on
- [x] Windows
- [x] macOS
- [x] Linux
- [x] Android (if applicable)
- [x] iOS (if applicable)
- [x] My GitHub release contains all required files
- [x]
main.js
- [x]
manifest.json
- [x]
styles.css
(optional)
- [x]
- [x] GitHub release name matches the exact version number specified in my manifest.json (Note: Use the exact version number, don't include a prefix
v
) - [x] The
id
in mymanifest.json
matches theid
in thecommunity-plugins.json
file. - [x] My README.md describes the plugin's purpose and provides clear usage instructions.
- [x] I have read the tips in https://github.com/obsidianmd/obsidian-releases/blob/master/plugin-review.md and have self-reviewed my plugin to avoid these common pitfalls.
- [x] I have added a license in the LICENSE file.
- [x] My project respects and is compatible with the original license of any code from other plugins that I'm using.
I have given proper attribution to these other projects in my
README.md
.
import moment from "moment"; You don't need to bring your own copy of moment, Obsidian already provides it.
declare global
Please don't do this, declaring global variables can lead to all kinds of problems.
You can just remove it, and use this.settings
in the one place where you access it.
this.registerMarkdownPostProcessor(async function (
You can just do this.registerMarkdownPostProcessor(countdownMarkdownPostProcessor);
// NOTE: figure out the way to add highlighting blocks
el.createEl("mark", {cls: "countdown-highlight", text: formatDiff(diff)});
would be my way to do this.
import moment from "moment"; You don't need to bring your own copy of moment, Obsidian already provides it.
fixed as of d237aaf
declare global Please don't do this, declaring global variables can lead to all kinds of problems. You can just remove it, and use this.settings in the one place where you access it.
fixed as of b11a497
this.registerMarkdownPostProcessor(async function ( You can just do this.registerMarkdownPostProcessor(countdownMarkdownPostProcessor);
fixed as of 1baf694
// NOTE: figure out the way to add highlighting blocks el.createEl("mark", {cls: "countdown-highlight", text: formatDiff(diff)}); would be my way to do this.
duly noted, this is not yet a priority but thank you very much. fixed as of not-yet
Hello hamolicious! 
I found the following errors in your plugin, Focus and Highlight:
:x: The newly added entry is not at the end, or you are submitting on someone else's behalf. Last plugin in the list is: nagi1999a/obsidian-focus-plugin
This check was done automatically.
Hello hamolicious!
I found the following errors in your plugin, Focus and Highlight:
❌ The newly added entry is not at the end, or you are submitting on someone else's behalf. Last plugin in the list is: nagi1999a/obsidian-focus-plugin
This check was done automatically.
this will be fixed when I am ready to merge
Hi, you might want to mention in the README that this transformation will only happen in Reading mode and not in live preview.
- if (!doesContainDate( nit: formatting here looks wrong. Looks like the indentation is off.
-
if (text[i] != ':') continue; should be
!==
-
.fromNow() you can change this to
fromNow(true)
and it will remove the "in " and " ago" parts of the string format. Then you can remove thereplace("in ", "")
line. -
el?.innerText No need for the
?
everywhere since you have already checked thatel
is not null -
for (let i = 0; i < el.innerText.length; i++) { This is a very inefficient way to find matches. I think you should take a look at how the Emoji Shortcodes plugin handles this (it's doing a very similar thing here: https://github.com/phibr0/obsidian-emoji-shortcodes/blob/83a9e4990bc8a87ff14a98ba0b54caa4426c6732/src/emojiPostProcessor.ts. You're basic process should be searching for the date (the same way you are in
doesContainDate
, then replacing that match with the moment string you generated. - null != text.match(/(:[0-9][0-9]/[0-9][0-9]/[0-9][0-9][0-9][0-9]:)/) You are hard coding the date format here. But you are also providing a setting for users do specify their own date format. This won't work.
@hamolicious Hi! Do you still intend to submit this plugin? Thanks!
@hamolicious Hi! Do you still intend to submit this plugin? Thanks!
No, sorry forgot to close, I need to iron out some bugs first and need to find the time to do that, will resubmit when I get a chance
@hamolicious Hi! Do you still intend to submit this plugin? Thanks!
No, sorry forgot to close, I need to iron out some bugs first and need to find the time to do that, will resubmit when I get a chance
Great, thanks for the update!