amake / orgro

An Org Mode file viewer for iOS and Android
https://orgro.org
GNU General Public License v3.0
452 stars 21 forks source link

Adding an option to preserve line breaks #73

Closed nyxkn closed 1 year ago

nyxkn commented 1 year ago

I'd like an option to have newlines within a paragraph still show as newlines in orgro. I understand that joining lines is how paragraphs are normally handled when exporting from orgmode, but I'd like orgro to be more faithful to the source files and keep newlines.

Orgmode also has a similar option to preserve newlines when exporting: org-export-preserve-breaks

I'm happy to work on this myself, as long as it's something you'd be open to add to orgro.

From a quick look around, it seems this would require changes in the org paragraph widget in org_flutter. I think it would be nice to have a toggleable option in orgro, that we could then pass on to the org_flutter widgets?

Let me know what you think.

amake commented 1 year ago

Thanks for the issue. This isn't something I would work on myself, but I would accept patches for this. Please note the contributing guidelines.

From a quick look around, it seems this would require changes in the org paragraph widget in org_flutter. I think it would be nice to have a toggleable option in orgro, that we could then pass on to the org_flutter widgets?

Yes, that sounds right.

  1. Add a flag for this to (probably) OrgController
  2. Implement the alternate behavior within OrgParagraphWidget, toggled by the above flag

    Another option would be to make a different widget and select the widget based on the flag. I'm not sure which would be better.

  3. Pass the flag from Orgro

I'd like to avoid adding lots of fiddly options, so I think we should consider toggling this with "Reader Mode":

But in the general case preserving line breaks may be quite disruptive so a separate control may be needed.

nyxkn commented 1 year ago

Hey @amake, thanks for the reply!

Sounds good. I'll have a stab at this and see what comes up.

gety9 commented 1 year ago

@amake @nyxkn

guys, is there update on this? i see nyxkn added PR to org_flutter 3 weeks ago (but no merge yet)

amake commented 1 year ago

@gety9 No movement yet. I've been busy.

amake commented 1 year ago

This will be available for testing shortly; look for version 1.28.0

amake commented 1 year ago

If there is no negative feedback about this change then I will release it soon.

nyxkn commented 1 year ago

Tested your changes on a local build and all works as expected. Thanks for the work!

amake commented 1 year ago

This is now released in v1.28.1.

gety9 commented 1 year ago

@amake Aaron, will it be released on Fdroid? (Still 1.27.1)

amake commented 1 year ago

Thanks for reminding me. It will be on F-Droid soon: https://gitlab.com/fdroid/fdroiddata/-/merge_requests/13148

amake commented 1 year ago

The F-Droid build is now available.

gety9 commented 1 year ago

@amake thank you Aaron!