Download the PHP package professional-wiki/external-content without Composer

On this page you can find all versions of the php package professional-wiki/external-content. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package external-content

External Content

GitHub Workflow Status codecov Type Coverage Latest Stable Version Download count

MediaWiki extension that allows embedding external content, specified by URL, into your wiki pages.

External Content has been created and is maintained by Professional Wiki.

Usage

Embedding external content

External content can be embedded via the #embed parser function. This function takes a URL. Markdown and code syntax highlighting are supported. To render markdown, no additional parameters are needed. To use code syntax highlighting, refer to the parameters below.

Example:

There is special handling for GitHub URLs, removing the need to provide the raw file URL:

Embedding Bitbucket content

Content from Bitbucket can be embedded via the #bitbucket parser function.

This function takes a URL and includes the following Bitbucket-specific behavior:

Example:

Display parameters

Both #embed and #bitbucket can be customized with these parameters:

Examples:

Show Markdown file contents in a code block:

Show code block with line numbers:

Show only specific lines in a code block:

Render file as Markdown:

Refreshing external content

To refresh all the pages containing one of the parser functions added by this extension, run

php extensions/ExternalContent/maintenance/RefreshExternalContent.php

Parameters: none

Installation

Platform requirements:

The recommended way to install External Content is using Composer with MediaWiki's built-in support for Composer.

On the commandline, go to your wikis root directory. Then run these two commands:

Then enable the extension by adding the following to the bottom of your wikis LocalSettings.php file:

You can verify the extension was enabled successfully by opening your wiki's Special:Version page in your browser.

Configuration

Configuration can be changed via LocalSettings.php.

Rendering markdown

By default, markdown is rendered rather than shown in a code block.

Variable: $wgExternalContentRenderMarkdownByDefault

Default: true - markdown is rendered (unless otherwise specified by the user)

Example: false - markdown is shown as a code block (unless otherwise specified by the user)

Domain whitelist

List of allowed domains to embed content from. Leave empty to have no restriction.

Variable: $wgExternalContentDomainWhitelist

Default: []

Example: [ 'git.example.com', 'another.example.com' ]

File extension whitelist

List of allowed file extensions. Leave empty to have no restriction.

Variable: $wgExternalContentFileExtensionWhitelist

Default: []

Example: [ 'md', 'txt' ]

Caution: The extension currently only supports markdown: any retrieved file content will be rendered ask markdown.

Enable embed function

If the #embed parser function should be enabled.

Variable: $wgExternalContentEnableEmbedFunction

Default: true

Example: false - disables the #embed parser function

Enable bitbucket function

If the #bitbucket parser function should be enabled.

Variable: $wgExternalContentEnableBitbucketFunction

Default: true

Example: false - disables the #bitbucket parser function

Basic Auth credentials

Per-domain Basic Auth credentials.

Variable: $wgExternalContentBasicAuthCredentials

Default: []

Example:

The above example shows how you can get credentials from ENV vars, which might be preferred over storing them as plaintext in LocalSettings.php.

Connection details

The content of files is fetched via MediaWiki's native HTTP client. This process is affected by various HTTP client variables.

Search

In stock MediaWiki with no extensions, embedded content is not searchable. To make embedded content show up in search results, install Elasticseach and the CirrusSearch extension.

Development

To ensure the dev dependencies get installed, have this in your composer.local.json:

Running tests and CI checks

You can use the Makefile by running make commands in the ExternalContent directory.

Alternatively, you can execute commands from the MediaWiki root directory:

Release notes

Version 2.0.1 - 2023-11-02

Version 2.0.0 - 2023-10-30

Version 1.3.0 - 2022-01-08

Version 1.2.0 - 2021-12-02

Version 1.1.0 - 2021-11-01

Version 1.0.0 - 2021-09-30

Initial release for MediaWiki 1.35+ with these features:


All versions of external-content with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
composer/installers Version ^2|^1.0.1
jeroen/file-fetcher Version ~6.0
jeroen/batching-iterator Version ~3.0
michelf/php-markdown Version ~1.9
ezyang/htmlpurifier Version ~4.13
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package professional-wiki/external-content contains the following files

Loading the files please wait ....