Download the PHP package elazar/league-commonmark-obsidian without Composer

On this page you can find all versions of the php package elazar/league-commonmark-obsidian. 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 league-commonmark-obsidian

League Commonmark Obsidian Extension

PHP Version Support Packagist Version Buy Me a Cofee

An extension for league/commonmark to render elements specific to Obsidian.

Released under the MIT License.

Requirements

Installation

Use Composer.

If you want to install this library globally to use the conversion script it provides:

If you want to install this library locally for use in your own codebase:

Usage

There are three ways to use this library.

Conversion Script

The conversion script requires only a single command to run, but offers a very minimal conversion with no options for customization. It is mainly intended to provide a minimal example of using the converter (see the next section), but can be invoked like so:

Extension

If you want to use the extension in your own code, you can do so as follows.

Converter

The converter is a single class that can be used in your own conversion script or other code. It requires writing a bit of PHP code to use it, but offers more options for customization than the stock conversion script, such as including more extensions in the environment configuration or formatting the converted HTML.

Below is an example that adds the Strikethrough extension and a custom formatter that wraps the converted HTML in additional markup.

Internals

In some instances, it can be helpful to be familiar with the internals of this library.

Here are some example use cases:

  1. If you want to contribute to this library, it's helpful to know what parts of the codebase you may need to modify to implement a given feature or fix a given bug.
  2. If you find a bug in this library and want to work around it, it may be possible to do so by overriding specific components of the library.
  3. If Obsidian adds support for a new attachment file type and you want to add support for it to this library before it's added to the library's core, you may be able to do so by adding to the embed renderers it uses.

Extension

The normal use case for LeagueCommonMarkObsidianExtension is for it to receive a vault path and attachments path. In lieu of these, it can receive other dependencies detailed in subsequent sections of this document.

The main function of the extension is to add two inline parsers to the environment: InternalLinkParser for internal links and EmbedParser for embeds.

The internal link parser renders a natively supported link element. The embed parser uses its own renderers to render custom inline HTML elements, as at least some of these are not natively supported by CommonMark.

Embed Renderer

The EmbedRendererInterface $embedRenderer parameter of LeagueCommonMarkObsidianExtension is used to render embeds.

The default used for $embedRenderer is an instance of EmbedRenderer, which extends CompositeEmbedRenderer and composes all other renderers included in this library. It attempts to use each of these renderers in turn to render a given embed.

Attachment Link Resolver

The LinkResolverInterface $attachmentLinkResolver parameter of LeagueCommonMarkObsidianExtension is used to resolve links for embedded attachments.

The default used for $attachmentLinkResolver is an instance of AttachmentLinkResolver, which uses the vault and attachment paths to resolve attachment links and embeds relative to the Markdown file being rendered as HTML.

Internal Link Resolver

The LinkResolverInterface $internalLinkResolver parameter of LeagueCommonMarkObsidianExtension is used to resolve internal links.

The default used for $internalLinkResolver is an instance of InternalLinkResolver, which uses the vault path to resolve internal links relative to the Markdown file being rendered as HTML.

Contributing

Regardless of how you want to contribute, please start by filing an issue.

Issues

Please prefix issue titles with one of the following:

Doing this allows for discussion with maintainers to troubleshoot problems, confirm bugs, or determine how best to make suggested features work.

In cases where you wish to contribute code, this discussion may help to clarify your implementation approach and reduce potential rework required on your part to get your contribution merged.

Help requests are closed once they are resolved or if they are inactive for 30 days. Other issues are left open until either a related PR is merged or a formal decision is made by the maintainers that no further action will be taken.

Pull Requests

Once consensus is reached on a bug or feature implementation approach, file a PR using a branch with a name prefixed with either bug/ or feature/ for a bug report or feature request respectively.

Please be sure to reference the original issue you filed in your PR description to provide context for the changes.


All versions of league-commonmark-obsidian with dependencies

PHP Build Version
Package Version
Requires league/commonmark Version ^2.3
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 elazar/league-commonmark-obsidian contains the following files

Loading the files please wait ....