• Stars
    star
    111
  • Rank 314,510 (Top 7 %)
  • Language
    PHP
  • License
    MIT License
  • Created over 5 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Dash Docset Builder in PHP. πŸ“‚οΈ

DASH DOCSET BUILDER

latest stable version build status quality score code coverage total downloads

That shit creates Dash Docsets for you. Of course you still need to declare some stuff in your own class. That shit doesn't read minds yet. See more below.


DASH IS LOVE

When coding with Sublime + Chrome in Split View, Dash is the savior ❀️

HOW TO USE (ALSO KNOWN AS USAGE)

Install the awesome tool (ambiguous meaning)

composer require godbout/dash-docset-builder

Generate your pretty Docset class

dash-docset new my-pretty-docset

You now have a beautiful MyPrettyDocset class that you're gonna have to edit. See below.

Edit your pretty Docset class

Your Docset Class has to extend the BaseDocset class that implements the Docset interface. That allows the Builder to make your Docset with just a little configuration.

Your Docset Class has to define the following constants:

// To generate the docset filename
public const CODE = 'tailwindcss';
// What name will show up in Dash
public const NAME = 'Tailwind CSS';
// Where to download the doc from
public const URL = 'tailwindcss.com';
// What page should the docset show by default
public const INDEX = 'installation.html';
// A link to try the service/app, if any
public const PLAYGROUND = 'https://codesandbox.io/s/github/lbogdan/tailwindcss-playground';
// Where to grab the icon in 16x16 res
public const ICON_16 = 'favicon-16x16.png';
// Where to grab the icon in 32x32 res
public const ICON_32 = 'favicon-32x32.png';
// List of external domains where images or other files have to
// be downloaded, if not from URL defined above
public const EXTERNAL_DOMAINS = [
    'refactoring-ui.nyc3.cdn.digitaloceanspaces.com',
    'jsdelivr.net',
    'code.jquery.com',
    'rsms.me',
    'googleapis.com',
];

Then there are two mandatory methods to define:

/**
 * This method is responsible for generating the Dash Table of Contents
 *
 * For each HTML file of your downloaded doc, this method will be called.
 * You have to parse the file (how you want) and return a collection of
 * entries. See Docsets in
 * https://github.com/godbout/dash-docsets/tree/master/app/Docsets
 * for examples.
 */
public function entries(string $file): Collection
{
    $crawler = HtmlPageCrawler::create(Storage::get($file));

    $entries = collect();
    $entries = $this->generateEntries($crawler, $file);
        
    return $entries;
}

/**
 * This method is responsible for formatting the doc for Dash
 *
 * For each HTML file of your downloaded doc, this method will be called.
 * You have to update the content of the file and return that content.
 * The file is passed as argument rather than its content because sometimes
 * the file name is the only way you have to generate the Dash Online Redirection.
 * See Docsets in 
 * https://github.com/godbout/dash-docsets/tree/master/app/Docsets
 * for examples.
 */
public function format(string $file): string
{
    $crawler = HtmlPageCrawler::create(Storage::get($file));

    $this->modifyHtml($crawler, $file);

    return $crawler->saveHTML();
}

The Builder provides a generic way to download your Docset docs. It'll use a sitemap.xml if found, else it'll go through your Docset index. If you need to provide your own way of downloading your docs, you can define a grab() method in your Docset. The Builder will catch it and use your custom method instead.

public function grab(): bool
{
    system(
        "wget doc.tiki.org/All-the-Documentation \
            --mirror \
            -e robots=off \
            --header 'Cookie: javascript_enabled_detect=true' \
            --reject-regex='/Plugins-|Plugins\.html|fullscreen=|PDF\.js|tikiversion=|comzone=|structure=|wp_files_sort_mode[0-9]=|offset=|\?refresh|\?session_filters|\?sort_mode' \
            --accept-regex='/Plugin|/LIST|Tiki_org_family|\.css|\.js|\.jpg|\.png|\.gif|\.svg|\.ico|\.webmanifest' \
            --page-requisites \
            --adjust-extension \
            --convert-links \
            --span-hosts \
            --domains={$this->externalDomains()} \
            --directory-prefix=storage/{$this->downloadedDirectory()}",
        $result
    );

    return $result === 0;
}

Build your Docset

Once your class is set up, run:

dash-docset build my-pretty-docset

This will download the doc, package it into a .docset file, and create an archiveβ€”useful if you want to contribute it to Dashβ€”in the storage folder.

ENJOY

Enjoy your new fresh Docset and maybe also share it with the community that would be nice kiss kiss: https://github.com/Kapeli/Dash-User-Contributions.

DOCSETS GENERATED WITH THIS BUILDER

Elderlies go first:

More Repositories

1

kindaVim.docs

Ultimate Vim Mode for macOS
613
star
2

Wooshy.docs

it's like Alfred but for the UI
216
star
3

alfred-time

Start and stop tracking time with Toggl, Harvest, Everhour or Clockify through Alfred 4. ⏰️
PHP
110
star
4

Scrolla.docs

Scroll with Vim motions under macOS
64
star
5

tailwindcss-dash-docset

TailwindCSS Dash Docset, built with the Dash Docset Builder in PHP. We needed it. 🌈️
HTML
59
star
6

WooshyWindowToTheForeground

Alfred Workflow to be used with Wooshy, that brings any macOS windows to the foreground
Swift
53
star
7

alfred-airplay

Extend your display to an AirPlay device directly from Alfred. No need for endless clicking here and there.
Shell
33
star
8

AlfredKat

the infamous alfred-kat but in Swift because macOS is getting rid of the PHP interpreter.
Swift
32
star
9

kindaVim

The kindaVim App Core and kVEngine Core.
Swift
22
star
10

AlfredWorkflowScriptFilter

it's like the PHP alfred-workflow-scriptfilter except it's in Swift and therefore it's more better β˜€οΈ
Swift
18
star
11

AlfredWorkflowUpdater

add a background updater for your Alfred Workflow in under a minute ⏲️
Swift
17
star
12

alfred-workflow-scriptfilter

Generate Alfred 3 or 4 Workflow Results in PHP with a laugh.
PHP
17
star
13

alfred-kat

KAT workflow for Alfred, search and open magnet links directly from Alfred.
PHP
16
star
14

alfred-docker-dashboard

Opens the Dashboard of Docker that is annoyingly hidden in the menu bar ☹️
AppleScript
15
star
15

alfred-workflow-workflow

Takes care of all the Alfred glue for you so that you need to code only what is specific to your Workflow.
PHP
7
star
16

AccessibilityStrategyTestApp

test application for the AccessibilityStrategy of kindaVim. stand-alone application needed due to UI Tests for Swift package.
Swift
7
star
17

AlfredOnePee

Alfred `1p` without 1Password
Swift
7
star
18

alfred-music-volume

Control the volume of your Music.app from Alfred
Shell
6
star
19

alfred-workflow-config

Manage settings easily for your Alfred 3 or 4 Workflows.
PHP
3
star
20

alpinejs-dash-docset

Alpine.js Dash Docset, built with the Dash Docset Builder in PHP. I'm probably gonna fail this one. πŸ§—πŸ½οΈ
HTML
3
star
21

AXBugsWithCatalystApps

FB9813359.
Swift
3
star
22

dash-docsets

Dash Docsets, built with the Dash Docset Builder in PHP. It's beautiful.
HTML
3
star
23

laravel-zero-dash-docset

Laravel Zero Dash Docset, built with the Dash Docset Builder in PHP. Because vous le valez bien.
HTML
2
star
24

Commands

Commands part of kindaVim.
Swift
2
star
25

KeyCombination

KeyCombination part of kindaVim.
Swift
2
star
26

AXEngine

AXEngine part of kindaVim.
Swift
2
star
27

webpack-dash-docset

webpack Dash Docset, built with the Dash Docset Builder in PHP. That. Was. Necessary. πŸ“¦οΈπŸ“¦οΈπŸ“¦οΈ
HTML
2
star
28

vocabulary-builder

Record your new vocabulary, and train yourself.
PHP
2
star
29

AccessibilityStrategy

AccessibilityStrategy part of kindaVim.
Swift
2
star
30

alfred-dash-docset

Alfred Dash Docset, built with the Dash Docset Builder in PHP. 🎩️s off.
HTML
2
star
31

KeyboardStrategy

KeyboardStrategy part of kindaVim.
Swift
2
star
32

alfred-ploi

Alfred Workflow for Ploi. Currently handling almost nothing. But handling it very, very well.
PHP
2
star
33

AlfredBrook

start your Brook VPN through Alfred. FAAAAAAAAAAAAAAAST.
Shell
2
star
34

Common

Common part of kindaVim.
Swift
2
star
35

sleeplessmind-color-scheme

Sleeplessmind (Dark) Color Theme for Sublime Text 2/3/4
2
star
36

laravel-mix-dash-docset

Laravel Mix Dash Docset, built with the Dash Docset Builder in PHP. Is that a mixtape? πŸ“ΌοΈπŸ“ΌοΈπŸ“ΌοΈ
HTML
1
star
37

alfred-canto

personal project to easily record and search cantonese words (tones) that i'm still struggling with while drinking in Thailand
PHP
1
star
38

TheInputVentura

FB10749885
Swift
1
star
39

ploi-api-dash-docset

Ploi Dash Docset, built with the Dash Docset Builder in PHP. πŸš€οΈπŸš€οΈπŸš€οΈ
HTML
1
star
40

bulma-dash-docset

Bulma Dash Docset, built with the Dash Docset Builder in PHP. Nosebleed. 🩸️🩸️
PHP
1
star
41

sublime-text-helpers

Collection of personal snippets, packages, etc... that help with faster and more fun coding
1
star
42

AlfredDummy

dummy Alfred Workflow to ensure the test suite from AlfredWorkflowUpdater is not full of πŸ’©οΈπŸ’©οΈπŸ’©οΈ
1
star
43

docker-tiki

Pile of files to create the godbout/tiki docker image
1
star
44

chartjs-plugin-datalabels-dash-docset

chartjs-plugin-datalabels Dash Docset, built with the Dash Docset Builder in PHP. Because plugins too need some love ❀️
HTML
1
star
45

tiki

Tiki sparkled with some magic.
PHP
1
star
46

binance-dash-docset

Future part for xilopaint πŸ’ΉοΈπŸ’ΉοΈπŸ’ΉοΈ
HTML
1
star
47

tiki-dash-docset

Tiki Dash Docset, built with the Dash Docset Builder in PHP. And another one.
HTML
1
star
48

nanoc-compass-lessframework

This is a small package that you can use as a start if you want to develop a website/blog using the awesome nanoc, compass and lessframework
Ruby
1
star
49

wp_weekposts_widget

A simple Wordpress widget to show the current week or the last week (optionable) posts. Needed that for one of my project so here it is.
PHP
1
star
50

AlfredWorkflows

repo coz i have no memory of what i do coz i'm old
1
star
51

chartjs-dash-docset

Chart.js Dash Docset, built with the Dash Docset Builder in PHP. πŸ’ΉοΈπŸ“ˆοΈπŸ“‰οΈπŸ“ŠοΈ
HTML
1
star
52

TetraPack

plugin for the sublime 'Sublime Text 2' editor that will make your hands stand still
1
star
53

jigsaw-dash-docset

Jigsaw Dash Docset, built with the Dash Docset Builder in PHP. Build build build! 🧩️
HTML
1
star
54

sleeplessmind-zsh-theme

zsh theme focused on simple git integration
1
star