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 Markdown File Links Plugin #8902

Closed
wants to merge 1 commit into from
Closed

Conversation

kevinfiol
Copy link
Contributor

@kevinfiol kevinfiol commented Mar 30, 2024

  • I'm the package's author and/or maintainer.
  • I have have read the docs.
  • I have tagged a release with a semver version number.
  • My package repo has a description and a README describing what it's for and how to use it.
  • My package doesn't add context menu entries. *
  • My package doesn't add key bindings. **
  • Any commands are available via the command palette.
  • Preferences and keybindings (if any) are listed in the menu and the command palette, and open in split view.
  • If my package is a syntax it doesn't also add a color scheme. ***
  • If my package is a syntax it is named after the language it supports (without suffixes like "syntax" or "highlighting").
  • I use .gitattributes to exclude files from the package: images, test files, sublime-project/workspace.

My package is Markdown File Links

There are no packages like it in Package Control.

Copy link
Collaborator

@packagecontrol-bot packagecontrol-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated testing result: SUCCESS

Repo link: Markdown File Links

Packages added:
  - Markdown File Links

Processing package "Markdown File Links"
  - All checks passed

@braver
Copy link
Collaborator

braver commented Apr 3, 2024

Interesting, looks useful 👍🏻

One thing I'd like to see is a command palette entry in addition to the context menu entry, to make it easy to use the functionality from the keyboard (and also to consistently have all functionality exposed via the palette).

Your is_markdown_file method looks for file extensions. That means that files without extension (that are configured to open as markdown, for instance some README files) are not recognized and the feature won't work there. Or maybe the user is using files with the md extension with a different syntax (I seem to remember more languages use that extension, although markdown is definitely more common). A more reliable way of checking the filetype or syntax of a file is to use match_selector(), passing it a 0,0 point (ie. the first position in the file) and matching for the text.html.markdown scope.

@braver braver added feedback provided mergeable The PR is in a mergeable state but awaiting some final comments/acknowledgement from either side labels Apr 3, 2024
@kevinfiol
Copy link
Contributor Author

Thanks for the feedback @braver

One thing I'd like to see is a command palette entry in addition to the context menu entry, to make it easy to use the functionality from the keyboard (and also to consistently have all functionality exposed via the palette).

How would you imagine this would work? The best thing that comes to mind is this flow:

  1. User left-clicks on a link so the cursor is currently "on" a link (like imagine the pipe is the cursor here [[hel|lo]])
  2. Open command pallete, and there should be an option to open the link

A more reliable way of checking the filetype or syntax of a file is to use match_selector(), passing it a 0,0 point (ie. the first position in the file) and matching for the text.html.markdown scope.

Can you give me an example of doing this? It's been pretty difficult for me in general to grok the Sublime plugin API 😅

@braver
Copy link
Collaborator

braver commented Apr 4, 2024

It's been pretty difficult for me in general to grok the Sublime plugin API

I can imagine, it's huge!

How would you imagine this would work

You could just, once the command is triggered, get the user's current selection, which is a set of regions, where there start and end of each region is a "point" similar to the cursor_point you're currently using. You could simply and naively take the first region and the starting point of that region.

Can you give me an example of doing this

@deathaxe
Copy link
Contributor

deathaxe commented Apr 7, 2024

The functionality of this plugin is more or less already part of MarkdownEditing. It's called "wiki links".

@kevinfiol
Copy link
Contributor Author

Thanks @deathaxe . I've been using your plugin for so long and had no idea this functionality was included already. I noticed it was buried at the bottom of the Usage page!.

Anyway, if it's preferable to close this PR, please proceed @braver

@braver
Copy link
Collaborator

braver commented Apr 19, 2024

Well we can always reconsider if the demand arises, but for now let’s close and not add something new to package control.

@braver braver closed this Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback provided mergeable The PR is in a mergeable state but awaiting some final comments/acknowledgement from either side
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants