# Tips for Wiki Editors

Useful tips for editing wiki content

# Keyboard Shortcuts

The following shortcuts are available in the WYSIWYG Editor:

<table id="bkmrk-shortcut-%28windows-%26-"><thead><tr><th>Shortcut (Windows &amp; Linux/Mac)</th><th>Description</th></tr></thead><tbody><tr><td>`Ctrl+S` / `Cmd+S`</td><td>Save Draft</td></tr><tr><td>`Ctrl+Enter` / `Cmd+Enter`</td><td>Save Page &amp; Continue</td></tr><tr><td>`Ctrl+B` / `Cmd+B`</td><td>Bold</td></tr><tr><td>`Ctrl+I` / `Cmd+I`</td><td>Italic</td></tr><tr><td>`Ctrl+U` / `Cmd+U`</td><td>Underline</td></tr><tr><td>`Ctrl+1` / `Cmd+1`   
`Ctrl+2` / `Cmd+2`   
`Ctrl+3` / `Cmd+3`   
`Ctrl+4` / `Cmd+4`</td><td>Header Large   
Header Medium   
Header Small   
Header Tiny</td></tr><tr><td>`Ctrl+5` / `Cmd+5`  
`Ctrl+D` / `Cmd+D`</td><td>Normal Paragraph</td></tr><tr><td>`Ctrl+6` / `Cmd+6`  
`Ctrl+Q` / `Cmd+Q`</td><td>Blockquote</td></tr><tr><td>`Ctrl+7` / `Cmd+7`  
`Ctrl+E` / `Cmd+E`</td><td>Code Block</td></tr><tr><td>`Ctrl+8` / `Cmd+8`  
`Ctrl+Shift+E` / `Cmd+Shift+E`</td><td>Inline Code</td></tr><tr><td>`Ctrl+9` / `Cmd+9`</td><td>Callout   
(Keep pressing to toggle through styles)</td></tr></tbody></table>

# Reusing Page Content

How to use include tags to reuse pages and page content within other pages.

You may find that you want to include the same block of content in multiple places. You could copy and paste that content into multiple pages but then, if that content needs to be changed, you'd have to update it multiple times across different pages. By using include tags you can include entire other pages and also include single blocks of content from other pages.

Note that the include behaviour is non-recursive so including will only work to a single level. This ensures performance and prevents users from breaking pages by creating include loops.

### Include Tags

To include the content of a page within another you can use the following syntax:

`{{@page_id}}` or `{{@page_id#content_id}}`

You simply enter that in the page editor and then, when the page is viewed, the content will be dynamically be fetched. This means you can update the referenced content and it will show the same changes on any page the content is included within.

### Easily Grabbing the Syntax

Finding the id of a page can be difficult so a quick and easy way to find include tags is built-in. View a page with some content you want to re-use. Use your mouse to select some content and you will see a popup appear. By default this contains a direct link to that content. If you click the link icon on the left it will switch to show you the include tag for that content. Simply copy that and place it in another page. Remove the `#` and content id to include the whole content of the page instead of just a single block.

<video controls="controls" height="344" width="682"><source src="https://www.bookstackapp.com/images/2017/01/bookstack-includes-popover.webm" type="video/webm"></source></video>

### Forcing Content IDs

When including a specific block of content the id of the block is used (part after the hash). By default these are generated when you save a page. If you are using the WYSIWYG editor the id will stay the same unless the block is removed or re-formatted. In the markdown editor it changes with every save based on the content so while it may remain the same there's a good chance an ID can change therefore it's recommended to force an ID if you're using the content for includes.

**Note: All ID values must start with "bkmrk" to avoid being overwritten.**

##### WYSIWYG Editor

In the WYSIWYG editor you can force an ID by going into the source code view and adding it manually:

