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 o2 plugin #1678

Merged
merged 5 commits into from
Feb 27, 2023
Merged

add o2 plugin #1678

merged 5 commits into from
Feb 27, 2023

Conversation

songkg7
Copy link
Contributor

@songkg7 songkg7 commented Feb 20, 2023

I am submitting a new Community Plugin

Repo URL

Link to my plugin: o2

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 tips in https://github.com/obsidianmd/obsidian-releases/blob/master/plugin-review.md 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.

@joethei
Copy link
Collaborator

joethei commented Feb 24, 2023

id: 'o2-converting',
Obsidian will automatically prefix the command id with the plugin id,
you don't need to include it yourself.

// If the plugin hooks up any global DOM events (on parts of the app that doesn't belong to this plugin)
Remove these

As an aside not using semicolons in JavaScript/TypeScript code can lead to rare, hard to debug issues, here is a pretty good article about it:
https://flaviocopes.com/javascript-automatic-semicolon-insertion

@songkg7
Copy link
Contributor Author

songkg7 commented Feb 24, 2023

@joethei As you advised, I deleted unnecessary code and modified .eslintrc to use semicolons. Thank you for your kindness.

@liamcain
Copy link
Collaborator

  • converting the command name here should be more specific. Like "convert to Jekyll"
  • O2Modal you can remove this
  • copyToPublishedDirectory I don't understand why this is happening at the beginning of this function. Shouldn't the output files be what ends up in the published directory instead of a copy of the original files? Or are these just backup files?
  • this.app this - you're not inside a class scope so this is referring to the global scope. It's highly discouraged that you use the global app instance in your plugin. It's currently accessible from the global context for debugging purposes, and might be removed in the future. Instead, you should use plugin.app
  • In general I think your plugin is lacking some more usage instructions and information in the readme and in settings. The usage of "Ready directory" and "Published directory" is unclear to me and likely will be to users.

@songkg7
Copy link
Contributor Author

songkg7 commented Feb 26, 2023

@liamcain

  • converting the command name here should be more specific. Like "convert to Jekyll"

Exactly. The name was quite improvised. I forgot to change this.

removed.

  • copyToPublishedDirectory I don't understand why this is happening at the beginning of this function. Shouldn't the output files be what ends up in the published directory instead of a copy of the original files? Or are these just backup files?

Even after publishing the note, I wanted to be able to read it inside the obsidian, so I needed to copy it to a specific folder. However, I agreed with you that this process was confusing because it existed before the conversion began, not after the publication. So I changed it to the form of backup.

  • this.app this - you're not inside a class scope so this is referring to the global scope. It's highly discouraged that you use the global app instance in your plugin. It's currently accessible from the global context for debugging purposes, and might be removed in the future. Instead, you should use plugin.app

Modified to use plugin.app.

  • In general I think your plugin is lacking some more usage instructions and information in the readme and in settings. The usage of "Ready directory" and "Published directory" is unclear to me and likely will be to users.

I changed the description of 'README.md' file and 'setting' more specifically.

I have incorporated most of the requirements you proposed, in 1.1.0. Developing the Obsidian plugin and working with TypeScript are both very new to me. However, your review has been very specific, and it has been a great help for my learning. Many thanks.

@liamcain liamcain merged commit 3009835 into obsidianmd:master Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants