Download the PHP package matthiasnoback/leanpub-sampler without Composer

On this page you can find all versions of the php package matthiasnoback/leanpub-sampler. 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 leanpub-sampler

Leanpub Sampler

This tool can be used to generate sample text for Leanpub books.

Installation

Install with Composer. Add a composer.json file to the root of your Leanpub book project (one directory higher than manuscript/):

{
    "require": {
        "matthiasnoback/leanpub-sampler": "~0.1"
    }
}

Then run composer update. A vendor/ directory will be created, containing the Leanpub sampler and its dependencies.

Usage

First you need to edit your manuscript files and add markers for the sample texts:

# A regular chapter

## A regular section

Some text.

%% begin sample

## A sample section

Some sample text.

%% end sample

Then run:

php vendor/bin/generate-sample.php

The sampler will generate sample text based on the %% begin sample and %% end sample markers. It scans all .txt or .md files inside the manuscript/ directory, including its subdirectories.

The result is a new file, manuscript/sample-text.txt, that contains all the sample text.

Add all section titles (parts, chapters, sections)

Using the command-line option --all-sections or -s you can instruct the sampler to automatically add any part, chapter or section title to the sample text:

php vendor/bin/generate-sample.php -s

This is useful if you want to preserve the original structure of your manuscript in the generated sample file. It is also useful because if all the part, chapter and section titles are present in the sample file, Leanpub will add the full table of contents to the generated preview file.

Last step: mention sample-text.txt in Sample.txt

When Leanpub generates a preview file, it looks at the manuscript/Sample.txt file. All files mentioned there will be added to the generated preview file. Make sure you add the sample-text.txt file to the list too:

The contents of manuscript/Sample.txt should be:

sample-text.txt

Suggestions

The Leanpub sampler scans the manuscript files in alphabetical order. So to preserve initial order, it's best to sort your manuscript files alphabetically too, like:

00-chapter1.txt
01-chapter2.txt
...

All versions of leanpub-sampler with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
aura/cli Version ^2.0
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 matthiasnoback/leanpub-sampler contains the following files

Loading the files please wait ....