Closed KippKipper closed 3 years ago
Old issue/feature request, but would like to +1 this. I was thinking that in the editor pane it would be nice to set this up like:
\page [Page Title]
A user could collapse portions of the markup in the editor pane by maybe double clicking the \page line, and the \page line would also have a user-entered title so that it is easy to find which page they need.
CodeMirror has collapsing built in by the looks of things, so this shouldn't be too complicated.
I would limit it to \page
boundaries and maybe # Headings
down to some depth, but not other objects.
Looks like we would need to edit shared/Naturalcrit/codeEditor/codeEditor.jsx
and add these options to componentDidMount
:
foldGutter: {
rangeFinder: function(startPos) //given a starting line of code, return null if this doesn't start a foldable block, or return line number where this foldable block ends. startPos.line is the starting line number.
},
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"]
Oh .. integration with #1147 might prove weird - that is currently deferred to #1093 V3 Renderer because it might break brews where \page
does not occur at line start.
Suggestion: implement #629 but only fold \page
if at line-start .. rendering would unaffected (yay), folding is available (yay), and the fact a given \page
doesn't fold because it isn't at line-start might encourage editorial clean-up.
Any updates on this? Navigating my project is becoming a bit of a nightmare :s
@snctfd Not yet, although we have been making a lot of changes to the editor panel lately so we might get to it sooner than later.
Feel free to send us a PR if you want to contribute too.
I've got some pretty big brews as well and definitely agree it would be a helpful addition -- I'm going to start working on this!
@jeddai Great! New PRs are always welcome!
I would limit it to \page boundaries and maybe # Headings down to some depth, but not other objects.
@ericscheid could it make sense to include xml folding for things like <style>
blocks?
I agree with @ericscheid that we should (at least to start) limit this to \page separators. Especially since with v3 we are actively trying to discourage literal XML/HTML blocks in favor of our custom Markdown syntax. Similarly, styles should all be contained within the Style tab rather than using <style>
tags.
Agree. First step collapsing on \page
markers.
Collapsing on headers would be problematic, as they might occur within {{curly-blocks}}
.
If anything, being able to collapse {{curly-blocks}}
would be the second step.
Fixed by #1792
Over the past month, I have been using Hombrewery a lot. I think it would be nice to collapse sections of my brew that I don't use so that it is easier to scroll to the 25 page or find the section I want to edit. 25 pages seem like a wall of text to scroll through to find anything. I have had to split up my brew into manageable chapters so that it was easier to edit it.
Thank you for the homebrewery, this is my feedback.