Request - Global variables that load in-line with documentation text #659

Open
opened 2026-02-04 21:38:26 +03:00 by OVERLORD · 11 comments
Owner

Originally created by @ghost on GitHub (May 2, 2018).

For Feature Requests

Desired Feature:

  1. New table added to bookstack which contains variable names and values.
  2. New page added somewhere to manage the table of variables, though dev ops teams can just use the table too.
  3. On page load, variable placeholders will be replaced with their match. Non-matches can either load as empty text or 'MISSING' or whatever.
  4. Some convention (such as being wrapped in @@) to determine variable names to load.

Example:
Page Content when editing:
"Be sure to verify that the current version of Software X is @software_x_current_version@ before adding the server to production."

Database Content:
id | name | value
1 | software_x_current_version | 11.0.8

Displayed content:
"Be sure to verify that the current version of Software X is 11.0.8 before adding the server to production."

This would work inline with text rather than having to reference an entire bookmarked section. This would also be great because teams can automate updates to specified tables to have current documentation of items without having to manually update pieces.

Originally created by @ghost on GitHub (May 2, 2018). ### For Feature Requests Desired Feature: 1. New table added to bookstack which contains variable names and values. 2. New page added somewhere to manage the table of variables, though dev ops teams can just use the table too. 3. On page load, variable placeholders will be replaced with their match. Non-matches can either load as empty text or 'MISSING' or whatever. 4. Some convention (such as being wrapped in @@) to determine variable names to load. **Example:** _Page Content when editing:_ "Be sure to verify that the current version of Software X is @software_x_current_version@ before adding the server to production." _Database Content:_ id | name | value 1 | software_x_current_version | 11.0.8 _Displayed content:_ "Be sure to verify that the current version of Software X is 11.0.8 before adding the server to production." This would work inline with text rather than having to reference an entire bookmarked section. This would also be great because teams can automate updates to specified tables to have current documentation of items without having to manually update pieces.
OVERLORD added the 🛠️ Enhancement label 2026-02-04 21:38:26 +03:00
Author
Owner

@mendiromania commented on GitHub (May 2, 2018):

👍

@mendiromania commented on GitHub (May 2, 2018): 👍
Author
Owner

@SonGokussj4 commented on GitHub (Sep 8, 2022):

This would be so cool...
Right now I'm creating new documentation about the path where we have our scripts saved.

So now it's /mnt/current/path/scripts but in the future it can be /server2/final/scripts so I would need to re-edit all pages/chapters where I use this variable.

Something like @SCRIPTPATH@/scripts would be awesome.

@SonGokussj4 commented on GitHub (Sep 8, 2022): This would be so cool... Right now I'm creating new documentation about the path where we have our scripts saved. So now it's `/mnt/current/path/scripts` but in the future it can be `/server2/final/scripts` so I would need to re-edit all pages/chapters where I use this variable. Something like `@SCRIPTPATH@/scripts` would be awesome.
Author
Owner

@homer2320776 commented on GitHub (Sep 16, 2022):

+1 for this

@homer2320776 commented on GitHub (Sep 16, 2022): +1 for this
Author
Owner

@Obinoben commented on GitHub (Sep 16, 2022):

+1

It would be nice to include default variable placeholders like the revision number of the page because we need to display it on our procedures. Some like @current_page_revision@ ;)

@Obinoben commented on GitHub (Sep 16, 2022): +1 It would be nice to include default variable placeholders like the revision number of the page because we need to display it on our procedures. Some like @current_page_revision@ ;)
Author
Owner

@ssddanbrown commented on GitHub (Sep 17, 2022):

Just to confirm, if not aware, there is a page include system which often be used for these scenarios:
https://www.bookstackapp.com/docs/user/reusing-page-content/

@ssddanbrown commented on GitHub (Sep 17, 2022): Just to confirm, if not aware, there is a page include system which often be used for these scenarios: https://www.bookstackapp.com/docs/user/reusing-page-content/
Author
Owner

@SonGokussj4 commented on GitHub (Sep 20, 2022):

Yes, I know about that and tried to use that. It could help by creating some "variables" page within "global" book or something like that and then on each line specify "variable", which would be then linked in different pages.
But as I tried things some weeks ago, I believe there was a problem with that - it inserts the block into a new book. Not in the middle of text for example.
So the foundations are there. But some specific tab in settings, where you specify book-wise or site-wise variables that can be inserted anywhere (and they would be respecting formatting), would be great :-)

@SonGokussj4 commented on GitHub (Sep 20, 2022): Yes, I know about that and tried to use that. It could help by creating some "variables" page within "global" book or something like that and then on each line specify "variable", which would be then linked in different pages. But as I tried things some weeks ago, I believe there was a problem with that - it inserts the block into a new book. Not in the middle of text for example. So the foundations are there. But some specific tab in settings, where you specify book-wise or site-wise variables that can be inserted anywhere (and they would be respecting formatting), would be great :-)
Author
Owner

@bhsmither commented on GitHub (Sep 20, 2022):

My experiments (that had a different problem) showed that
<p id="bkmrk-this-year">2022</p>
which allowed for inline placement
Copyright {{@99#bkmrk-this-year}}, Foo Corp.<br>All rights reserved.
resulting in

Copyright 2022, Foo Corp.
All rights reserved.

It was a single experiment. I first tried <span> tags, expecting the result should be inline because a <p> tag is a block-level element. My conclusion is that it doesn't matter (from one experiment) what tag is used.

@bhsmither commented on GitHub (Sep 20, 2022): My experiments (that had a different problem) showed that ```<p id="bkmrk-this-year">2022</p>``` which allowed for inline placement ```Copyright {{@99#bkmrk-this-year}}, Foo Corp.<br>All rights reserved.``` resulting in ``` Copyright 2022, Foo Corp. All rights reserved. ``` It was a single experiment. I first tried `<span>` tags, expecting the result should be inline because a `<p>` tag is a block-level element. My conclusion is that it doesn't matter (from one experiment) what tag is used.
Author
Owner

@ssddanbrown commented on GitHub (Sep 21, 2022):

Yeah, I built the include system with in-line content in mind.

In most cases BookStack will use the child content of the referenced tag (Inner HTML) unless the tag is one of a few (Tables, Lists, maybe others) where that would cause issues, in which case the entire tag content (Outer HTML) will be used.

@ssddanbrown commented on GitHub (Sep 21, 2022): Yeah, I built the include system with in-line content in mind. In most cases BookStack will use the child content of the referenced tag (Inner HTML) unless the tag is one of a few (Tables, Lists, maybe others) where that would cause issues, in which case the entire tag content (Outer HTML) will be used.
Author
Owner

@terion-name commented on GitHub (Nov 1, 2022):

upping this. very useful feature

@terion-name commented on GitHub (Nov 1, 2022): upping this. very useful feature
Author
Owner

@ShowMeIT commented on GitHub (Mar 9, 2023):

+1 would be a useful feature.

@ShowMeIT commented on GitHub (Mar 9, 2023): +1 would be a useful feature.
Author
Owner

@leichti commented on GitHub (Jul 4, 2024):

+1 from my side. Would be extremely nice for my use case as well.

@leichti commented on GitHub (Jul 4, 2024): +1 from my side. Would be extremely nice for my use case as well.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#659