Skip to content

Comments

Separate fsrx functionality into a lib#11

Open
TheBestJohn wants to merge 1 commit intojrnxf:mainfrom
TheBestJohn:TheBestJohn/split2lib
Open

Separate fsrx functionality into a lib#11
TheBestJohn wants to merge 1 commit intojrnxf:mainfrom
TheBestJohn:TheBestJohn/split2lib

Conversation

@TheBestJohn
Copy link

@TheBestJohn TheBestJohn commented Sep 1, 2022

Add default feature to build bin
Update cli to use fsrx_lib

Bump dependencies

What:
Migrated the functionality of FSRX into a library that the CLI app uses to mark-up the text.

Why:
Moving fsrx functionality into a library would allow it to be used as a dependency as well to offer the flow state reading conversion of any text. I was looking to add fsrx into my own fork of the himalaya command line webmail client and, instead of just piping the output to fsrx, I wanted to implement it as an output mode.

Another application would be to quickly make a wasm based browser extension to manipulate <p> tags on a website

How:
I changed clap and atty to be feature dependent, added the cli feature and made it default.
I then added a lib that provides the FSRXStyler struct that maintains contrast, fixation, saccade mode and regex snippet states.
it provides publicly the style_line function which accepts a &str and returns a FSRX styled String

Checklist:

  • Allow edits from maintainers option checked
  • Branch name is prefixed with [your_username]/ (ex. thatvegandev/featureX)
  • Documentation added
  • Tests added
  • No failing actions
  • Merge ready

Add default feature to build bin
Update cli to use fsrx_lib

Bump dependencies
@TheBestJohn
Copy link
Author

future plans: Adding a "rich-text" mode to the lib so I can introduce "falloff" in the browser plugin whereby characters get less and less strong providing a less jarring shift from emphasized to normal characters. Having this in a lib allows the cli application to not experience any changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant