Closed codythegreat closed 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.
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:
slide
struct. This is not optimal as we'd like for any number of links to be accommodated. I'd like to create a new type like this:http[s]://
in their link the browser simply won't open. If the user forgets to include this, we'd like for the logic to automatically add it. this should be an easy fix.[title](link)
from the line and replace it with title[index]
/ Google[0]
So I just pushed 7 commits all related to URL parsing. Here is a quick synopsis of changes:
mdlink
struct that is a linked list. the slide will either store the first link, or NULL if a link doesn't exist. each link has an index (starting at 0
) that is callable by pressing l[index]
when on the slide containing the linkOne more thing for the todo list:
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.
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
whereasn
is the link number (in the case of a single link, this would be0
.If a user presses
l
followed by the link number the webpage will be opened in the default browser.