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

Add plugin: NyanBar #3551

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Add plugin: NyanBar #3551

wants to merge 5 commits into from

Conversation

xhyabunny
Copy link

@xhyabunny xhyabunny commented May 20, 2024

I am submitting a new Community Plugin

Repo URL

Link to my plugin: https://github.com/xhyabunny/nyanbar

Release Checklist

  • I have tested the plugin on
    • Windows
    • macOS
    • Linux
    • Android (if applicable)
    • iOS (if applicable)
  • My GitHub release contains all required files
    • main.js
    • manifest.json
    • styles.css (optional)
  • 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)
  • The id in my manifest.json matches the id in the community-plugins.json file.
  • My README.md describes the plugin's purpose and provides clear usage instructions.
  • I have read the developer policies at https://docs.obsidian.md/Developer+policies, and have assessed my plugins's adherence to these policies.
  • I have read the tips in https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines and have self-reviewed my plugin to avoid these common pitfalls.
  • I have added a license in the LICENSE file. (https://github.com/xhyabunny/nyanbar/blob/master/LICENSE.md)
  • 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.

@github-actions github-actions bot changed the title Update community-plugins.json Add plugin: NyanBar May 20, 2024
@ObsidianReviewBot
Copy link
Collaborator

Thank you for your submission, an automated scan of your plugin code's revealed the following issues:

Required

[1][2][3][4][5][6][7][8][9][10][11][12][13][14][15][16][17][18][19][20][21][22][23][24][25][26][27][28][29][30] and more :You should avoid assigning styles via JavaScript or in HTML and instead move all these styles into CSS so that they are more easily adaptable by themes and snippets.

[1]:The command name should not include the plugin name.


Do NOT open a new PR for re-validation.
Once you have pushed all of the required changes to your repo, the bot will update the labels on this PR within 6 hours.
If you think some of the required changes are incorrect, please comment with /skip and the reason why you think the results are incorrect.

@ObsidianReviewBot ObsidianReviewBot self-assigned this May 21, 2024
@ObsidianReviewBot ObsidianReviewBot added Changes requested Additional review required PR needs to be reviewed by another person, after the currently requested changes have been made and removed Ready for review labels May 21, 2024
Copy link

Hello!

I found the following issues in your plugin submission

Errors:

❌ The newly added entry is not at the end, or you are submitting on someone else's behalf. The last plugin in the list is: mysticcoders/voicenotes-sync. If you are submitting from a GitHub org, you need to be a public member of the org.


This check was done automatically. Do NOT open a new PR for re-validation. Instead, to trigger this check again, make a change to your PR and wait a few minutes, or close and re-open it.

@xhyabunny
Copy link
Author

someone added their community plugin and ended up on a merge conflict, please fix.

@joethei
Copy link
Collaborator

joethei commented May 21, 2024

It will be fixed once your plugin is ready to be merged.

@xhyabunny
Copy link
Author

i am updating my plugin so it has styles.css, however 'width' style for some elements are not able to be placed in the CSS file because they are dynamic (not static) values changed with the script.

@xhyabunny
Copy link
Author

updated

@ObsidianReviewBot ObsidianReviewBot added Ready for review and removed Changes requested Additional review required PR needs to be reviewed by another person, after the currently requested changes have been made labels May 22, 2024
@ObsidianReviewBot ObsidianReviewBot removed their assignment May 22, 2024
@ObsidianReviewBot
Copy link
Collaborator

Changes requested by bot have been made, assigning human for additional review.

@joethei
Copy link
Collaborator

joethei commented May 22, 2024

Copyright (c) [year] [fullname]
Fill this.

"description": "Nyan Cat Progress Bar generator for Obsidian!",
Don't include "Obsidian" in the description, it should be obvious that this is a plugin for Obsidian.

function getCheckboxCompletionPercentage(view: MarkdownView): number {
You should not use the view here, any checkboxes that are outside the rendered area will not be counted.
Use:

this.registerMarkdownCodeBlockProcessor('xyz', async(source, el, ctx) => {
	if (!ctx.sourcePath) {
	    //codeblock rendered in page preview, no source path available.
	    return;
	}
	let checkedTasks = 0;
	let totalTasks = 0;
	for (const listItem of this.app.metadataCache.getCache(ctx.sourcePath).listItems) {
	    if(listItem.task) {
	        totalTasks++;
	        if(listItem.task === 'x') {
	            checkedTasks++;
	        }
	    }
	}
	//do the math
});

nyancat.src = 'https://raw.githubusercontent.com/xhyabunny/nyanbar/master/src/nyan-cat.gif', nyancat.src = 'https://raw.githubusercontent.com/xhyabunny/nyanbar/master/src/nyan-cat.gif', nyancat.src = 'https://raw.githubusercontent.com/xhyabunny/nyanbar/master/src/nyan-cat.gif', pusheencat.src = 'https://raw.githubusercontent.com/xhyabunny/nyanbar/master/src/pusheen-cat.gif', pusheencat.src = 'https://raw.githubusercontent.com/xhyabunny/nyanbar/master/src/pusheen-cat.gif', pusheencat.src = 'https://raw.githubusercontent.com/xhyabunny/nyanbar/master/src/pusheen-cat.gif'
This should be bundled into the code, not loaded externally.

this.addRibbonIcon('cat', 'NyanBar', () => {
This just clutters up the ribbon for no reason, remove it.

name: 'Add a Nyan Cat Bar',, name: 'Add a Pusheen Cat Bar',
Use sentence case in UI

class SettingTab extends PluginSettingTab {
Your plugin does not offer any settings, so remove the settings tab.

@joethei joethei added Changes requested Minor changes requested PR can be merged after some final changes have been requested and removed Ready for review labels May 22, 2024
@xhyabunny
Copy link
Author

xhyabunny commented May 22, 2024

if 'view: MarkdownView' isnt needed then theres no way for me to check for all the checkboxes on the note.. 😶
you said 'use' but sent something completely invisible.

Also i cant bundle images to the code, because the source folder is not something that comes with the release, unless you actually let me do that, i have changed the paths to access './' (root) the files but it wont work if that folder is not inside the plugin release, so thats on you.

i have made the other changes.

@xhyabunny
Copy link
Author

i added the files to the release as well.

@xhyabunny
Copy link
Author

btw bundled images arent working at all now.

@joethei
Copy link
Collaborator

joethei commented May 23, 2024

Oh, must have not pasted the code snippet, updated the message above.

As for bundling, this is what I mean: https://docs.obsidian.md/Themes/App+themes/Embed+fonts+and+images+in+your+theme, doing that process automatically (via a esbuild script for example) is called bundling.

@xhyabunny
Copy link
Author

aight i added the changes it should be working now.

@xhyabunny
Copy link
Author

hello?

@xhyabunny
Copy link
Author

ummm

@xhyabunny
Copy link
Author

i updated it.

@xhyabunny xhyabunny closed this Jun 17, 2024
@xhyabunny xhyabunny reopened this Jun 17, 2024
@xhyabunny
Copy link
Author

...

@xhyabunny
Copy link
Author

i give up thanks for not responding at all.

@xhyabunny xhyabunny closed this Jun 20, 2024
@joethei
Copy link
Collaborator

joethei commented Jun 21, 2024

This has not been fixed.

function getCheckboxCompletionPercentage(view: MarkdownView): number { You should not use the view here, any checkboxes that are outside the rendered area will not be counted. Use:

this.registerMarkdownCodeBlockProcessor('xyz', async(source, el, ctx) => {
	if (!ctx.sourcePath) {
	    //codeblock rendered in page preview, no source path available.
	    return;
	}
	let checkedTasks = 0;
	let totalTasks = 0;
	for (const listItem of this.app.metadataCache.getCache(ctx.sourcePath).listItems) {
	    if(listItem.task) {
	        totalTasks++;
	        if(listItem.task === 'x') {
	            checkedTasks++;
	        }
	    }
	}
	//do the math
});

@joethei joethei reopened this Jun 21, 2024
@xhyabunny
Copy link
Author

that thing does not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changes requested Minor changes requested PR can be merged after some final changes have been requested plugin
Projects
None yet
3 participants