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

Adding more styling options for users #108

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

snowfoxsh
Copy link

Abstract

This pull request introduces the capability to use straight box drawing characters in addition to the existing curved ones. This enhancement broadens the range of visual styles available to users, allowing for greater flexibility and customization in graphical representations.

Background

Currently, our system supports only curved box drawing characters. While these are suitable for many applications, they can sometimes appear too stylized for use cases requiring a sharper, more angular aesthetic. Recognizing this limitation, this update provides an alternative that caters to different stylistic preferences and practical requirements.

Implementation Details

The implementation extends the existing functionality to include straight line variants of the box drawing characters. This is achieved by adding a new enumeration option, CharSet::UnicodeStraight, which users can select to switch from curved to straight line rendering. This option is designed to integrate seamlessly with the existing framework, ensuring that users can easily toggle between character styles without compatibility issues.

Also Includes

  • Changes to the .gitignore to allow for better support for users of the Jetbrains IDEs
  • Tests for both CharSet::Unicode & CharSet::UnicodeStright

Impact

By enabling the use of straight box drawing characters, this feature enhances the toolkit available to users, making it more adaptable to various design needs. It particularly benefits applications in design, text-based art, and user interface development, where line aesthetics can play a crucial role in user experience and information clarity.

Example

Error: can't compare apples with oranges
   ┌─[<unknown>:1:1]
   │
 1 │ apple == orange;
   │ ──┬──    ───┬──  
   │   └────────────── This is an apple
   │             │    
   │             └──── This is an orange
───┘

Update .gitignore to ignore .idea files for Jetbrains users
@snowfoxsh
Copy link
Author

Enhancing Styling Flexibility

Our current styling system, while functional, is limited. This approach, though practical for general applications, limits users who seek finer control over their styling preferences. To address this, I propose a more versatile styling mechanism. This would involve an optional builder pattern that allows users to customize styles by selectively overriding character sets at both the category and individual character levels. I would be happy to develop a prototype and further outline the potential interface. What do you think? I am ready to provide more details upon your interest.

Copy link
Owner

@zesterer zesterer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Looks like a solid PR, much appreciated.

I'll definitely bear what you say in mind while working on ariadne's refactor also!

@snowfoxsh
Copy link
Author

Ur working on a refactor? Cool. I have some time on my hands if you would like me to add some contributions.

Also, on a side note how do you feel about a source code manipulation "Label" objects. For instance, if you want to prompt your reader to add something you could add an Insertion that would alter the source to reflect the change? The advantage of doing something like is that spans would be automatically calculated. You could just span as normal and let the report handle stuff for you.

@snowfoxsh
Copy link
Author

I have got an interface mostly complete for insertion, i can make a pull soon if interested. I think it should be relatively easy to place behind a feature flag

@zesterer
Copy link
Owner

zesterer commented Apr 6, 2024

Ur working on a refactor? Cool. I have some time on my hands if you would like me to add some contributions.

My current progress is on the ariadne2 branch. It's a total rewrite with the intention of having the code be a lot easier to work with, customise, support for multiple output backends, etc. Still very WIP though, only started work on it over the past week.

Also, on a side note how do you feel about a source code manipulation "Label" objects.

Very positive! It's definitely planned for the refactor. I've not started implementing it yet, but my goal is to allow for the 'embellishment' of Sources (in the refactor, called Files), allowing you to compose insertions/removals on top of them and have Ariadne automatically compensate for offsets in a fairly seamless manner.

I have got an interface mostly complete for insertion, i can make a pull soon if interested.

I'd be interested to see how it compares with my own ideas about this for sure!

@snowfoxsh
Copy link
Author

I'd be interested to see how it compares with my own ideas about this for sure!

Okay, ill make a pr into stable when im done with the feature so you can check it out.

My current progress is on the ariadne2 branch. It's a total rewrite with the intention of having the code be a lot easier to work with, customize, support for multiple output backends, etc. Still very WIP though, only started work on it over the past week.

Nice Nice. Ill check it out and see if I can help in the next week ish.

@snowfoxsh snowfoxsh closed this Apr 6, 2024
@snowfoxsh snowfoxsh reopened this Apr 6, 2024
@snowfoxsh
Copy link
Author

Missclick 💀

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.

2 participants