BookStack
BookStack copied to clipboard
Request - Global variables that load in-line with documentation text
For Feature Requests
Desired Feature:
- New table added to bookstack which contains variable names and values.
- New page added somewhere to manage the table of variables, though dev ops teams can just use the table too.
- On page load, variable placeholders will be replaced with their match. Non-matches can either load as empty text or 'MISSING' or whatever.
- 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.
👍
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.
+1 for this
+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@ ;)
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/
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 :-)
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.
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.
upping this. very useful feature
+1 would be a useful feature.
+1 from my side. Would be extremely nice for my use case as well.