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

Editing subsections of nodes #1005

Closed
8 tasks done
jywarren opened this issue Nov 22, 2016 · 3 comments
Closed
8 tasks done

Editing subsections of nodes #1005

jywarren opened this issue Nov 22, 2016 · 3 comments
Assignees
Labels
break-me-up break up for cleaner code separation, discrete tests, and, easier and iterative collaboration
Milestone

Comments

@jywarren
Copy link
Member

jywarren commented Nov 22, 2016

This is a planning issue, not yet complete, to eventually be broken up into sub-issues.

Idea

To make editing wikis easier, we're interested in making it possible to edit just one section; sections could be divided as block elements, so any header, paragraph, list, blockquote, or image would become a subsection.

Subsections could have an "edit" link next to them, which opens an inline editor for just that subsection.

DrupalNode would have a "update_subsection" or similar method, which accepts strings A and B; A is what's replaced, B is what replaces it. A new revision is made with the post-swap version of the whole wiki's content.

This architecture could be pretty robust, and might later lead to possible "suggestions" which affect just one block, and aren't yet "run". These could be stored as comments (so they're authored) or as some other new type -- and could apply to both notes and wikis.

However, we'd need to think about authorship; can we efficiently show recent authors for a given subsection separately from for a whole wiki page?

(Alternatively, could we think about per-line changes, rather than per-block changes, making it easier to split wiki pages up? But then list items would be one item per subsection, which doesn't sound right.)

Subsections would require:

  • Client-side sections method which splits latest revision body up by block element
  • DrupalNode.update_subsection(old, new) method
  • DrupalNode.replace(old, new) method which returns false if no replacements can be made
  • replace controller method in wiki_controller.rb
  • some view method for inserting "edit" links next to each block element on wiki pages
  • unit/functional tests for replace!
  • client-side tests for all that jazz
  • interface work to integrate new Rich editor inline
@jywarren jywarren added the break-me-up break up for cleaner code separation, discrete tests, and, easier and iterative collaboration label Nov 22, 2016
@jywarren jywarren added this to the Rich Wikis milestone Nov 22, 2016
@jywarren jywarren changed the title Editing subsections of node Editing subsections of nodes Nov 22, 2016
@jywarren
Copy link
Member Author

jywarren commented Dec 9, 2016

node.replace now works, and matching wiki controller replace method: #1087

@jywarren
Copy link
Member Author

We now have early prototype editable subsections:

https://publiclab.org/wiki/sandbox?raw=true

@jywarren
Copy link
Member Author

jywarren commented Mar 2, 2017

This is now complete and additional work ongoing at https://github.com/publiclab/inline-markdown-editor. Woohoo! 🎈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
break-me-up break up for cleaner code separation, discrete tests, and, easier and iterative collaboration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant