create new tag
, view all tags

EditSectionPluginDev Discussion: Page for developer collaboration, enhancement requests, patches and improved versions on EditSectionPlugin contributed by the TWikiCommunity.
• Please let us know what you think of this extension.
• For support, check the existing questions, or ask a new support question in the Support web!
• Please report bugs below

Feedback on EditSectionPlugin

-- ThomasWeigert - 13 Nov 2006

Thomas, what is the status of this plugin? The zip file is missing, so I marked it is IncompletePackage.

-- PeterThoeny - 18 Dec 2007

Thomas, are there any plans that you will work on this? I am about to write a new sectional edit plugin from scratch as I need a solution that is available now and does not need any core patches etc. I'd like to name it EditParagraphPlugin or something similar. But I'd prefer to call it EditSectionPlugin obviously. There's too much naming and package confusion in this feature area already so I'd like to come to an agreement on the naming fist.

So is the name "EditSectionPlugin" available or do we wait for Thomas to finish any of his plans? Or are there any other proposals for a name?

This is how I implemented it:

  • there's a new %EXTRACTSECTION{}% that extracts sections from a topic
  • a section is a part enclosed in headings
  • sections are numbered, counting starts with 1
  • section 1 is the one starting at the first heading, ending before the second
  • plans are to call section 0 the one before the first heading
  • edit links+icons are added next to all headings automatically, configurable by a format string EDITLABEL
  • min and max heading depth is configurable, MINDEPTH, MAXDEPTH
  • there's a cover template for edit that displays the selected section in the textarea; the parts before and after the selected section are stored in hidden formfields
  • full topic texts are recombined using javascript before the form is saved, that is there's no need for an extra save cgi that tries to merge a section into a topic text again
  • this can be used to implement an inline edit scheme as well using an appropriate edit cover that renders all of the topic like in a normal view but uses %EXTRACSECTION{before="9"}%=<textarea>%EXTRACTSECTION{nr="9"}%<textarea>%EXTRACTSECTION{after="9"}% instead of %TEXT%

-- MichaelDaum - 20 Dec 2007

Michael, we have not heard from Thomas for quite some time. I'd give it a week or so, then use this plugin name for your plugin. It'd be cool to get a solid sectional edit feature without too many dependencies that works on all 4.x releases. The 800 pound gorilla wiki has good sectional editing, people expect it in TWiki as well.

-- PeterThoeny - 21 Dec 2007

Okay will wait til 28 Dec 2007 and then take this name or release it under another name. The only dependency will be the JQueryPlugin. Here is a screenshot. As you see, the universal wiki button shows up when you hover over a heading of a section to edit. It is hidden otherwise and of course if you don't have write access.


-- MichaelDaum - 21 Dec 2007

I've sent an email to Thomas and gave him another week, til 03 Jan 2008, to have a chance to reply.

-- MichaelDaum - 27 Dec 2007

Woops. His email address bounces frown Thomas has left the building?

-- MichaelDaum - 27 Dec 2007

So sorry for the long absence... last year I did not have much time to focus on TWiki due to my transition to the University of Missouri not to long ago (the latter also explains the email bouncing... new email is weigert at mst.edu).

I believe that the proposed name for Michael's plugin is not a good one, for the following reason: The name "Section" means something in TWiki, and Michael's plugin does not edit such sections. It is, as far as I can tell, a subset of the functionality of SectionalEditPlugin.

The EditSectionPlugin that I am hoping to put together, is focusing on editing TWiki sections, and would therefore be better named such.

So my suggestion is for Michael to come up with a different name, in order not to confuse users.

-- ThomasWeigert - 28 Dec 2007

By the way, another reason why the EditSectionPlugin is so delayed is that the section mechanism was much in flux and discussion during the last TWiki cycle, and I am not sure whether the questions debated then have all been resolved.

-- ThomasWeigert - 28 Dec 2007

Okay, I will think of some other name. Any propositions?

It is a subset of SectionalEditPlugin. I first tried to use SectionalEditPlugin, failed to make it do what I want, opened up the perl code, patched it and finally decided that I'd better rewrite it from scratch as there where too many points where I'd code it differently.

What I am aiming at is to come up with a much simpler and robust approach than Thomas went in his code, that is by always saving complete topics and not trying to merge back a section. The sections (let me call it like this for now) are extracted in separation, the selected one is put into a textarea, the rest is put into hidden formfields, before submitting the text the sections are recombined and posted to a normal save. So no extra cgi script is needed, nor any core patches.

In this context, I prefer to use the term "sections" like MediaWiki does:

