codythegreat / dss

Dead Simple Slides - A terminal based presentation tool with Vim style keybindings
MIT License
54 stars 3 forks source link

URL Detection and Selection #38

Closed codythegreat closed 4 years ago

codythegreat commented 4 years ago

URLs

URL handling will be done with markdown style formatting [title](www.webpage.com)

When dss detects the above format, it'll store the website url to the slide struct, and format the slide to print [n]title whereas n is the link number (in the case of a single link, this would be 0.

If a user presses l followed by the link number the webpage will be opened in the default browser.

amagura commented 4 years ago

We could use something like cmark to parse each slide.

codythegreat commented 4 years ago

We could use something like cmark to parse each slide.

Interesting. I'll read up on that repo some more. Perhaps that can aid us in the markdown parsing mode as well.

codythegreat commented 4 years ago

commit e342d937d5d04b24ff5faeba592b0f769418561e and ee321f909bbd285b59010e9a289e438d1e3d5194 added some basic logic for handling parsing, printing, and selecting links. This code is still very rudimentary, but currently if you have a link in the following format: [Google](https://www.google.com) you can actually select and open the link in the default browser.

Things that I'd like to change:

codythegreat commented 4 years ago

So I just pushed 7 commits all related to URL parsing. Here is a quick synopsis of changes:

One more thing for the todo list:

codythegreat commented 4 years ago

Outside of these two features:

  • I'd like for the parser to remove the markdown style raw text title from the line and replace it with title[index] / Google[0]
  • I'd also like to move to something more robust for the parsing portion of the logic (possibly cmark?) that can hopefully be extended to more markdown style parsing.

I'd consider link parsing to be mostly complete. so I'll go ahead and close this issue. These features will likely be reopened as separate issues. I'm hoping that the first issues above can be implemented before 0.3.0 release. We will see.