Not logged in. · Lost password · Register
Forum: General Help and Support Features and Functionality RSS
DokuWiki and bidirectional linking
Avatar
ahj #1
Member for a month · 3 posts
Group memberships: Members
Show profile · Link to this post
Subject: DokuWiki and bidirectional linking
Some of you may have heard of Roam Research (https://roamresearch.com/) that is a new and intriguing piece of software and philosophy. In its heart is connecting notes and ideas. So in some sense it is wiki-like. I would love to achieve some of the same things in DokuWiki.

Backlinking is an important part of connecting ideas. Would it be possible to combine it with the include plugin? Say I mention Euler in a note; then it would be useful to have a page on Euler that automatically transcludes all notes linking to Euler.
Avatar
MartinR #2
Member since Jul 2015 · 177 posts · Location: UK
Group memberships: Members
Show profile · Link to this post
We already have 90% of that functionality.  In the standard template look for the three link chain labelled "Backlinks".  In the Vector template there is "What links here" in the toolbox.  To use your example:
  • I'm writing a page calculus and at some point mention [Euler]
  • I can then click on the Euler link and create the page
  • Now I can go to the Euler page and click on "backlinks" or "What links here" and see all the pages which contain [Euler]

Only two features of Roam appear to be missing:
1) The page has to be created manually, not automatically.
2) The backlinks are not inserted into the target page, but many would consider that a bonus.

Point 1 is partially solved by running the wantedpages script.
Avatar
pop (Moderator) #3
Member since Nov 2016 · 225 posts · Location: near Basel. Switzerland
Group memberships: Global Moderators, Members
Show profile · Link to this post
There's also the Tag plugin which seems to cover much of your request.
Avatar
ahj #4
Member for a month · 3 posts
Group memberships: Members
Show profile · Link to this post
Thank you both for your quick and good answers! You are right, 90% of the functionality was already there, and I tweaked the include plugin to gein the rest. It may not be the best solution, but now I can add {{blinks>pagename}} and get the backlinks transcluded:

I added to "include.php" line 15:
$this->Lexer->addSpecialPattern("{{blinks>.+?}}", $mode, 'plugin_include_include');

and then to "helper.php" line 715:

case 'blinks':
            $page = $this->_apply_macro($page, $parent_id);
            @require_once(DOKU_INC.'inc/fulltext.php');
            $pagearrays = ft_backlinks($page,true);
            if(!empty($pagearrays)){
            foreach ($pagearrays as $pagearray) {
                $pages[] = $pagearray;
            }
            }else{
                $pages[] = 'notes:dummy';
            }
            break;
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2020-02-17, 08:51:02 (UTC +01:00)