Skip to content

Plugins for editors/IDEs #7878

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

Open
3 of 7 tasks
EmilyGraceSeville7cf opened this issue Mar 11, 2022 · 13 comments
Open
3 of 7 tasks

Plugins for editors/IDEs #7878

EmilyGraceSeville7cf opened this issue Mar 11, 2022 · 13 comments
Labels
help wanted You can help make tldr-pages better! tooling Helper tools, scripts and automated processes.

Comments

@EmilyGraceSeville7cf
Copy link
Contributor

EmilyGraceSeville7cf commented Mar 11, 2022

List

  • Vim
    • comment: waiting somebody to integrate our linter to ALE
  • Emacs
    • author: @EmilySeville7cfg
    • comment: waiting other contributors to close help wanted issues
  • NeoVim
    • comment: waiting somebody to integrate our linter to NeoVim
  • Sublime Text
  • Visual Studio Code
    • author: @EmilySeville7cfg
    • comment: waiting other contributors to close help wanted issues
  • Intellij IDEA-compatible IDEs
  • Visual Studio

Minimal requirenments

Each plugin should at least highlight found errors via tldr-lint (or report them in another way, for instance just list them below the current TlDr page).

Advanced features

The following features are not necessary to be implemented:

  • snippets
  • code actions (to fix found errors or convert placeholders)
@CleanMachine1 CleanMachine1 added the help wanted You can help make tldr-pages better! label Mar 14, 2022
@blueskyson
Copy link
Member

Good idea.

@github-actions github-actions bot added the Stale label May 4, 2022
@pixelcmtd pixelcmtd added tooling Helper tools, scripts and automated processes. and removed Stale labels Jun 1, 2022
@EmilyGraceSeville7cf EmilyGraceSeville7cf changed the title Idea to develop VS Code plugin with for linting tl;dr pages automatically Idea to develop VS Code/Sublime Text plugin with for linting tl;dr pages automatically Jun 6, 2022
@EmilyGraceSeville7cf EmilyGraceSeville7cf changed the title Idea to develop VS Code/Sublime Text plugin with for linting tl;dr pages automatically Plugins for editors/IDEs Dec 15, 2022
@SethFalco
Copy link
Member

SethFalco commented Dec 15, 2022

How do you intend to match tldr pages though, or will you only support this repository? 🤔

For example, people can make their own pages, or may wish to just write the page in their editor and paste it into GitHub in the web editor. (So they have tldr pages, but not our repos structure.)

Since our files just have .md, not something like .tldr.md, there is little to separate them from any other Markdown files.

Could you define here what your expectations for such an extension are in the issue?

@EmilyGraceSeville7cf
Copy link
Contributor Author

EmilyGraceSeville7cf commented Dec 15, 2022

How do you intend to match tldr pages though, or will you only support this repository? thinking

I think by default all markdown files which are TlDr in our repo can be considered as TlDr pages (extension should check whether it is running in git repo and whether the current document is actually is TlDr page), but it should be customizable via some editor settings (via glob patterns). It should be possible to make extension interpret any markdown file as a TlDr page if user knows that it is.

@SethFalco
Copy link
Member

SethFalco commented Dec 15, 2022

So for example, in the case of VSC, you'd activate the extension with onLangauge:markdown?

If it's this repo, then hardcore that all *.md in pages* should be annotated by tldr-lint.
If it's not this repo, there should be a command in the command pallete to lint the currently open file? Or it's just going to process the file to determine if it's a page (though note this may be prone to false positives) and add the annotations from there?

Is that right?


If so, this sounds mostly alright but might be a bit much. I wonder is there a way to make do this lighter where it's just a configured in Prettier or ESLint, basically using established tools and extensions instead of making our own. 🤔

If you really want to take this approach though, then I think the best way would just be making a command that the user can execute manually and that's it. Someone who installs the plugin would know they have to do the command from the README, and it avoids making an extension which will activate and process files redundantly 99% of the time.

