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: Header Counter #3537

Merged
merged 2 commits into from
May 29, 2024
Merged

Add plugin: Header Counter #3537

merged 2 commits into from
May 29, 2024

Conversation

nancyel
Copy link
Contributor

@nancyel nancyel commented May 17, 2024

I am submitting a new Community Plugin

Repo URL

Link to my plugin: https://github.com/nancyel/header-counter

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.
  • 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.

Copy link

Hello!

I found the following issues in your plugin submission

Errors:

❌ Could not parse community-plugins.json, invalid JSON. Unexpected token } in JSON at position 426479


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.

@ObsidianReviewBot
Copy link
Collaborator

The automated review has not found any issues with your code, assigning human for additional review.

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: rooyca/query-json. 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.

@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 21, 2024
Copy link

Hello!

I found the following issues in your plugin submission

Errors:

❌ Your latest Release is missing the main.js file.
❌ Your latest Release is missing the manifest.json file.


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.

@nancyel
Copy link
Contributor Author

nancyel commented May 23, 2024

Thanks for the detailed feedback! The code has been updated

@ObsidianReviewBot ObsidianReviewBot added Ready for review Changes made and removed Changes requested Minor changes requested PR can be merged after some final changes have been requested labels May 23, 2024
@joethei
Copy link
Collaborator

joethei commented May 27, 2024

showRibbonIcon: boolean;, showRibbonIcon: true,, if (this.settings.showRibbonIcon) {, new Setting(this.containerEl)
As of v1.1.0 of Obsidian, the ribbon can be customized within Obsidian. So users can choose what items to include and in what order all in one place. Because of this, we're recommending that new plugins avoid introducing their own toggles for ribbon items.

if (checking) {, if (checking) {
This code is still useless, better would be:

const view = this.app.workspace.getActiveViewOfType(MarkdownView);
if (checking) {
	return !!view;
}

And then pass that view reference into the function below.

if (!(view instanceof MarkdownView)) {, if (!(view instanceof MarkdownView)) {
This also serves no purpose, it's already guaranteed to be a MarkdownView because of the line above.

new Notice(Header Summary: ${JSON.stringify(headerSummary)});
Use sentence case in UI

this.containerEl.createEl("h2", { text: "Settings" });
Please don't use a settings header line this, see the guidelines: Only use headings under settings if you have more than one section.

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

nancyel commented May 28, 2024

Thanks again for the feedback with links! Changes have been made.

@ObsidianReviewBot ObsidianReviewBot added Ready for review Changes made and removed Changes requested Minor changes requested PR can be merged after some final changes have been requested labels May 28, 2024
@joethei
Copy link
Collaborator

joethei commented May 28, 2024

const view = this.app.workspace.getActiveViewOfType(, const view = this.app.workspace.getActiveViewOfType(
As mentioned before, you should pass in the view instance you have from the command instead of retrieving it here.

new Setting(this.containerEl).setName("Header counter").setHeading();
I also mentioned twice already that there should not be a header here.
Don't include a header with the plugin name in the settings

@joethei joethei added Changes requested Minor changes requested PR can be merged after some final changes have been requested and removed Ready for review Changes made labels May 28, 2024
@ObsidianReviewBot ObsidianReviewBot added Ready for review Changes made and removed Changes requested Minor changes requested PR can be merged after some final changes have been requested labels May 29, 2024
@joethei joethei merged commit 24d7a31 into obsidianmd:master May 29, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants