Why building a company knowledge base based on mediawiki is a good idea

    Recently, Confluence and sharepoint have almost completely ruled the knowledge base market. The systems are excellent, I don’t argue, but I personally don’t have enough flexibility and, in general, somehow didn’t grow together: the sharepoint wiki-opportunities stayed somewhere at the 2005 level (I’m not talking about working with office documents, all good). Due to its peculiarities, confluence with the growth of the number of articles inexorably turned into a dump in which it is impossible to find anything necessary ( but maybe the problem was in me ).

    Without detracting from the dignity of these systems, I would like to talk about the possibilities that Mediawiki has.as a corporate knowledge base. Of course, mediawiki is not suitable for everyone - there is no fashionable integration with jira / tfs / etc, the transfer of documents with pictures from the Microsoft Office package gives a lot of inconvenience, and it itself is written in PHP, which has recently served as a deterrent factor for some IT people . Nevertheless, the platform is more alive than all living things and a fair amount of people are working on its development, since the Wikimedia Foundation's family of projects is based on it .

    By itself, the wiki is pretty stingy with the possibilities, but a huge number of extensions are written for it . Most of the interesting functionality lies in the extensions, so that a good part of the article will be about them. And yes, I can not fail to note that there is a special corporate version of Mediawiki - BlueSpice , which I did not use, and therefore I cannot judge its adequacy.

    Why did you get into this and who are you at all
    Hey. My name is Nikolai, I am a QA engineer.

    $\textbf{*Сочувственные аплодисменты*}$

    QA включает в себя не только/не столько тестирование, сколько обеспечение качества в широком смысле. И среди прочих значений этого самого широкого смысла затесалась такая штука, как управление знаниями. По этой теме довольно много абстрактных статей и книг, повествующих о принципах Knowledge management, но на удивление мало конкретных рекомендаций и практически применимых идей, во всяком случае сколько-нибудь свежих. Это заставляет меня думать, что или все пользуются тем, что дают всем известные компании и радуются, или не пользуются ничем и страдают, или пилят свой тайный велосипед, о котором неловко рассказывать в приличной компании. Мне тоже неловко, но я расскажу.

    First, about the mediaiwki chips

    Before talking about extensions, it is worth mentioning what the general features of mediawiki itself are. If your account has a thousand Wikipedia edits, then you are unlikely to learn anything new from this part, you can safely skip it.

    The first and one of the most tangible buns - categories . Pages can be added to categories, the categories themselves can be added to categories. Unlike the file structure (let's forget about symlinks), a page / category can be in several categories at once. The use of categories prevents the growth of chaos with the increase in the number of articles. Especially if you periodically view lists of uncategorized articles and uncategorized categories of

    Namespaces. Wiki ideology says that everything is a page (even a category or image). In order to separate the pages of different types, the idea of ​​namespaces was added. If you wish, you can add your own namespaces to separate knowledge of different types (for example, separate namespaces for product information, utilities, guides, process descriptions, and other proprietary information).

    Also, wiki supports templates - wiki pages that can later be included in other pages. Templates support working with parameters, which turns them into something more than simple text inserts: if you wish, you can write a simple script in the template language. By the way, they say that the template language can be Turing complete .

    In addition to the templates, the Scribunto extension allows the use of lua modules inside the wiki. Modules along with templates allow you to implement many things, even without writing to your extensions.

    For example, navigation tables are based on this duet. The navigation table is, for example, this thing, which can usually be seen at the bottom of the page:

    Although they are not standard functionality, they have proven to be a convenient means of navigation and restoring order and are used almost everywhere now.

    I can not mention Mediawiki: Common.css and Mediawiki: Common.js Files that allow you to add a little customization to the wiki - for big things, it's better to use extensions.


    One of the most important parts of a wiki is the editor. It is extremely difficult to implement a wiki if it does not have a visual editor, because only a very enterprising person will agree to learn wiki markup.

    Visual editor

    Relatively fresh extension - VisualEditor solves the problem with visual editing of articles. He has his own shoals, but for most tasks it is enough. Of the most notable problems - there is not the most convenient insertion of images.

    The appearance of the visual editor is closely linked with the advent of Parsoid , a conversion service between Mediawiki syntax and html. This task turned out to be extremely nontrivial due to the fact that the mediawiki syntax developed chaotically and was not strictly defined. You can read more in the beautiful post of the official blog .

    Among the extensions that integrate with VisualEditor, you can select Graph for editing graphs, Mathfor editing mathematical formulas and SyntaxHighlight for highlighting syntax of code snippets.


    WikiEditor is a simple wikitext editor. Some tricky things are still more convenient to do through the wikitext editor, in some places visual editing is still not supported. Be that as it may, WikiEditor makes it easy to work with wikitext, and it's pretty easy to customize it .

    Editing Conflicts

    Who used in the past Mediawiki, he remembers how pain each resolution of editing conflicts became.

    TwoColConflict with beta enabled by default greatly simplifies problem solving. In the event of a conflict, you can look at the places where there is a conflict, and select the desired version of the disputed fragment. If both versions are not complete, then you can add one of them. Somehow it looks like this in the case:

    You can try it yourself on the test page .

    Forms for adding the same type of content

    The PageForms extension allows you to add content of the same type to wikis using forms. In my practice, I used forms to add registry keys, database tables and other similar generic things to the wiki.

    This extension reveals its power when using Semantic Mediawiki or its analogs. Media semantic allows you to add page properties or objects with their properties to a page. Properties are set approximately as follows (for example, on the Germany page):

    [[Имеет столицу::Берлин]]

    These properties and objects can then be obtained using the ask request or via api.

    From the resulting properties, you can display tables, build graphs, and do many other cool things . For example, in my case, on the basis of the tables added through the forms, the simplest schemas of the database are built. At the same time, the scheme can be built not for the whole product, but for a specific category. In addition to the obvious FK / PK connections, the scheme can also reflect implicit links that cannot be seen by standard charting tools.

    For registry keys, key information is pulled out of the same properties so that, based on it, it is possible to generate a .reg file with a specified value.

    Category Tree

    PageForms supports the ability to add a field with a category tree, so to add a page to the necessary categories it will be enough just to click on the necessary checkboxes.

    On the other hand, when we already have articles categorized, we can display them on any page in the form of a tree:

    The tree loads dynamically, so that it works for a large number of articles, and for looped categories, if someone suddenly needs these .

    LDAP / AD authentication

    The Ldap Authentication extension supports authorization via domain, access restriction for certain groups, and mapping of mediawiki user groups to ldap groups. You can configure multiple domains. Pretty tedious in matters of customization, but, fortunately, there are some very good instructions on the Internet .

    Granular access rights

    Here everything is bad. If the task is to restrict access to unauthorized users, then this is easy. If among these users it is necessary to select separate groups with special access rights, then it is difficult.

    There are many different extensions, but they do not solve the fundamental problem: mediawiki was not created as a CMS. To support the access rights, you will have to patch the Mediawiki code, adding manic


    in all that should not be given without checking the rights. The same applies to all extensions: for each added extension, you will have to manually add all the necessary checks.

    For myself, I solved the problem with a self-made extension, built on the idea of PermissionACL and packs of patches for different extensions and mediawiki itself. Fortunately, I did not need an advanced ACL, and primitive checks for several groups were enough.

    To support the same for images, you will have to wrap the calls to the files in Img_auth.php . And the latter uses a media streamer from mediawiki, which does not know how to render partial content (at the time of mediawiki 1.31), so to support video playback, you will have to attach another file streamer.

    Video support

    Video support is not included in the standard distribution , but is trivially solved by installing the TimedMediaHandler extension . An ordinary video player, nothing special. Inserting a video on a page is absolutely similar to inserting an image.


    One of the things that annoys me personally in Confluence is the search. The standard Mediawiki search is even worse, but fortunately there are third-party extensions. Of the search engine extensions, the most popular ones are CirrusSearch and SphinxSearch . I never used the last one, but I got to know the first one very closely, by the way, it is also used in projects of the Wikimedia foundation CirrusSearch

    based on elasticsearch , for the extension to work you will have to install an intermediate interface - the Elastica extension .

    CirrusSearch supports an insane number of parameters and is developing quite actively. For example, I was very pleased that in the 1.32 branch I started searching for CamelCase.

    Another point that I liked was the ability to add a dictionary of synonyms. The dictionary works well with well-established internal corporate jargon, abbreviations, typical typos or various transliterations. But you need to write the dictionary first, which may not be the easiest task. If you do not sharpen the dictionary for a particular company, you can try existing dictionaries in the spirit of WordNet , but not the fact that they suit you personally.

    The extension does not support adding synonyms at the LocalSettings config level , but it is easy to solve by editing the extension code - see AnalysisConfigBuilder.php and the instructions for setting up synonym elasticsearch .

    If you wish, you can add a search line to the main page via the InputBox extension , after which you can fasten auto-completion according to the instructions .

    By the way, AdvancedSearch will help put in order the look of the search page, with it it will not look like a victim of a checkbox fan.


    It sounds ridiculous, of course, but the analyst is extremely useful even for the internal knowledge base, which is visited by a hundred people a month. It allows you to understand how users interact with the interface, what they are looking for, what they read, what they use. If the plans have a further development of the knowledge base, the statistics will be invaluable.

    For intranets, there is an extremely decent expansion of Matomo (ex Piwik). The appropriate integration extension is MatomoAnalytics .

    Matomo collects statistics on search queries, traffic sources, downloads, link clicks (you can see the frequency of link clicks overlaid on the page itself) and many other metrics. Statistics can be collected both with reference to specific users, and anonymous, so as not to embarrass anyone.


    In addition to the above, there are quite a few extensions that simply make life easier. For example, GuidedTour for teaching newbies the basics of working with interfaces, Popups for previewing articles on hovering over a link, MultimediaViewer for more comfortably viewing full-size images and much, much more.

    What is the result?

    The listed gentleman's set of extensions covers a significant part of the need to create a knowledge base, but not all. Mediawiki is not suitable as a universal single knowledge base. But as a universal system, all the others also do poorly - sharepoint, confluence, old school outlook daddies, the search for which takes half an hour, etc. Mediawiki on their background is distinguished by its customization capabilities and excellent scalability.

    In contrast to all the advantages mentioned above, mediawiki constantly requires that a file be doped out of the functional for the needs of a particular company, so its administrator should be mentally prepared to understand php, js and lua code. But if it doesn't scare and if you agree to share work with office documents and work with wiki articles across different platforms, mediawiki as a knowledge base can be a pretty good idea.

    Only registered users can participate in the survey. Sign in , please.

    What do you use as a knowledge base?

    Is it worth revealing the topics mentioned briefly?

    Also popular now: