Warning
This is a read-only repository used to release the subtree. Any issues and pull requests should be forwarded to the upstream Nebula repository.
linkorb/wiki-bundle
adds a wiki to Symfony web applications.
- Store and manage wiki content in-app or from external sources
- Import/export wikis
- Easily track events and changes
- Create wiki pages from existing templates
- Format wiki pages with Markdown
- Enforce strict wiki access control
Open a command console at the root of your project and execute the following command.
composer require linkorb/wiki-bundle
-
Ensure the bundle is registered in your Symfony application by adding the following to the config/bundles.php script if the entry doesn't already exist.
<?php // config/bundles.php return [ // ... LinkORB\Bundle\WikiBundle\LinkORBWikiBundle::class => ['all' => true], // ... ];
-
Register the bundle's routes by creating a config/routes/linkorb-wiki-bundle.yaml file with the following as its contents.
wiki_bundle: resource: '@LinkORBWikiBundle/src/Controller' type: attribute
-
Append the following block in the application's base twig template.
{% block sidebar %}{% endblock %} {% block submenu %}{% endblock %}
Use Symfony security roles defined in your application to control who can access or modify a wiki by setting the appropriate rules in the Read role and Write role fields of the Add wiki form of a Symfony application.
The config
field of this bundle's Add wiki form may be used to customize a wiki using the following settings (in YAML format):
Setting | Type | Description |
---|---|---|
read-only |
Boolean | Allows or denies users wiki page creation and editing permissions. This should be set to true if a wiki is externally managed (on GitHub for example). |
pull
| Array |
Settings for pulling changes from a wiki that is managed on a third-party platform like GitHub. Each item (repository) in the array takes the following required settings:
|
push
| Array |
Settings for pushing changes from a wiki to a third-party platform where the wiki's content is stored. Each item (repository) in the array takes the following required settings:
|
For example, setting the following wiki configuration prevents users from creating and editing wiki pages that are managed externally (e.g., in a GitHub repository).
# wiki.config
read-only: true
push:
- type: git
url: https://github.com/<USERNAME>/<WIKI-REPOSITORY.git>
secret: `ENV:WIKI_GIT_TOKEN`
pull:
- type: git
url: https://github.com/<USERNAME>/<WIKI-REPOSITORY.git>
secret: `ENV:WIKI_GIT_TOKEN`
Tip
Git publish and pull links are in the wiki page's admin dropdown.
Note
If the GitHub repository is not empty, pull from it first to sync the repository before pushing any changes.
Check out our other projects at engineering.linkorb.com.