This also makes it to use with any arbitrary text or file format, not just .md.

Just some thoughts though, you can do what you want. I'm not saying your proposal is bad, I just personally like to minimize extension activation, and by the sounds of it, this will activate for every single workspace and process every Markdown file I open, when I know I only need it for the tldr repo.

Especially as it might be hard to accurately determine if Markdown content is a tldr page automatically. For example, when I start writing a Markdown file.

# my-readme

At this point it might look like a tldr page.

# my-readme

README process to process READMEs.

So how do you know if this is a separate project, vs me forgetting the quote block (>) in a tldr page? Even if you required more of the page boilerplate to be in place, that's still not the most reliable and will lead to lots of processing on the code-editor which might be meh.

I think manually triggering it is the only nice way to go. 🤔

Note, I'm mostly thinking about my own usage and sharing some thoughts. If you disagree with any of it, no worries.

@EmilyGraceSeville7cf
Copy link
Contributor Author

EmilyGraceSeville7cf commented Dec 15, 2022

So for example, in the case of VSC, you'd activate the extension with onLangauge:markdown?

Yes.

If it's this repo, then hardcore that all .md in pages should be annotated by tldr-lint.
If it's not this repo, there should be a command in the command pallete to lint the currently open file? Or it's just going to process the file to determine if it's a page (though note this may be prone to false positives) and add the annotations from there?

Is that right?

Right. :)

If you really want to take this approach though, then I think the best way would just be making a command that the user can execute manually and that's it.

As I don't know what's better and your suggestion is reasonable it means that this behavior can be made configurable too. For me it's better to lint pages automatically as TlDr project is the only one I heavily work with markdown.

@kbdharun
Copy link
Member

kbdharun commented Dec 15, 2022

I agree with @SethFalco. Automatic triggering on all markdown files would be troublesome and will conflict with markdown lint. How about triggering with a keyboard shortcut or key binding similar to other extensions?

Just be sure not to use these keybindings https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf.

I would suggest something like Ctrl + T + L (Or any possible key combination from this TL, DR, TR, TD but we need to ensure there won't be any conflicts in the key binding) as CTRL + T is already used for showing symbols.

@EmilyGraceSeville7cf
Copy link
Contributor Author

EmilyGraceSeville7cf commented Dec 15, 2022

How about triggering with a keyboard shortcut or key binding similar to other extensions?

Nice idea. 😄 (if this behavior can be customized) 😆

@SethFalco
Copy link
Member

SethFalco commented Dec 15, 2022

For me it's better to lint pages automatically as TlDr project

I agree doing it automatically is better, you can always find ways to improve one aspect of the UX if you're willing to degrade other aspects. I think the con of falsely doing it 99% of the time when it won't achieve anything is worse.

If you could come up with a way to do it automatically, with 100% certain you're doing it rightfully so, then cool.

But otherwise I think registering a command and shortcut is better. But once again, I'm just saying my own preferences.

@EmilyGraceSeville7cf
Copy link
Contributor Author

EmilyGraceSeville7cf commented Dec 17, 2022

@SethFalco, can you check this extension (if you are Emacs user)?

@SethFalco
Copy link
Member

I only use VSC and Vim. ^-^'

@kbdharun
Copy link
Member

kbdharun commented Dec 17, 2022

  • I only use (VSC) and Vim. ^-^'

Then can you check this out https://github.com/tldr-pages/tldr-code-extension?
PR: tldr-pages/tldr-code-extension#1

@EmilyGraceSeville7cf
Copy link
Contributor Author

I only use VSC and Vim. ^-^'

Do you wanna to develop TlDr linting plugin for Vim/Neovim? 😄

@EmilyGraceSeville7cf
Copy link
Contributor Author

I don't support TlDr project plugins anymore. Do with them what you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted You can help make tldr-pages better! tooling Helper tools, scripts and automated processes.
Projects
None yet
Development

No branches or pull requests

6 participants