From 32d735efcbb75c2f8e836da2d88a14f054513a68 Mon Sep 17 00:00:00 2001 From: Brett O'Donnell Date: Thu, 12 Apr 2018 18:44:04 +0930 Subject: [PATCH] update docs --- src/controllers/DocsController.php | 4 +- src/views/docs/{install.php => bower-cli.php} | 49 ++++++++++++++- src/views/docs/index.php | 63 +------------------ src/views/docs/update-webhook.php | 10 +-- src/views/site/index.php | 11 ++-- 5 files changed, 61 insertions(+), 76 deletions(-) rename src/views/docs/{install.php => bower-cli.php} (50%) diff --git a/src/controllers/DocsController.php b/src/controllers/DocsController.php index 65808c1..d577b02 100644 --- a/src/controllers/DocsController.php +++ b/src/controllers/DocsController.php @@ -13,9 +13,9 @@ class DocsController extends Controller return $this->render('index'); } - public function actionInstall() + public function actionBowerCli() { - return $this->render('install'); + return $this->render('bower-cli'); } public function actionBowerFormat() diff --git a/src/views/docs/install.php b/src/views/docs/bower-cli.php similarity index 50% rename from src/views/docs/install.php rename to src/views/docs/bower-cli.php index 1fbb9f7..60a3483 100644 --- a/src/views/docs/install.php +++ b/src/views/docs/bower-cli.php @@ -5,13 +5,19 @@ use yii\bootstrap\Nav; use yii\helpers\Html; -$this->title = 'Installation'; +$this->title = 'Bower CLI'; $this->params['breadcrumbs'][] = ['label' => 'Docs', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?>
-

title) ?>

+

Using Bower to Manage Mods

+ +

You can use Bower to install Minetest mods and dependency mods quickly + and easily under Linux, Windows, and Mac OS X. Bower needs primarily two software packages named + NodeJS and Git, which are easy to install.

+ +

Installation

@@ -53,7 +59,7 @@ $this->params['breadcrumbs'][] = $this->title;
-

Configure Bower

+

Configuration

In order to connect to the minetest-bower registry you need to configure bower.

@@ -65,4 +71,41 @@ $this->params['breadcrumbs'][] = $this->title; "directory" : "mods" } +

Usage

+ +
+
+

Install Mods

+ +

Install mods and their dependencies with bower install.

+
$ bower install <mod>
+
+
+

Search Mods

+ +

Find mods that you can install with + bower search or .

+
$ bower search <keyword>
+
+# for example
+$ bower search rainbow
+
+
+

Register Mods

+ +

Register mods with + bower register or .

+
$ bower register <my_mod_name> <git_endpoint>
+
+# for example
+$ bower register rainbows https://github.com/user/rainbows.git
+ +

Optionally, to add more information about your mod such as description, screenshots, authors and + licence, you can submit a JSON file along with your mod. To do so add a + bower.json file to to your mod's git repository. For the format to be + used, . +

+
+
+
diff --git a/src/views/docs/index.php b/src/views/docs/index.php index d50efe4..83a6f60 100644 --- a/src/views/docs/index.php +++ b/src/views/docs/index.php @@ -12,70 +12,9 @@ $this->params['breadcrumbs'][] = $this->title;

title) ?>

-

Using Bower to Manage Mods and Dependencies

- -

If you are familiar with CLI, you can use Minetest Bower to install Minetest mods and dependency mods quickly - and easily under Linux, Windows, and Mac OS X. Minetest Bower needs primarily two software packages named - NodeJS and Git, which are easy to install.

- -
-
- -

Install Bower

- -

Bower is a command line utility. It requires NodeJS and npm and - Git.

-
$ npm install -g bower
- -

Create a - .bowerrc file in your home directory or minetest folder with the following contents. -

-
{
-    "registry": "https://minetest-bower.herokuapp.com/",
-    "directory" : "mods"
-}
-

'btn btn-sm btn-default']); ?>

- -
-
- -

Install Mods

- -

Install mods and their dependencies with bower install.

-
$ bower install <mod>
- -

Search Mods

- -

Find mods that you can install with - bower search or .

-
$ bower search <keyword>
-
-# for example
-$ bower search rainbow
- -

Register Mods

- -

Register mods with - bower register or .

-
$ bower register <my_mod_name> <git_endpoint>
-
-# for example
-$ bower register rainbows https://github.com/user/rainbows.git
- -

Optionally, to add more information about your mod such as description, screenshots, authors and - licence, you can submit a JSON file along with your mod. To do so add a - bower.json file to to your mod's git repository. For the format to be - used, . -

- -
-
- -

Other Documentation

- [ - ['label' => 'Installation', 'url' => ['/docs/install']], + ['label' => 'Bower CLI', 'url' => ['/docs/bower-cli']], ['label' => 'bower.json Format', 'url' => ['/docs/bower-format']], ['label' => 'Update Webhook', 'url' => ['/docs/update-webhook']], ['label' => 'Semantic Versioning', 'url' => ['/docs/semver']], diff --git a/src/views/docs/update-webhook.php b/src/views/docs/update-webhook.php index 164e708..6c37762 100644 --- a/src/views/docs/update-webhook.php +++ b/src/views/docs/update-webhook.php @@ -1,8 +1,9 @@ title = 'Update Webhook'; $this->params['breadcrumbs'][] = ['label' => 'Docs', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; @@ -11,19 +12,20 @@ $this->params['breadcrumbs'][] = $this->title;

title) ?>

-

Adding a webhook to your repository will update minetest-bower with the latest information each time you push a change.

+

Adding a webhook to your repository will update minetest-bower with the latest information each time you push a + change.

GitHub

Create a new webhook and enter - $model->name], true); ?> into the + 'YOUR_MOD_NAME'], true); ?> into the Payload URL, then click Add webhook.

BitBucket

Create a new webhook and enter - $model->name], true); ?> into the URL.

+ 'YOUR_MOD_NAME'], true); ?> into the URL.

diff --git a/src/views/site/index.php b/src/views/site/index.php index e4cc1e2..cb2bf75 100644 --- a/src/views/site/index.php +++ b/src/views/site/index.php @@ -19,11 +19,10 @@ $this->params['jumbotron'] = '/site/_index-jumbotron';
-

About Minetest Mods

- -

Minetest Mods is a Minetest mod repository. The repository is unmoderated, anybody may . - Different versions by different people of similar mods are permitted but - each version must have different names.

+

Minetest Mods is a Minetest mod repository. The repository is unmoderated, anybody may + . + Different versions by different people of similar mods are permitted but each version must have a different + name. A mod can be deleted by deleting the source repo and then clicking update from the mod page.

If you'd like to run a Minetest Mods mirror, this is encouraged and simple to set up. Simply copy the to your website and update it periodically.

@@ -35,6 +34,7 @@ $this->params['jumbotron'] = '/site/_index-jumbotron'; Mod List'; + echo '
'; $items = []; foreach (\app\models\Package::find()->orderBy(['name' => SORT_ASC])->all() as $package) { $items[] = Html::a($package->name, ['mod/view', 'name' => $package->name]); @@ -43,6 +43,7 @@ $this->params['jumbotron'] = '/site/_index-jumbotron'; 'encode' => false, 'class' => 'list-inline', ]); + echo '
'; //echo '
'; //$searchModel = new PackageSearch(); //$query = Package::find();