← Back to team overview

zim-wiki team mailing list archive

Re: Organizing Pages, Sub-Pages within Zim

 

Bash will not do it if you want to update links - would be the same as
moving the files in your file browser.

Minimal python script would like something like the following (not tested)

#############################

from zim.fs import Dir
from zim.notebook import build_notebook, Path

mydir = Dir("/path/to/my/notebook/folder/")
notebook, x = build_notebook(mydir)

for pagename in (
    'page1', 'page2', 'page3:subpage'
):
    path = Path(pagename)
    newpath = Path("newparent:" + pagename)
    notebook.move_page(path, newpath)

#############################



On Mon, Apr 4, 2016 at 10:09 PM, Karthik Tayur <karthikstayur@xxxxxxxxx>
wrote:

> It would be nice if this could be included as part of the default
> functionality. I'd like to help in any way possible regarding the same.
>
> Is there any way to reorganize pages using the bash functionality
> currently?
>
> On 5 April 2016 at 01:26, Jaap Karssenberg <jaap.karssenberg@xxxxxxxxx>
> wrote:
>
>> Current interface does indeed not allow for this.
>>
>> Would not be to hard to create a plugin that allows selecting a set of
>> pages and move them at once. Seem nice "notebook refactoring" functionality.
>>
>> REgards,
>>
>> Jaap
>>
>>
>> On Sun, Apr 3, 2016 at 1:33 PM, Chris Habasinski <cjhabs@xxxxxxxxx>
>> wrote:
>>
>>> Yes, good point.
>>>
>>> On 04/03/2016 01:17 AM, Karthik Tayur wrote:
>>>
>>> @Chris I tried what you suggested. I had not thought of that because of
>>> the links. The shifted pages lack links. So that can't solve the problem.
>>>
>>>
>>> On 3 April 2016 at 04:57, Chris Habasinski <cjhabs@xxxxxxxxx> wrote:
>>>
>>>> You could do this directly from your file manager as each page is a
>>>> file and each sub-page is stored under a folder.
>>>> You may need to re-index after moving them around.
>>>>
>>>>
>>>> On 04/02/2016 04:51 PM, Karthik Tayur wrote:
>>>>
>>>> Dear all,
>>>> Is there any quick way of selecting multiple pages and placing them as
>>>> sub-pages of a page? I have gone through the manual and I don't see any
>>>> option like it through the GUI.
>>>> In Tomboy, it is easy to select multiple notes and then drop them under
>>>> a notebook (Notebooks there act like one main page). I find it particularly
>>>> hard in zim using the index to reorganize notes. I have quite a lot of
>>>> notes with most having at least three levels.
>>>>
>>>> Any guidance would be much appreciated
>>>> Karthik Tayur
>>>>
>>>>
>>>> _______________________________________________
>>>> Mailing list: https://launchpad.net/~zim-wiki
>>>> Post to     : zim-wiki@xxxxxxxxxxxxxxxxxxx
>>>> Unsubscribe : https://launchpad.net/~zim-wiki
>>>> More help   : https://help.launchpad.net/ListHelp
>>>>
>>>>
>>>>
>>>
>>>
>>> _______________________________________________
>>> Mailing list: https://launchpad.net/~zim-wiki
>>> Post to     : zim-wiki@xxxxxxxxxxxxxxxxxxx
>>> Unsubscribe : https://launchpad.net/~zim-wiki
>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>>
>>
>

Follow ups

References