Sections can be separately edited by clicking special edit links labeled "[edit]" by the heading, or by right clicking on the section heading, depending on the preferences set. This is called "section editing feature".
(from http://en.wikipedia.org/wiki/Help:Section#Section_editing)

So in MediaWiki, sections are parts of the topic text that are separated by headings.

-- MichaelDaum - 28 Dec 2007

Yes... we have a discrepancy between

  • functional view (in documents, some things between headings are called sections (others are called chapters, subsections, subsubsections, paragraphs, etc.) and
  • tool view (in TWiki, sections are delineated by %xxxSECTION%)

I think that the tool view here is more important to avoid confusion, in particular, as in the functional view there are many other words for text between paragraphs (see above).

With regards to the approach in the plugin, the SectionalEditPlugin does things in the same way you describe above.

Regarding your plugin, I am not fond of requiring some gigantic javascript library to make plugins work which on the face of it do not require any javascript.

-- ThomasWeigert - 28 Dec 2007

In TWiki the term "sections" is used to refer to any part of a topic that is marked using STARTSECTION, STOPSECTION / ENDSECTION and which are object of transclusion using INCLUDE. Thomas invented another set of tags in SectionalEditPlugin, <section> and </section>. These sections are not transcludable by standard means and only play a role in SectionalEditPlugin.

From a usability point of view, any extra loop I have to hop through to get the "section editing feature" is too much. The more aid I get automatically, the better. The only legimitation for extra markup to denote sections explicitly is that sections may get too long otherwise and users may wish to subdivide them into portions that they can handle easily. While I can subscribe to this argument, the tradeoff still exists: either I introduce complexity by explicit section markup, or I cope with longer sections only being separated by headings.

For now, I decided that users should add more headings. That's good for sectional editing - and last not least - for the reader as well wink

Anyway. What we need is a good "section editing feature" for TWiki. The names SectionalEditPlugin and EditSecitonPlugin are taken already but don't seem to fit the bill right now.

-- MichaelDaum - 28 Dec 2007

Note that the SectionalEditPlugin does not require new tags. It works just as well with using headings only to delineate sections. The additional tags were added to allow to break the document into smaller portions than those delineated by headings or into larger ones, if so desired. (In addition to sections delineated by headings, I am using this plugin to divide a document into separately editable regions, often under the control of a skin.)

Note further that these tags were introduced long before the TWiki section tags. The TWiki section tags, unfortunately where added without paying attention to that other tags were already in use for sections. This resulted in confusing and overlapping features.

The whole purpose of the EditSectionPlugin was to remove this duplication by using the TWiki section tags to replace the tags that SectionalEditPlugin had introduced earlier.

-- ThomasWeigert - 28 Dec 2007

With regads to using JQueryPlugin, the same argument holds for BehaviourContrib and all of the TWikiJavascripts which are only used by TwistyPlugin/TwistyContrib and which are already shipped with TWiki by default.

  • Yes, I am not happy with those either. if we could just standardize on some JavaScript library that everybody who needs JS support could rely on... TW
  • That's basically driving the discussion at MoveToJQuery. People got familiar with different js frameworks. Me, that's jQuery. So I ported TwistyPlugin to jQuery coming up with some JQueryTwistyPlugin, a drop-in replacement, which was not that difficult. That means, I can kick out BehaviourContrib and just do jQuery all over the place, which is quite fun actually... MD

-- MichaelDaum - 28 Dec 2007

Oh I think prior art goes to STARTINCLUDE / STOPINCLUDE ... which just adds to the naming mess.

Btw. what will be the difference between EditSectionPlugin and SectionalEditPlugin and MultiEditPlugin? When will I need one and not the other?

-- MichaelDaum - 28 Dec 2007

The goal of EditSectionPlugin to replace both MultiEditPlugin and SectionalEditPlugin. Btw, the difference between these is that

  • MultiEditPlugin allows sections to be anywhere in the topic, but sections cannot be nested
  • SectionalEditPlugin allows nested sections, but the sections cannot be inside tables or lists

-- ThomasWeigert - 29 Dec 2007

Ok, I wish you good luck with it. I will release my stuff as an EditChapterPlugin. "Chapter" is a good name as they tend to have headings.

-- MichaelDaum - 29 Dec 2007

How about naming it a descriptive EditHeadingsPlugin?

-- PeterThoeny - 30 Dec 2007

Because it does not edit the headings?

-- MichaelDaum - 02 Jan 2008

Edit | Attach | Watch | Print version | History: r16 < r15 < r14 < r13 < r12 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r16 - 2008-01-02 - MichaelDaum
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.