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

[FEATURE] Article View Padding #233

Closed
2 tasks done
ddkasa opened this issue Sep 21, 2024 · 7 comments
Closed
2 tasks done

[FEATURE] Article View Padding #233

ddkasa opened this issue Sep 21, 2024 · 7 comments
Assignees
Labels
type: feature Implements a new feature

Comments

@ddkasa
Copy link

ddkasa commented Sep 21, 2024

Is your feature request related to a problem? Please describe.
Article text is to close to the edge and doesn't provide a great reading experience.

Describe the solution you'd like
I would like to have two different things added :

  1. Padding configuration for each section. Especially for the article section.
    For example:
[theme.article_view]
padding = 5  # Something similar to the CSS box model.
  1. A focus mode similar to the Zen Mode Neovim extension.
    Essentially a hotkey that allows you toggle a more narrow and distraction free mode when viewing an article.

Additional context
wiki_tui_feature_request

Checklist

  • checked that this feature wasn't requested before in an issue
  • read CONTRIBUTING.md
@Builditluc
Copy link
Owner

Hey @ddkasa, please excuse my late reply.
I agree with you that with no padding, reading in especially large windows is a bit uncomfortable.
From what I can see in zen-mode.nvim, the page width would be a set percentage of the main window. Should this zen-mode also hide the table of contents (this would be configurable), what do you think?

Regarding the padding, should this padding be applied to the whole application (including searchbar, statusbar, etc) or just the article and the table of contents?

@Builditluc Builditluc self-assigned this Nov 4, 2024
@ddkasa
Copy link
Author

ddkasa commented Nov 4, 2024

Hi @Builditluc

Should this zen-mode also hide the table of contents (this would be configurable), what do you think?

Yes, I think it should hide everything except the article, as it's essentially a distraction free reading mode. Unless you can find a way to integrate the table of contents more seamlessly, such as creating a navigation bar with just the header/chapter numbers.

Regarding the padding, should this padding be applied to the whole application (including searchbar, statusbar, etc) or just the article and the table of contents?

I was particularly thinking of the article view where most of my time is spent anyway. The application already has configurable themes for each of the sections, so if it's easy to integrate; my opinion is that having more options is better.

@Builditluc
Copy link
Owner

I've implemented a zen-mode and added padding configuration options. They are already available in the current dev version (do note, this version is very different, and not totally complete configuration wise).

The documentation for the zen-mode options can be found here: https://wiki-tui.net/dev/configuration/page/#zen-mode
The documentation for the padding options here: https://wiki-tui.net/dev/configuration/page/#padding

@ddkasa
Copy link
Author

ddkasa commented Nov 9, 2024

I have tried the dev version and everything is looking pretty good.

My only suggestion would be to allow for a width_percentage value for zen-mode like you have for the table of contents in order to narrow the field of view when focusing.

@Builditluc
Copy link
Owner

Makes sense, yes. I would add an option to set a horizontal and vertical constraint, so you have more freedom in how you'd like to read the content in zen-mode. (the page view would be a centered rect where a constraint would look and be configured like this)

@Builditluc
Copy link
Owner

Pushed d713a9d which adds size constraints for the content in zen-mode. Documentation for the feature is also live at: https://wiki-tui.net/develop/configuration/page/#changing-the-size-of-the-content-in-zen-mode

@Builditluc
Copy link
Owner

Closing this, as the feature was shipped with v0.9.0

@github-project-automation github-project-automation bot moved this from Todo to Done in wiki-tui: Roadmap Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature Implements a new feature
Projects
Status: Done
Development

No branches or pull requests

2 participants