Page MenuHomePhabricator

EDIT: more shortcut options wanted
Closed, ResolvedPublic

Description

Following options I want to be implemented, this to make it easier to do usual things to commons things:

append=text:
Appends a string to the section/page

prepend=text:
Prepend a string to the section/page

sectionprepend=text:
Prepends a string to the section, but after the section header

Those should be able to work in unison, and override the text parameter (or make it throw an error if both text and the above is given);

Example:

api.php?action=edit&title=Foo&section=2&sectionprepend={{begin foo}}&append={{end foo}}


Version: unspecified
Severity: enhancement

Details

Reference
bz14459

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:11 PM
bzimport set Reference to bz14459.

(In reply to comment #0)

Following options I want to be implemented, this to make it easier to do usual
things to commons things:

append=text:
Appends a string to the section/page

prepend=text:
Prepend a string to the section/page

Those sound doable, I'm on it.

sectionprepend=text:
Prepends a string to the section, but after the section header

That's probably not as easy, since it involves parsing the section text to some degree to find out what the section header is. I can't guarantee I'll implement this.

appendtext and prependtext parameters added in r36235. They work for sections too, although prependtext won't do what you expect (it'll prepend your stuff before the section header, appending your stuff to the previous section). Also, keep in mind that no newlines or spaces are added between prependtext, the old content and appendtext; if you want them, add spaces or newlines to the end of prependtext and/or the beginning of appendtext yourself.