Skip to content

linkorb/wiki-bundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Symfony 5|6|7 WikiBundle

linkorb/wiki-bundle adds a wiki to Symfony web applications.

Features

  • 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

Installation

Open a command console at the root of your project and execute the following command.

composer require linkorb/wiki-bundle

Setup

  1. 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],
        // ...
    ];
  2. 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
  3. Append the following block in the application's base twig template.

      {% block sidebar %}{% endblock %}
      {% block submenu %}{% endblock %}

Wiki access control

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.

Wiki configuration

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:
  • type: The project/version management type. Valid options include rest,clickup, and git. However, only git is supported at this time.
  • url: The target repository's HTTPS URL.
  • secret: A fine-grained or a classic GitHub personal access token that has push and pull permissions to the target repository specified in the url field.
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:
  • type: The project/version management type. Valid options include rest,clickup, and git. However, only git is supported at this time.
  • url: The target repository's HTTPS URL.
  • secret:A fine-grained or a classic GitHub personal access token that has push and pull permissions to the target repository specified in the url field.

Sample wiki configuration

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.

Brought to you by the LinkORB Engineering team


Check out our other projects at engineering.linkorb.com.