[![forcing-wysiwyg-ids.png](https://wiki.eternalmods.com/uploads/images/gallery/2021-09/scaled-1680-/forcing-wysiwyg-ids.png)](https://wiki.eternalmods.com/uploads/images/gallery/2021-09/forcing-wysiwyg-ids.png)

# Searching Content

The ability to search your documentation is vital to day-to-day use.

There are a few locations within BookStack where you can search for your content. Below is a list of search functions within BookStack:

- **Header Search Bar** - The search bar/link in the header of every page allows you to search from anywhere. This search is a global search which will look across all books, chapters and pages in your system. After performing a search in this box you'll be led to a search page that includes options and features that can help you build a more advanced search.
- **Book/Chapter Search Bar** - When viewing a book or chapter a search bar can be found in the top of the left sidebar. These searches will look across all child items.
- **Move &amp; Link Selection** - When choosing to move a page/chapter or when selecting a page/chapter/book to link to within the editor the most popular items are shown but you also have the ability to search.

## Advanced Search Syntax

All of the above search locations within BookStack share the ability to use advanced search syntax. An easy way to see this syntax in action is to use the global search in BookStack then play with the search filters which will update the search term with the below syntax. Below are details of the different types of syntax that can be used:

<table id="bkmrk-search-type-syntax-e" width="100%"><tbody><tr style="font-weight: bold;"><th width="16%">Search Type</th><th width="20%">Syntax</th><th width="16%">Examples</th><th>Description</th></tr><tr><td>Normal Searches</td><td>&lt;term\_a&gt; &lt;term\_b&gt;</td><td>london meeting</td><td>Normal word searches across the name and description or body of your content. When mulitple terms are searched only one term has to match your content but content containing both terms will be higher in the results.</td></tr><tr><td>Exact Searches</td><td>"&lt;term&gt;"</td><td>"london meeting"</td><td>Exact matches will require that the whole string within quotes exists in your content in exactly the same format. Use this if you're looking for an exact phrase containing or if you need to search for a term with spaces in.</td></tr><tr><td>Tag Searches</td><td class="text-small">\[&lt;name&gt;\]   
\[&lt;operator&gt;&lt;value&gt;\]   
\[&lt;name&gt;&lt;operator&gt;&lt;value&gt;\]</td><td>\[location\]   
\[=london\]   
\[location=london\]   
\[attendees&gt;5\]</td><td>Tag searches allow you to find pages which have specific tags applied. You can search by tag name, by tag value or by both name and value. When searching by tag value an operator must be used to define the match type. You can use `=`, `!=`, `<`, `>`,`<=`, `>=` or `like` as operators. When using the `like` operator you can use `%` symbols to represent wildcards in your search.</td></tr><tr><td>Filter Searches</td><td class="text-small">{&lt;filter\_name&gt;}   
{&lt;filter\_name&gt;:&lt;filter\_value&gt;}</td><td>See below</td><td>Filters perform additional advanced functionality to make your searches even more powerfull. Some filters take values but some don't need to. See below for a full list of filters available.</td></tr></tbody></table>

## Available Filters

Filters are set advanced search features that can be used in your search term. The below table shows all the filters available in BookStack and how they can be used.

<table id="bkmrk-syntax-examples-desc" style="width: 100%;" width="100%"><tbody><tr style="font-weight: bold;"><th style="width: 25%;" width="25%">Syntax</th><th style="width: 25%;" width="25%">Examples</th><th style="width: 50%;">Description</th></tr><tr style="font-weight: bold;"><td colspan="3" style="width: 100%;">Date Filters</td></tr><tr><td style="width: 25%;">{updated\_after:&lt;date&gt;}</td><td style="width: 25%;">{updated\_after:2016-12-30}</td><td style="width: 50%;">Adds the condition that the content must have been last updated after the given date.   
The date should be in the format YYYY-MM-DD</td></tr><tr><td style="width: 25%;">{updated\_before:&lt;date&gt;}</td><td style="width: 25%;">{updated\_before:2016-12-30}</td><td style="width: 50%;">Adds the condition that the content must have been last updated before the given date.   
The date should be in the format YYYY-MM-DD</td></tr><tr><td style="width: 25%;">{created\_after:&lt;date&gt;}</td><td style="width: 25%;">{created\_after:2016-12-30}</td><td style="width: 50%;">Adds the condition that the content must have been created after the given date.   
The date should be in the format YYYY-MM-DD</td></tr><tr><td style="width: 25%;">{created\_before:&lt;date&gt;}</td><td style="width: 25%;">{created\_before:2016-12-30}</td><td style="width: 50%;">Adds the condition that the content must have been created before the given date.   
The date should be in the format YYYY-MM-DD</td></tr><tr style="font-weight: bold;"><td colspan="3" style="width: 100%;">User Filters</td></tr><tr><td style="width: 25%;">{updated\_by:&lt;user\_slug|me&gt;}</td><td style="width: 25%;">{updated\_by:barry}   
{updated\_by:me}</td><td style="width: 50%;">Adds the condition that the content must have been last updated by the user of the given slug. If 'me' is used in place of a slug then it will find content that was last updated by the current logged-in user.</td></tr><tr><td style="width: 25%;">{created\_by:&lt;user\_slug|me&gt;}</td><td style="width: 25%;">{created\_by:barry}   
{created\_by:me}</td><td style="width: 50%;">Adds the condition that the content must have been created by the user of the given slug. If 'me' is used in place of a slug then it will find content that was created by the current logged-in user.</td></tr><tr><td style="width: 25%;">{owned\_by:&lt;user\_slug|me&gt;}</td><td style="width: 25%;">{owned\_by:barry}   
{owned\_by:me}</td><td style="width: 50%;">Adds the condition that the content must have be actively owned by the user of the given slug. If 'me' is used in place of a slug then it will find content that is owned by the current logged-in user.</td></tr><tr style="font-weight: bold;"><td colspan="3" style="width: 100%;">Content Filters</td></tr><tr><td style="width: 25%;">{in\_name:&lt;search&gt;}</td><td style="width: 25%;">{in\_name:London Meetings}   
{in\_name:Meetings}</td><td style="width: 50%;">Will require the content to have the given `<search>` term in the name rather than the name **or** content body.</td></tr><tr><td style="width: 25%;">{in\_body:&lt;search&gt;}</td><td style="width: 25%;">{in\_body:London Meetings}   
{in\_body:Meetings}</td><td style="width: 50%;">Will require the content to have the given `<search>` term in the body rather than both the name **or** content body.</td></tr><tr style="font-weight: bold;"><td colspan="3" style="width: 100%;">Option Filters</td></tr><tr><td style="width: 25%;">{is\_restricted}</td><td style="width: 25%;">{is\_restricted}</td><td style="width: 50%;">Will require the content to have content-level permissions active. Does not return items with only inherited asset permissions.</td></tr><tr><td style="width: 25%;">{viewed\_by\_me}</td><td style="width: 25%;">{viewed\_by\_me}</td><td style="width: 50%;">Will require the content to have been viewed by the current user at least once.</td></tr><tr><td style="width: 25%;">{not\_viewed\_by\_me}</td><td style="width: 25%;">{not\_viewed\_by\_me}</td><td style="width: 50%;">Will not return any content that has been viewed by the current user.</td></tr><tr><td style="width: 25%;">{type:&lt;content\_types&gt;}</td><td style="width: 25%;">{type:page|chapter|book}   
{type:page|chapter}   
{type:book}</td><td style="width: 50%;">Restricts the types of content that will be in the search results.   
Use of this will depend on the type of search. For example, in a chapter search only pages are shown so this has no effect.</td></tr></tbody></table>

## Search Examples

Below are some examples of using the above syntax and filters with descriptions:

- `"my cat" {viewed_by_me} {updated_after:2017-01-24}`
    - `"my cat"` - Search for content containing the exact phrase 'my cat'
    - `{viewed_by_me}` - that has been viewed by me
    - `{updated_after:2017-01-24}` - and was last updated after the 24th of Jan 2017.
- `textbook discussion [meeting] {type:page} {created_by:me}`
    - `textbook discussion` - Search content for the words `textbook` or `discussion`
    - `[meeting]` - only show content that has a `meeting` tag applied
    - `{type:page}` - only show pages, hide chapters and books
    - `{created_by:me}` - that was created by me.
- `{type:book|chapter} {created_by:me} {created_after:2016-08-12} {created_before:2017-02-18}`
    - `{type:book|chapter}` - Search all books and chapters
    - `{created_by:me}` - that were created by me
    - `{created_after:2016-08-12}` - after the 12th of Aug 2016
    - `{created_before:2017-02-18}` - but before the 18th of Feb 2017