codythegreat / dss

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

Specify Color by Line #37

Closed codythegreat closed 4 years ago

codythegreat commented 4 years ago

Color

This is one of the core features that will be introduced in v0.3. My current idea for this feature is as follows:

  1. User adds a tag on the line that they want colored (for example {COLOR_BLUE})
  2. Dss will detect the color code and assign it to a value in the struct. the line will be stored without the tag.
  3. when printing lines to the screen, if dss encounters a different color, it'll print that line in that color, then the next line will be in the original color.

This is a very basic overview but hopefully it gets the idea across.

codythegreat commented 4 years ago

Okay so I've made some changes to how the colors work. Here is a short list of some of the more significant commits/changes:

There is still a lot of work to do. Here is a list of changes that still need to be made:

codythegreat commented 4 years ago

commit a51648eedf77a0ad27dd0c8792697c39d3af8cb9 adds some basic error handling for color tags. if a tag is >= 1 or <= 56 then it'll be parsed normally, otherwise an error message will print (with the slide number and line number), and the tag will be left in the line. This is a soft error, so after a key is pressed the slides will be loaded.

codythegreat commented 4 years ago

Commit 9a911431d70edd6da5550506f467c100664e3f57 is a feature complete implementation of line coloring (select one of 56 color pairs, tag is removed after parsing, error handling implemented), so with this commit added I'm going to close this issue. Other features noted in the comments above that weren't solved by this or previous commits will be have their own separate issue.