cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [1/2] docs commit: CB-11412 Added docs for template use and create
Date Tue, 23 Aug 2016 00:56:05 GMT
Repository: cordova-docs
Updated Branches:
  refs/heads/master c35148256 -> f1ce7647c


CB-11412 Added docs for template use and create

 This closes #612


Project: http://git-wip-us.apache.org/repos/asf/cordova-docs/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-docs/commit/dc09bd8f
Tree: http://git-wip-us.apache.org/repos/asf/cordova-docs/tree/dc09bd8f
Diff: http://git-wip-us.apache.org/repos/asf/cordova-docs/diff/dc09bd8f

Branch: refs/heads/master
Commit: dc09bd8f10bf2316b847b1e0c04dabb269c9435d
Parents: c351482
Author: carynbear <caryn.tran@berkeley.edu>
Authored: Fri Jun 17 10:53:55 2016 -0700
Committer: Steve Gill <stevengill97@gmail.com>
Committed: Mon Aug 22 17:55:11 2016 -0700

----------------------------------------------------------------------
 www/_data/redirects.yml               |   1 +
 www/_data/toc/en_dev-src.yml          |   1 +
 www/docs/en/dev/guide/cli/index.md    |   2 +
 www/docs/en/dev/guide/cli/template.md |  72 +++++++++++++++++++++++++++++
 www/static/img/guide/cli/template.png | Bin 0 -> 72193 bytes
 5 files changed, 76 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/dc09bd8f/www/_data/redirects.yml
----------------------------------------------------------------------
diff --git a/www/_data/redirects.yml b/www/_data/redirects.yml
index 7280bb8..83cd424 100644
--- a/www/_data/redirects.yml
+++ b/www/_data/redirects.yml
@@ -348,6 +348,7 @@ docs-global:
     "guide_appdev_privacy_index.md.html": "guide/appdev/privacy/index.html"
     "guide_appdev_whitelist_index.md.html": "guide/appdev/whitelist/index.html"
     "guide_cli_index.md.html": "guide/cli/index.html"
+    "guide_cli_template.md.html": "guide/cli/template.html"
     "guide_hybrid_plugins_index.md.html": "guide/hybrid/plugins/index.html"
     "guide_hybrid_webviews_index.md.html": "guide/hybrid/webviews/index.html"
     "guide_overview_index.md.html": "guide/overview/index.html"

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/dc09bd8f/www/_data/toc/en_dev-src.yml
----------------------------------------------------------------------
diff --git a/www/_data/toc/en_dev-src.yml b/www/_data/toc/en_dev-src.yml
index 2df8b49..15d555e 100644
--- a/www/_data/toc/en_dev-src.yml
+++ b/www/_data/toc/en_dev-src.yml
@@ -6,6 +6,7 @@
     name: Create apps
     children:
         - url: guide/cli/index.html
+        - url: guide/cli/template.html
         - url: guide/support/index.html
         -
             name: Develop for platforms

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/dc09bd8f/www/docs/en/dev/guide/cli/index.md
----------------------------------------------------------------------
diff --git a/www/docs/en/dev/guide/cli/index.md b/www/docs/en/dev/guide/cli/index.md
index c50d3db..0e0f393 100644
--- a/www/docs/en/dev/guide/cli/index.md
+++ b/www/docs/en/dev/guide/cli/index.md
@@ -85,6 +85,7 @@ This creates the required directory structure for your cordova app. By default,
 ###See Also
 - [Cordova create command reference documentation][cdv_create]
 - [Cordova project directory structure][cdv_dir]
+- [Cordova project templates][cdv_template]
 
 ## Add Platforms
 
@@ -319,6 +320,7 @@ $ cordova platform update ios --save
 [DeviceReadyEvent]: ../../cordova/events/events.html#deviceready
 [BackButtonEvent]:  ../../cordova/events/events.html#backbutton
 [Core Plugin APIs]: ../../guide/support/index.html#core-plugin-apis
+[cdv_template]:     ../../guide/cli/template.html#
 
 [CLI reference]: ../../reference/cordova-cli/index.html
 [cdv_create]:    ../../reference/cordova-cli/index.html#cordova-create-command

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/dc09bd8f/www/docs/en/dev/guide/cli/template.md
----------------------------------------------------------------------
diff --git a/www/docs/en/dev/guide/cli/template.md b/www/docs/en/dev/guide/cli/template.md
new file mode 100644
index 0000000..b3dd068
--- /dev/null
+++ b/www/docs/en/dev/guide/cli/template.md
@@ -0,0 +1,72 @@
+---
+license: >
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+title: Cordova App Templates
+description: Learn how to find, use, and create templates in Cordova.
+toc_title: Templates for apps
+
+---
+
+# Cordova App Templates
+
+## Use a Template
+
+Templates allow you to use preexisting code to jumpstart your project. 
+
+![]({{ site.baseurl }}/static/img/guide/cli/template.png)
+
+Find a template to create your app from by seaching for the keyword `cordova:template` on
[npm](https://www.npmjs.com/search?q=cordova%3Atemplate). You can also use local templates
on your computer, or a Git repository.
+
+After locating a template you wish to use. Create your project using that template, by specifying
the `--template` flag during the `create` command, followed by your template source.
+
+Creating a cordova project from an NPM package, Git repository, or local path:
+```
+$ cordova create hello com.example.hello HelloWorld --template <npm-package-name>
+$ cordova create hello com.example.hello HelloWorld --template <git-remote-url>
+$ cordova create hello com.example.hello HelloWorld --template <path-to-template>
+```
+
+After succesfully using a template to create your project, you'll want to indicate the platforms
that you intend to target with your app. Go into your project folder and [add platforms](http://cordova.apache.org/docs/en/latest/guide/cli/index.html#add-platforms).
+
+## Create a Template
+
+Begin by creating a cordova app that will become the basis for your template. Then you'll
take the contents of your app and put them into the following structure. When your template
is used, all of the contents within `template_src` will be used to create the new project,
so be sure to include any necessary files in that folder. Reference [this example](https://github.com/carynbear/cordova-template)
for details.
+
+```
+template_package/
+├── package.json   	(optional; needed to publish template on npm)
+├──	index.js 		(required)
+└── template_src/ 	(required)
+	└── CONTENTS OF APP TEMPLATE
+```
+> __NOTE__: `index.js` should export a reference to `template_src` and `package.json`
should reference `index.js`. See [the example](https://github.com/carynbear/cordova-template)
for details on how that is done.
+
+To finish off your template, edit `package.json` to contain the keyword `"cordova:template"`.
+```javascript
+{
+  ...
+  "keywords": [
+    "ecosystem:cordova",
+    "cordova:template"
+  ]
+  ...
+}
+```
+
+Congrats! You've made a template for creating a Cordova project. Share your template on npm
so that everyone can benefit from your hard work.

http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/dc09bd8f/www/static/img/guide/cli/template.png
----------------------------------------------------------------------
diff --git a/www/static/img/guide/cli/template.png b/www/static/img/guide/cli/template.png
new file mode 100644
index 0000000..589b50d
Binary files /dev/null and b/www/static/img/guide/cli/template.png differ


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message