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

Inline text style markup #10

Open
quentint opened this issue Apr 14, 2020 · 7 comments
Open

Inline text style markup #10

quentint opened this issue Apr 14, 2020 · 7 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@quentint
Copy link

Hi and thanks for doing this :)

I'm working on a RichText class and syntax that would allow faster and simpler rich formatting. Here is a very early screenshot of what it can do:

image

It's working but I'm not sure about the formatting syntax itself (will work on improving that). Also, I'd like to allow easier bold and italic switching, with predefined and associated font names.

Any thoughts?

@jedateach
Copy link

That definitely looks like a much more user-friendly way to manage inline styles compared to the style array.

Do you think it needs to be its own class, or could we introduce this templating to the base TextContainer class?

@jedateach
Copy link

FYI - I'm planning further refactoring / tidy once I get code coverage working in #9

@quentint
Copy link
Author

It currently is class RichText extends Text. Haven't tried TextContainer (or seen, actually!) before. Can you brief me on what it helps with?

@jedateach
Copy link

jedateach commented Apr 20, 2020

I noticed duplication that could be removed by creating a shared base class for Text, PathText, and CharacterText. It's not part of the original version of txtjs.

@jedateach jedateach added enhancement New feature or request question Further information is requested labels Apr 20, 2020
@quentint
Copy link
Author

I see. Then that could definitely go in here 🙂

@jedateach jedateach changed the title [Question] Interested in a RichText class and syntax? Inline text style markup Apr 20, 2020
@jedateach
Copy link

It does seems like it could remain decoupled however - ie, we could have most of the implementation stored in a separate class, and the base class just makes use of it.

Do you want to create a draft PR for implementation feedback?

@quentint
Copy link
Author

Could be decoupled in some kind of utility class, yes. Will try to provide a draft PR this (or next) week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants