update docs

This commit is contained in:
Brett O'Donnell 2018-04-12 18:44:04 +09:30
parent 8fd6888d18
commit 32d735efcb
5 changed files with 61 additions and 76 deletions

View File

@ -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()

View File

@ -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;
?>
<div class="docs-install">
<h1><?= Html::encode($this->title) ?></h1>
<h1>Using Bower to Manage Mods</h1>
<p>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
<a href="http://nodejs.org/">NodeJS</a> and <a href="http://git-scm.com/">Git</a>, which are easy to install.</p>
<h2>Installation</h2>
<div class="row">
<div class="col-lg-4">
@ -53,7 +59,7 @@ $this->params['breadcrumbs'][] = $this->title;
</div>
</div>
<h2>Configure Bower</h2>
<h2>Configuration</h2>
<p>In order to connect to the minetest-bower registry you need to configure bower.</p>
@ -65,4 +71,41 @@ $this->params['breadcrumbs'][] = $this->title;
"directory" : "mods"
}</pre>
<h2>Usage</h2>
<div class="row">
<div class="col-md-4">
<h3>Install Mods</h3>
<p>Install mods and their dependencies with <code>bower install</code>.</p>
<pre class="prettyprint lang-bash">$ bower install &lt;mod&gt;</pre>
</div>
<div class="col-md-4">
<h3>Search Mods</h3>
<p>Find mods that you can install with
<code>bower search</code> or <?= Html::a('browse the repository', ['/mod/index']) ?>.</p>
<pre class="prettyprint lang-bash">$ bower search &lt;keyword&gt;
# for example
$ bower search rainbow</pre>
</div>
<div class="col-md-4">
<h3>Register Mods</h3>
<p>Register mods with
<code>bower register</code> or <?= Html::a('submit a mod online', ['/mod/create']) ?>.</p>
<pre class="prettyprint lang-bash">$ bower register &lt;my_mod_name&gt; &lt;git_endpoint&gt;
# for example
$ bower register rainbows https://github.com/user/rainbows.git</pre>
<p>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
<code>bower.json</code> file to to your mod's git repository. For the format to be
used, <?= Html::a('click here', ['/docs/bower-format']); ?>.
</p>
</div>
</div>
</div>

View File

@ -12,70 +12,9 @@ $this->params['breadcrumbs'][] = $this->title;
<h1><?= Html::encode($this->title) ?></h1>
<h2>Using Bower to Manage Mods and Dependencies</h2>
<p>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.</p>
<div class="row">
<div class="col-lg-6">
<h3>Install Bower</h3>
<p>Bower is a command line utility. It requires <a href="http://nodejs.org/">NodeJS and npm</a> and
<a href="http://git-scm.com/">Git</a>.</p>
<pre class="prettyprint lang-bash">$ npm install -g bower</pre>
<p>Create a
<code>.bowerrc</code> file in your home directory or minetest folder with the following contents.
</p>
<pre class="prettyprint lang-js">{
"registry": "https://minetest-bower.herokuapp.com/",
"directory" : "mods"
}</pre>
<p><?= Html::a('Installation Guide &raquo;', ['/docs/install'], ['class' => 'btn btn-sm btn-default']); ?></p>
</div>
<div class="col-lg-6">
<h3>Install Mods</h3>
<p>Install mods and their dependencies with <code>bower install</code>.</p>
<pre class="prettyprint lang-bash">$ bower install &lt;mod&gt;</pre>
<h3>Search Mods</h3>
<p>Find mods that you can install with
<code>bower search</code> or <?= Html::a('browse the repository', ['/mod/index']) ?>.</p>
<pre class="prettyprint lang-bash">$ bower search &lt;keyword&gt;
# for example
$ bower search rainbow</pre>
<h3>Register Mods</h3>
<p>Register mods with
<code>bower register</code> or <?= Html::a('submit a mod online', ['/mod/create']) ?>.</p>
<pre class="prettyprint lang-bash">$ bower register &lt;my_mod_name&gt; &lt;git_endpoint&gt;
# for example
$ bower register rainbows https://github.com/user/rainbows.git</pre>
<p>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
<code>bower.json</code> file to to your mod's git repository. For the format to be
used, <?= Html::a('click here', ['/docs/bower-format']); ?>.
</p>
</div>
</div>
<h2>Other Documentation</h2>
<?= Nav::widget([
'items' => [
['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']],

View File

@ -1,8 +1,9 @@
<?php
/* @var $this yii\web\View */
use app\components\Git;
use yii\helpers\Html;
use yii\helpers\Url;
$this->title = 'Update Webhook';
$this->params['breadcrumbs'][] = ['label' => 'Docs', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
@ -11,19 +12,20 @@ $this->params['breadcrumbs'][] = $this->title;
<h1><?= Html::encode($this->title) ?></h1>
<p>Adding a webhook to your repository will update minetest-bower with the latest information each time you push a change.</p>
<p>Adding a webhook to your repository will update minetest-bower with the latest information each time you push a
change.</p>
<h2>GitHub</h2>
<p>Create a new webhook and enter
<code><?= Url::to(['update', 'name' => $model->name], true); ?></code> into the
<code><?= Url::to(['update', 'name' => 'YOUR_MOD_NAME'], true); ?></code> into the
<em>Payload URL</em>, then click <em>Add webhook</em>.</p>
<?= Html::img('https://cloud.githubusercontent.com/assets/51875/9213435/7cf27a68-40d1-11e5-888a-c4692ad9f4b9.png'); ?>
<h2>BitBucket</h2>
<p>Create a new webhook and enter
<code><?= Url::to(['update', 'name' => $model->name], true); ?></code> into the URL. </p>
<code><?= Url::to(['update', 'name' => 'YOUR_MOD_NAME'], true); ?></code> into the URL. </p>
<?= Html::img('https://cloud.githubusercontent.com/assets/51875/9217084/5f2da65c-4102-11e5-81b5-61b313a39aa7.png'); ?>
</div>

View File

@ -19,11 +19,10 @@ $this->params['jumbotron'] = '/site/_index-jumbotron';
<div class="body-content">
<h2>About Minetest Mods</h2>
<p>Minetest Mods is a Minetest mod repository. The repository is unmoderated, anybody may <?=Html::a('submit a mod',['mod/create'])?>.
Different versions by different people of similar mods are permitted but
each version must have different names.</p>
<p>Minetest Mods is a Minetest mod repository. The repository is unmoderated, anybody may
<?= Html::a('submit a mod', ['mod/create']) ?>.
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.</p>
<p>If you'd like to run a Minetest Mods mirror, this is encouraged and simple to set up. Simply copy
the <?= Html::a('this JSON file', ['package/index']) ?> to your website and update it periodically.</p>
@ -35,6 +34,7 @@ $this->params['jumbotron'] = '/site/_index-jumbotron';
<?php
echo '<h2>Mod List</h2>';
echo '<div class="text-justify">';
$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 '</div>';
//echo '<div class="row">';
//$searchModel = new PackageSearch();
//$query = Package::find();