Download the PHP package ubertech-za/html-to-asciidoc without Composer

On this page you can find all versions of the php package ubertech-za/html-to-asciidoc. 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 html-to-asciidoc

HTML to AsciiDoc Converter

⚠️ BETA SOFTWARE NOTICE This package is currently in beta and is being prepared for testing in upcoming projects. Please expect possible breaking changes in future releases. We do not recommend using this package in production environments without thorough testing.

This package converts HTML to AsciiDoc markup, inspired by and architecturally based on The PHP League's html-to-markdown package. Like its inspiration, this library uses a DOM-based approach with pluggable converters to ensure reliable and extensible HTML parsing and conversion. We extend our gratitude to The PHP League for their excellent architectural foundation—if League would like to incorporate this AsciiDoc functionality into their ecosystem, they are most welcome to do so.

Tests Latest Stable Version Total Downloads License

Features

Installation

Install the package via Composer:

Framework Independence: This package works standalone with any PHP project. Laravel integration is completely optional and only activated when Laravel is detected in your project.

Quick Start

Output:

Usage

Basic Usage

The simplest way to convert HTML to AsciiDoc:

Using the Laravel Wrapper

If you're using the package in a Laravel project, you can use the provided converter wrapper:

Using the Laravel Facade

For even simpler usage in Laravel, you can use the provided facade:

Configuration Options

Customize the conversion behavior with configuration options:

Method Chaining

You can chain methods for fluent configuration:

Supported HTML Elements

Headers

Converts to:

Text Formatting

Converts to:

Links and Images

Converts to:

Lists

Converts to:

Code Blocks

Converts to:

Blockquotes

Converts to:

Tables

Converts to:

Other Elements

Configuration Reference

Option Type Default Description
header_style string 'atx' Header style (always uses = syntax for AsciiDoc)
hard_break boolean false Use \n instead of + for line breaks
list_item_style string '*' Character for unordered list items
remove_nodes string '' Space-separated list of HTML tags to remove
strip_tags boolean false Strip unknown HTML tags
suppress_errors boolean true Suppress HTML parsing errors
preserve_comments boolean false Preserve HTML comments

Advanced Usage

Custom Environment

For more control, you can create a custom environment:

Adding Custom Converters

Create custom converters for specific HTML elements:

Configuration-Aware Converters

Converters can access configuration options:

Laravel Integration

Note: Laravel integration is completely optional. The core package works independently without any Laravel dependencies. Laravel features are only available when illuminate/support is installed.

Automatic Registration

If you're using Laravel, the service provider is automatically registered when Laravel is detected. You can publish the configuration:

This will publish a config/html-to-asciidoc.php configuration file where you can set default conversion options.

Facade Registration

Add the facade to your config/app.php file if you want to use it globally:

Then use it anywhere in your application:

Dependency Injection

Use dependency injection in your controllers:

Facade Usage in Controllers

Using the facade in controllers:

Blade Templates

Use the facade in Blade templates:

Available Container Bindings

The service provider registers the following bindings:

All bindings are registered as singletons for optimal performance.

Error Handling

The converter handles malformed HTML gracefully:

Performance Considerations

Testing

Run the test suite:

Run tests with coverage:

Run static analysis:

Contributing

Contributions are welcome! Please see our contributing guidelines for details.

  1. Fork the repository
  2. Create a feature branch
  3. Write tests for your changes
  4. Ensure all tests pass
  5. Submit a pull request

Changelog

Please see CHANGELOG.md for details on recent changes.

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

Credits

This package is architecturally based on and inspired by The PHP League's html-to-markdown package. We extend our gratitude to The PHP League for their excellent architectural foundation. Like its inspiration, this library uses a DOM-based approach with pluggable converters to ensure reliable and extensible HTML parsing and conversion.

Architectural Attribution

This package borrows and adapts the following architectural patterns from thephpleague/html-to-markdown:

The implementation has been adapted specifically for AsciiDoc output format while maintaining the robust parsing and extensibility patterns established by The PHP League.

License

This package is open-sourced software licensed under the MIT license.

Related Packages


Made by Uber Technologies cc


All versions of html-to-asciidoc with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
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 ubertech-za/html-to-asciidoc contains the following files

Loading the files please wait ...