Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REQUEST: Insert link & create new blank page #550

Open
plipfishy opened this issue Oct 10, 2017 · 12 comments
Open

REQUEST: Insert link & create new blank page #550

plipfishy opened this issue Oct 10, 2017 · 12 comments

Comments

@plipfishy
Copy link

For Feature Requests

Desired Feature:
Create new blank page with link.
eg. Writing an article and insert link as usual, but if page doesn't exist, present option to create a new page.

For Bug Reports

  • BookStack Version (Found in settings, Please don't put 'latest'): 0.18.2
  • PHP Version: 5.6
  • MySQL Version: 5.5.56-MariaDB
Expected Behavior

Writing an article and insert link as usual, but if page doesn't exist, present option to create a new page.

Current Behavior

Can only link to existing pages within the wiki (or external obviously)

Steps to Reproduce

n/a

@Shackelford-Arden
Copy link

Potential duplicate of #441 ? @plipfishy

@kpoppel
Copy link

kpoppel commented Jul 30, 2022

It would seem all the hooks are there:

  1. ctrl-k to create a link, insert a link to "create_page", give the link a title and name.
  2. pressing the link will instantly create a new page alongside the original - but with input for a new title. This feature would need to use the Title or Link Text from the place it was clicked.
  3. Saving this page requires updating the originating link(s) pointing to this unique page. It seems the search feature has the hooks to find all such places to get them updated.

The page would have to be moved after creating it if some more sugar to select a book and so on is not included, but for a first iteration it would seem feasible using what is already there.

Bookstack is a little different from other wikis as pages are not unique by name but by page ID, so I can see why this feature request has been ehre for a while.

@mnaoumov
Copy link

This feature is the must-have, I think all major wiki engines have it

@c-festing
Copy link

Agreed! Signed in to say this.
It's not that "other products have this", it's just such a benefit to the flow of composing.

@lukasgolson
Copy link

I'd love to see this as a feature, this is a must for writing scientific documentation pages where I have lots of pieces of information that I'd like to further define and talk about.

@DanMundy
Copy link

+1

@corbin-auriti
Copy link

This is very important to folks with ADHD as we can forget what we wanted to link from if we created a new page. This would allow us to create link to blank page -> edit new blank page.

@corbin-auriti
Copy link

corbin-auriti commented Jun 13, 2024

Here's a header hack then when you type text in double square brackets [[TEST]] it creates a red link to a new page under in my case shelf Misc -> New Pages to Be Sorted, Please change that url for your own needs.
You'll still need to go back and change the link manually after you've created the new page.

<script>
    // Listen to the BookStack setup TinyMCE editor event to run custom actions against the editor instance
    window.addEventListener('editor-tinymce::setup, event => {
        // Gain a reference to the TinyMCE editor instance
        const editor = event.detail.editor;

        // Function to convert [[TEXT]] into a red link
        function convertBracketsToLinks(content) {
            const regex = /\[\[(.*?)\]\]/g;
            return content.replace(regex, (match, p1) => {
                return '<a href="YOUR-BOOKSTACK-URL/books/new-pages-to-be-sorted/create-page" style="color: red;">${p1}</a>';
            });
        }

        // Add a content filter to process the content before it is set in the editor
        editor.on('BeforeSetContent', function(e) {
            e.content = convertBracketsToLinks(e.content);
        });

        // Add a content filter to process the content before it is saved
        editor.on('GetContent', function(e) {
            e.content = convertBracketsToLinks(e.content);
        });
    });
</script>

@albertellimdnd
Copy link

This is incredibly important, in my opinion. I'm honestly surprised that this program is this functional and polished without this basic wiki feature. I only just spun mine up a couple weeks ago, but to be honest, the lack of this feature is constantly hampering my process.

Like others said, This would be a huge feature for those of us with adhd, but I think it's also just an essential feature in general. It's difficult to conceptualize a vast, branching wiki from the get-go, and it's borderline impossible to go back and edit all previous pages when you need to add a relevant link to something.

@adamjdavidson
Copy link

I love BookStack but this feature is a must-have for me, alas.

Any ETA on it? It's been here for 7+ years. It is a basic function of most wiki sites, so makes me think the dev team is not going to implement for some reason.

@ssddanbrown
Copy link
Member

@adamjdavidson No particular ETA, just hasn't fallen into the realm of something I'd implement, as it's really for a narrow audience scope and had relatively low demand compared to fiddly implementation requirements (editor-level UI/additions and maybe some process considerations). There's been an increase in demand this year, but editor focused features have kinda been on pause this year while building a replacement editor.

@adamjdavidson
Copy link

Thank you for the response and explanation.

It is interesting how this one little capability does reveal (I think) a major difference in approach to knowledge and documentation.

My hunch is that this is particularly valuable to those with ADHD. It's what makes Obsidian and Roam and other tools like that so attractive. It's a big thing in Notion. The ability to write, create links to new pages, later look at the undeveloped pages and flesh them out, then seeing what emerges. It is a fundamentally different approach then having a hierarchical structure from the jump.

So, maybe asking for BookStack to have this is asking for BookStack to be something it isn't meant to be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests