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

Add a document outline widget for R Markdown documents #436

Merged
merged 92 commits into from Jun 17, 2015

Conversation

kevinushey
Copy link
Contributor

Not ready for merge but basic functionality is there (so we can start discussing styling + other behaviours + UI we might like)

document-outline

Some of the nice features so far:

  • Click to navigate to chunk
  • Chunks that are currently visible get a different UI treatment

TODO

  • Include a tab bar above the outline widget
  • Consider sub-items for chunks (e.g. functions)
  • Use appropriate icon for tree entries [decided to use no icon]
  • Add an icon to show / hide the outline for the document widget
  • Optimize scope tree updates (don't re-generate the scope tree on every render)
  • Option to allow outline to track editor position (e.g. as the user scrolls)
  • Other styling
  • Add markdown headers to scope tree
  • Handle sub-headers in Markdown
  • Latch the outline icon
  • Use vertical bar instead of background color for active chunk
  • Inherit colors from current editor theme
  • UI / document preference for the outline widget size

@znmeb
Copy link

znmeb commented May 29, 2015

Nice! I could really use something like this - I'm trying to write a book and a good outliner like LyX has is pretty much mandatory.

@jjallaire
Copy link
Member

Fantastic! I'll send Paul on email on Monday morning to start tweaking out
the UI.

On Fri, May 29, 2015 at 6:09 PM, M. Edward (Ed) Borasky <
notifications@github.com> wrote:

Nice! I could really use something like this - I'm trying to write a book
and a good outliner like LyX has is pretty much mandatory.


Reply to this email directly or view it on GitHub
#436 (comment).

@kevinushey
Copy link
Contributor Author

Great! FWIW here's what things look like right now:

screen shot 2015-05-30 at 6 27 09 pm

We should make it clear that we would like to support a generic tree-based view as well (ie not just top-level chunks in the display)

@znmeb
Copy link

znmeb commented May 31, 2015

Will it have the usual outliner UI? Indent, outdent, drag nodes, cut, paste, etc.?

@jjallaire
Copy link
Member

We won't do that now (it will just be an outline view) but we'll definitely
consider adding more interactivity after we get the initial version out.

On Sun, May 31, 2015 at 1:23 AM, M. Edward (Ed) Borasky <
notifications@github.com> wrote:

Will it have the usual outliner UI? Indent, outdent, drag nodes, cut,
paste, etc.?


Reply to this email directly or view it on GitHub
#436 (comment).

@kevinushey
Copy link
Contributor Author

Okay, the widget is getting pretty close (coordinating hide + show events unfortunately requires a surprising amount of plumbing -- I'm not sure if there's a better way to handle this or not):

show-outline

Once I'm sure that the chevron behaves well when showing + hiding the outline I think we should be close to merge.

@kevinushey
Copy link
Contributor Author

@jjallaire, I think this should be good to go (at least for the dailies). There's likely other refinements / changes we'll want to make but I think it's good enough that we can expose people running the dailies now. (It would also be good to get more feedback from e.g. @hadley)

@jjallaire
Copy link
Member

We're not quite ready for merge (see the shared document for various bugs I found and some small appearance tweaks).

@rmflight
Copy link

Will y'all comment what daily build this gets incorporated into? Really looking forward to seeing this in action.

@kevinushey
Copy link
Contributor Author

Thanks @jjallaire -- I'll start tracking these down and ping you once I've fixed them.

@rmflight, we'll comment after this gets merged + what daily build it appears in.

@kevinushey
Copy link
Contributor Author

Okay @jjallaire, I think this should be go -- I resolved the bug(s) you reported earlier (basically due to Qt WebKit not implementing startsWith on the String prototype) and tweaked the display.

Here's what it looks like now:

screen shot 2015-06-16 at 4 33 09 pm

Can you give it another quick spin and merge if you think all looks well?

jjallaire added a commit that referenced this pull request Jun 17, 2015
Add a document outline widget for R Markdown documents
@jjallaire jjallaire merged commit 0a3c51a into master Jun 17, 2015
@jjallaire jjallaire deleted the feature/document-outline branch June 17, 2015 10:15
@jjallaire
Copy link
Member

@rmflight The latest daily build (v0.99.585) has the outline view (note there is no windows version yet, the build failed for some reason). http://www.rstudio.org/download/daily/desktop/

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.

None yet

4 participants