Download the PHP package joeymckenzie/artisense without Composer
On this page you can find all versions of the php package joeymckenzie/artisense. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download joeymckenzie/artisense
More information about joeymckenzie/artisense
Files in joeymckenzie/artisense
Package artisense
Short Description Laravel docs from the comfort of your own terminal.
License MIT
Homepage https://github.com/artisense/artisense
Informations about the package artisense
Artisense 📕
Laravel docs from the comfort of your terminal.
Table of Contents
- Motivation
- How it works
- Requirements
- Getting started
- Usage
- Versions
- Formatting
- Changelog
- Credits
- License
Motivation
Artisense is meant to be a local-first offline copy of the Laravel documentation. Artisense is a set of artisan commands that allow you to locally store and search the laravel documentation from the comfort of your terminal.
If you're anything like me and living in the terminal, those precious seconds alt + tabing between code editor and
browser to review the Laravel documentation really adds up (who has that kinda time?). Why not make docs accessible from
the terminal?
How it works
At its core, artisense is a SQLite database that lives within your storage_path() underneath an artisense/ folder:
Artisense uses SQLite to store documentation pulled from the Laravel
documentation source.
The documentation is downloaded as a zip file, extracted into a artisense/docs-{version}.x/ folder, then processed
into sections to allow full-text search using SQLite's FTS5 extension. Since
artisense is just a SQLite file, you may connect and query it like any other SQLite database.
Requirements
- Laravel 12 or greater
- PHP 8.4 or greater
Getting started
Install artisense with composer:
You may also publish the configuration file with:
This will create the following config/artisense.php file:
Artisense has a few tuning knobs within its configuration:
-
Version: specifies the version to run queries against, as multiple versions of the documentation may all be stored alongside one another
- Accepts either a single
DocumentationVersionor an array ofDocumentationVersions, e.g.
- Accepts either a single
- Formatter: specifies any custom formatting the markdown output should use when results are found
- Search preference: SQLite full-text search preference, either
orderedorunordered - Search proximity: relative distance between terms full-text search should consider when querying using an
unorderedpreference
Usage
First, prepare artisense by running the install command:
You'll be prompted with a choice of versions to install:
Artisense uses Laravel Prompts, so any supported version of the documentation may be selected. Multiple versions of the documentation may be selected, where each will be processed and stored within the database allowing for querying across Laravel versions.
The install command will do a few things:
- Download the Laravel markdown documentation files based on the configured version
- Create a local SQLite database in your project within the storage folder under
storage/artisense - Seed the database with the processed Laravel documentation
Usage
Artisense uses SQLite's full-text search extension FTS5 to query Laravel
documentation. Once you've successfully installed a version of the documentation using artisense, you may use the
artisense:search artisan command to search relevant sections:
If any relevant documentation is found, matches will be displayed in the terminal:
and if you select an entry:
Laravel Pennant - Defining Features Externally - 12.x
Defining Features Externally
If your driver is a wrapper around a third-party feature flag platform, you will likely define features on the platform rather than using Pennant's
Feature::definemethod. If that is the case, your custom driver should also implement theLaravel\Pennant\Contracts\DefinesFeaturesExternallyinterface:The
definedFeaturesForScopemethod should return a list of feature names defined for the provided scope.Learn more: https://laravel.com/docs/12.x/pennant#defining-features-externally
By default, artisense returns the raw markdown from the content that was used to find the relevant section. A link to the section within the documentation will also included.
Versions
Within your artisense.php configuration file, you may specify one or more versions of Laravel documentation to use
when processes, storing, and searching documentations with artisense commands:
When installing documentation, artisense will default to using the versions specified within your configuration file. When using the search commands, artisense will also use whichever versions are specified within your configuration to filter on search results.
For example, if you have versions 12.x, 11.x, and master installed, all search results will be returned:
Formatting
You may customize the output of the artisense:search command through the use of
an output formatter.
The search command will output the raw markdown processed from the identified documentation section, though if an output
formatter is specified within configuration, it will use that format the output.
By default, artisense includes two simple output formatter:
- a basic markdown formatter
- a glow-based output formatter (requires glow to be installed)
You may specify a custom formatter within your artisense.php configuration:
You may then implement the OutputFormatterContract to format the markdown:
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
- Joey McKenzie
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of artisense with dependencies
ext-zip Version *
illuminate/contracts Version ^12.0
league/commonmark Version ^2.7