Page MenuHomePhabricator

Implement options in category.py when using listify action to append and prepend content in existing page
Open, LowPublic

Description

Inspired from T197841: Allow to append to the output page on category.py listify in this comment: T197841#4398603, seems it will be useful to have both options in the listify action?

Also, the patch: https://gerrit.wikimedia.org/r/c/pywikibot/core/+/462141 appends new category list at the bottom (by default) of the already existing page (using the -append option).

If we're going to implement both options, we should discuss their names :)

Suggestions

From pagefromfile.py, suggestions are to reuse -appendtop and -appendbottom options.

Event Timeline

@Xqt, can we try to figure out when and why to prepend instead of append? And also the name of both options? Poking @Wesalius here too for ideas :)

xSavitar updated the task description. (Show Details)
xSavitar renamed this task from Create -appendtop and -appendbottom options for category.py when using listify action to Implement options in category.py when using listify action to append and prepend content in existing page.Sep 22 2018, 9:38 PM
xSavitar updated the task description. (Show Details)
In T205200#4608459, @D3r1ck01 wrote:

@Xqt, can we try to figure out when and why to prepend instead of append?

That’s just an idea and finally it’s up to the operator to use it. It could be important to have the newest lists on top to be focused. But first there should be an option to write a section header above the current list.
‘-prepend’ looks nice for prepending the list. ‘-header’ would be intuitive for the other proposal to add a section header. ‘-header:2:”New section” for a new section header in level 2. The level part may be ommitted and is 2 by default (only useful with -append I guess). Just an idea.

Sounds good. Maybe @Wesalius has a few ideas too? But I'm good with @Xqt's proposition :)