Giter Club home page Giter Club logo

docs-v7's Introduction

NativeScript Documentation (v7 and below)

Home of the NativeScript documentation content that lives at http://docs.nativescript.org. Start contributing today!

What’s In This Document

Contributing

The NativeScript documentation is completely open-source and we love contributions. Whether you want to fix a typo or write an entire article, the NativeScript documentation is a great way to get started contributing to an open-source project.

Don’t know where to start? Check out the list of issues with the “help wanted” label. New to git or GitHub? Join our community Slack chat and we’ll be happy to help get you up and running.

The master branch contains the most up-to-date version of the NativeScript documentation and its contents are uploaded to docs.nativescript.org. When contributing to the documentation, always create a branch for your work from master as this will facilitate easier pull request management.

Are my contributions limited to this repo only?

No, my friend. There are many other code repositories in the NativeScript world you might also be interested in contributing to:

  • nativescript-cli - This repo contains the NativeScript command-line interface, which lets you create, build, and run apps using the NativeScript framework. The CLI is written in TypeScript.

  • nativescript-angular - This repository contains the TypeScript code that integrates Angular with NativeScript.

  • nativescript-vue - This community-run project allows NativeScript to integrate with Vue.js.

  • ios-runtime - This repo contains the NativeScript iOS runtime — the code that hosts NativeScript iOS apps, and allows JavaScript code to be executed on iOS devices. The iOS runtime is written in a fun mix of C++, Objective-C, and more.

  • android-runtime - This repo contains the NativeScript Android — the code that hosts NativeScript Android apps, and allows JavaScript code to be executed on Android devices. The Android runtime is written in a fun mix of C++ and Java.

You can go check them out and help to expand their docs, add plugins to it and even fix bugs.

About Jekyll

This documentation is built using Jekyll. More info on how to control the template, table of content and the project structure, in general, can be found in the Build README

Configuration

There are two versions of the NativeScript documentation that generate similar output: nativescript and angular. The former builds the vanilla NativeScript docs at docs.nativescript.org/start/introduction, while the latter discusses Angular-specific topics at docs.nativescript.org/angular/start/introduction.

Most of the content in this repository is shared between the two environments, but occasionally you may need to add environment-specific content. When you have this need you have a few options.

  1. If you would like a page to appear in a single environment, add an environment: angular or environment: nativescript property to that page's front matter. Pages marked with an environment property will appear in a single environment, and pages not marked with an environment property will be shared across all environments.

  2. If you have a page that should appear in both environments but has different content for certain sections, you can use our built-in environment block tags. The blocks are named angular and nativescript, respectively, and can be used like this:

{% nativescript %}This paragraph appears only in the vanilla NativeScript documentation{% endnativescript %}

This paragraph appears in both environments.

{% angular %}This appears only in the Angular NativeScript documentation{% endangular %}

Local Setup

If you plan to work on a non-trivial change, you will most probably want to run the documentation locally in order to give your change a try before submitting a pull request. To provide you with this opportunity without installing a ton of libraries and loose time in configuration, we have prepared a virtual environment based on a docker image, where everything is prepared for you in advance.

Prerequisites

Docker should be installed on your machine:

The NativeScript documentation is composed from multiple repositories:

Building the docker image

Start by cloning all required git repositories in some local folder (ns-docs in the following examples):

Open a console box (Windows users should run a Git bash session!) and clone the required git repositories:

mkdir ns-docs
cd ns-docs
git clone https://github.com/NativeScript/docs.git
git clone https://github.com/NativeScript/nativescript-angular.git

Optional:

git clone https://github.com/NativeScript/NativeScript.git
git clone https://github.com/NativeScript/nativescript-sdk-examples-js.git
git clone https://github.com/NativeScript/nativescript-sdk-examples-ng.git
git clone https://github.com/NativeScript/nativescript-cli.git

git clone https://github.com/NativeScript/nativescript-ui-samples.git
git clone https://github.com/NativeScript/nativescript-ui-samples-angular.git
git clone https://github.com/NativeScript/nativescript-ui-samples-vue.git

NOTE: nativescript-ui-... are private repositories used for building the API Reference for the NativeScript UI components.
NOTE: If you have these repositories locally from previous work with the documentation, be sure to delete them and start from scratch as some old files can cause problems with the current setup.

Then, build the docker image by using the following command from the ns-docs folder:

sudo docker build -t ns-docs:1.0 docs/build

NOTE: If you received some unauthorized error, make sure you are logged into docker from the CLI. Just execute docker login and follow the instruction. One thing to have in mind is that docker username is your email, but docker ID is what you see on the top right when you log in to https://hub.docker.com. When executing docker login you need to enter your Docker ID.

Building the documentation

Start the docker image created in the previous step from the ns-docs folder:

sudo docker run --rm -t -i -v $(pwd):/root -p 9192:9192 -t ns-docs:1.0

Due to the poor performance of mounted volumes on Mac OS you may use the delegated mount strategy:

sudo docker run --rm -t -i -v $(pwd):/root:delegated -p 9192:9192 -t ns-docs:1.0

Adding content

Edit an article in some of the repositories and navigate to http://localhost:9192 on the host machine. Notice that it might take some time for the changes to be reflected in the browser.

Making changes

  • Edit some files.
  • Refresh your browser (depending on which files have been modified, it might take more or less time for the changes to take effect).

Contributors

The following is a list of all the people that have contributed to the NativeScript documentation. Thanks for your contributions!

tsonevnNickIlievtjvantolletabakovErjanGavaljins-bot

radevavakrilovrdlauerN3llhdeshevtbozhikov

mbektchievikoevskaerikruthnsndecksis0k0petekanev

hamorphisvtrifonovPlamen5kovPetyaSotirovabundyoalexziskind1

atanasovgsipacateMartoYankovsebawitaangeltsvetkovteobugslayer

ggarabedianivanbuhovlinidtopuzovtdermendjievzbranzov

EmilStoychevjasssonpetKristianDDdarindvchimevenchev

pkolevaMitko-Kerezovrosen-vladimirovjlooperboevskitgpetrov

vmutafovmanoldonevbdlb77paulpvsurduroblav96

rynoptzraikovPanayotCankovbradmartinjpennagetsetbro

tailsusitefinitystevedmccuskeyelena-pyyosifovparloti

burkehollandpelegrifelipebuenojbristoweLampeizh-m

000panthermudlabsShawnPaveltushutripathishiv19adrian-niculescu

alejonextAmitGurbaniAntonDobrevbaskarmibdjenitoofdnhkj

gbhojrajHakiershirohanablackpanther99imcgonigleignaciolarranaga

lonerzzzBjorn576jayvolrjonnysampsdigitaldrummerjLokeCarlsson

msaelicesmilejkomap7m-absNikhil22noumaans

pedromorganRazzeeerenestalderrodrigopiresTedHoppWilcoBreedt

devoto13eyal7773miroslavaivanovamtekpTsvetanMilanovajoslin103

ADmadairandfingersadamunionAjaiDubeyFustyADjenkov

Alexander-Bliznyukkondasoftamjdthe-AoG-guydevdRewMonsieurMan

gupta-ankitABoschmanBurgovbensoorajbsykbenjlin

brandonpearson23clounietonjohnCMRHDLcameronnormancelso-wo

chuckmitchellcrixxchrantsyapcwedctp-placebochrismullins

ClaudioMeinbergdotlensderskealDarkleCoreyColeejsuncy

DTV96CalibreDannyFelizdennistangDimitarTachevdiogocapeladonangel

dogabudakDrQwertySilencedyldawgezesundayezefelipebernardesFrancoisCamus

codepotatosundaygleegrgurharikrishnana2021hristoborisovhugocarreiracosta

jagadish-kbjkulubyajayoman3wcJmOkayjofftiquez

jrpooljrzjoshgkingTheOriginalJoshjpierrontjurgentreep

KsantacrkharysharpeLeandroDGlukesammymacknelsonmshanak

marablayevmrcastemarklanhamhchettigernemephxDanekDanek

realteboMitzaCodermhrabieemrmowjiLiteCatDevNatalia-Hristova

nicoegnike47oluwaseyeoimyounisOmnicouleurdeveloper82

pzanittipdvorchikpascualstromsnesdodongphuremorph3oqkdreyer

rajatraj733rakeshgiraseReshmaPDRohanTalipffxsamSamVerschueren

mastixsean-perkinssebastianovidejalkobyshauntifsimmstein

SirMaxxxDasAllFolkstadeucariolanoTaremehTechnicalSoupTetrygon

tralvesfartektdouse2l3ntonymportertrentvb

viragumathe5VladimirAmiorkovweech3rwilliamhoXorbertycherniavskyi

csjdiyewsdoorb02Ayushraj1ishandutta2007jacostaperu

jamessouthjohannbraunjyotendranarayananl23pavanserpeterennis

quintonnsaiberzsaknarakseros00shendrekbharathstevo-knievo

svalchinovtdsmithATabctrevordowdletsirayavulanyjaaidi

bangseongbeom

docs-v7's People

Contributors

alexziskind1 avatar angeltsvetkov avatar atanasovg avatar bundyo avatar erikruth avatar erjangavalji avatar etabakov avatar ggarabedian avatar hamorphis avatar hdeshev avatar ikoevska avatar ivanbuhov avatar martoyankov avatar mbektchiev avatar n3ll avatar nathanaela avatar nickiliev avatar ns-bot avatar petekanev avatar petyasotirova avatar plamen5kov avatar sebawita avatar sipacate avatar sis0k0 avatar tbozhikov avatar teobugslayer avatar tjvantoll avatar tsonevn avatar vchimev avatar vtrifonov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docs-v7's Issues

Styling: Describe “device-independent units”

Our styling docs use the term “device-independent units”, but we never really explain what that term means.

I think we should add a small section in the styling docs to explain how, for example, margin: 5 actually gets applied in iOS and Android.

Better language separation

The blocks of JavaScript and TypeScript are very similar in nature, and when next to each other do not always show the language type: https://github.com/NativeScript/docs/blob/master/ui-with-xml.md#declaring-application-mainmodule-and-start-the-application

Would you accept a PR for adding a language declaration above or in the language example block?

Example proposed:

Navigate to page using Frame navigate() method

JavaScript

// Navigate to page called “my-page”
frames.topmost().navigate("app/my-page")

TypeScript

// Navigate to page called “my-page”
frames.topmost().navigate("app/my-page")

General Request For Timely Updates in Official Documentation

It really would be nice if the official documentation is updated in a timely manner based on changes --- especially breaking changes --- implemented in every version update/release.

For example, in the Application Management section, the supposedly obsolete "local-settings" module is still referenced in the text and sample code under "Persist and Restore Application Settings".

fetch.fetch http return network request failed. Need more info on error

This request work fine under ionic mobile app using angular js http but never works in nativescript.

            var url = "http://localhost/MySpecial.Authorisation.API/api/audience/SetClient";
    debugger;
    fetch.fetch(url, {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({ UserName: "SuperUser", Password: "SuperUser"  })
        }).then(function (r) { 
            return r.json(); 
        })
        .then(function (r) {
            console.log(result);
        }, function (e) {
            console.log("Error occurred " + e);
        });

Console.log

Describe where does the console.log statement output its results

"Requesting permission to use location service" javascript snippet is not valid, page unclear.

The location documentation has a javascript snippet which is mostly typescript - it crashes the ios emulator:

var buttonModule = require("ui/button");
var appModule = require("application");
var platformModule = require("platform");

var onRequestButtonTap = function(args: observable.EventData) {
    var button = <buttonModule.Button>(args.object);
    if (button.android) {
        console.log("Application run on Android");
        (<android.app.Activity>appModule.android.currentContext).startActivityForResult(new android.content.Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS), 0);
    }
    else if (button.ios) {
        console.log("Application run on iOS");
        if (platformModule.device.osVersion.indexOf("8") === 0) {
            console.log("iOS version is greater or equal to 8.0");
            var iosLocationManager = CLLocationManager.alloc().init();
            iosLocationManager.requestWhenInUseAuthorization();
        }
    }

Further to this, this whole section is not as clear as it might be - it took me some time to decipher. I think it could be more obvious with an end-to-end example. The following is a suggested structure for the page:


Configure a location service for the application

To enable location services it is first required to configure a location service in the respective application bundles:

For an IOS 8.0+ project:
Add one of the two following snippets to <applicationName>-Info.plist depending on your business needs:

<key>NSLocationAlwaysUsageDescription</key>
<string>Your message goes here</string>

<key>NSLocationWhenInUseUsageDescription</key>
<string>Your message goes here</string>

In an Android project:

<android example/instructions>

Request permission to use the location service

Next, a request to use the location service is required. Unfortunately... (section as it stands with corrected javascript snippet above)...

Getting a location

Either point to, or move the HOW-TO page to this location in the interests of DRY. The HOW-TO page seems clearer, and contains more information (with less words).

Getting Started Guide - Rob's edits

  1.   Android Setup:
    
    a. As a not-so-regular Mac user I was confused by having to alter my PATH all the time (in fact, one time I altered my PATH variable and screwed up what had been done by Gradle for me, odd). Ideally you would put literal commands in there based on the latest versions of all the tools (difficult to keep up to date, but for idiots like me it can be critical!).
    b. “Android Support Repository” package didn’t exist in my ADK tool list, FYI.
  2.   {N} CLI:
    
    a. Prior to installing the NS CLI, I had to uninstall node, delete the node_modules directory, and reinstall it. Probably not related to anything prior, but it happened to me.
  3.   Detour: How do I know which {N} modules I need in my code? This always has irritated me. I’d love some guidance on when I need to require which modules in KB doc.
    
  4.   [3.2] For me, anything output in console.log doesn’t show up in the terminal, but rather in the system.log in the simulator.
    
  5.   [4.3] “load function empties the list” à should be “empty function” I think
    
  6.   [4.5] Instructions there to “open list.js” and add some xml à should be list.xml
    
  7.   [5] minor spelling issue on “install and use and external…”
    

Document XAML-like sizing system

As described in this issue, the sizing of e.g. a a GridLayout's cols/rows can be set by a XAML-like sizing system, like "*, 3*, *". I haven't found this documented anyway and it's really a hidden gem as we quite often want to have non-pixel-sizing.

Can't connect with [email protected] account

When i was following the nativescript guide (sample groceries) I couldn't visualize the list that supposely is contained in the [email protected] account. I was checking for any errorcode in the views models.js (grocery-view-model and user-view-model...). So i want to know how can I visualize it.

Thanks in advance.

Anargu

HTTP vs. HTTPS in API URL for backend grocery service

Section 4.0 of the docs refers to the hard-coded API URL that utilizes HTTP:

module.exports = {
    apiUrl: "http://api.everlive.com/v1/GWfRtXi1Lwt4jcqK/"
};

But the app employs HTTPS in the config.js file for both the start and end branches.

If a user thought to change HTTPS of the repo to HTTP - to follow the docs - then you obtain the "Unfortunately we could not find your account" dialog and the following log:

2015-11-03 09:35:08.155 sampleGroceries[5287:133749] App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file.
file:///app/views/login/login.js:26:24: CONSOLE LOG TypeError: Network request failed

Perhaps the docs should be updated to reflect HTTPS?

Document creating release builds and/or submitting to app stores

Currently there is no documentation on how to create a release build, or how to submit an app to the app stores. IMO we should have a page that shows the basic process, starting with using the --release flag. For things out of our control (Application Loader, iTunes Connect, Google Play Developer Console, etc), we could at least give people links to point them in the right direction.

GridView and its HOW-TO doc example uses ".setColumn" which doesn't exist anymore. Please provide a real example!

Hi,

https://docs.nativescript.org/ApiReference/ui/layouts/grid-layout/HOW-TO.html is completely confusing as discussed in https://groups.google.com/forum/#!topic/nativescript/O-uimQ4GDDE .

Also it uses .setColumn which doesn't exist anymore, so the actual example in there is broken ("gridLayout.setColumn(button1, 0);" etc.).

An example that actually shows how it works would be greatly appreciated. Please make it for mor than one row, so that one of the most unclear points, which is how to feed the GridView with cells across rows, is done.

Also http://docs.nativescript.org/ApiReference/ui/layouts/grid-layout/GridLayout.html claims that .setColumn exists which it does not, so it should be removed!

And perhaps the same document should mention something so the reader can understand how data is fed to it.

(Trying to run .setColum gives the error "gridLayout.setColumn is not a function".)

Thanks!
Mike

Styling.html Page.css clarification request

Based on reading the source code and some experiments, I believe the documentation at http://docs.nativescript.org/styling.html#page-specific-css is a bit faulty. It does not appear to be clear that if you attempt to set the Page.css property you are actually eliminating all CSS except the Application wide CSS. So if you use Page.addCss="..." or Page.addCssFile(...) and then do a Page.css = "..."; you will wipe out any and all other css that was added via all the prior calls.

Please Improve Data Binding Documentation

Data binding is such an important feature in NativeScript and key to understanding its power.

Is it okay for the Documentation Team to find time to revisit the "App: Data Binding" doc and make it just a little bit easier to understand, especially the "Using expressions for bindings" section?

Thanks guys!

Examples?

Hi,

Are there any ready-to-compile example apps?

-G

How to build the docs

Is there a way to build nativescript docs in html or to build them similar to docs.nativescript.org ?

Merge all the Changelogs into one

Lets start to have only a single Changelog for all the repos, as currently there is no a single place where to point customers to see the changelog for a particular version.

An easy to implement idea is to just have a placeholder article that links to the existing changelogs.

visual examples

It would be great, that screenshot is displayed to show how it would look as an example. Since there are no known functions as shown.

One changelog to rule them all

I'd like to suggest that there be a single changelog file that lives at http://docs.nativescript.org/Changelog, and that links to the more detailed changelogs (CLI, runtimes, and modules).

My reasoning is we really need a single place we can link to in order to show people exactly what changed in a given release. For instance it'd be great if @NativeScript could tweet out, “1.1 is out! Here's what changed: http://docs.nativescript.org/changelog.

Ideally this “base” log could also give a three or four bullet summation of the release's major features, and again link to the more detailed changelogs or GitHub issues for more details.

cc @ligaz

Trivial errors on some sentences in core-concepts/bindings.md

A few trivial typos and errors in some sentences:

  • "... your code has ,et the following requirements ...".
  • "... target property should to be a dependency property ...".
  • "... as in the exmple above ...".
  • "... could be omited ...".
  • "... of progating changes ...".

http request

mainViewModel.testButton = function () {
    var http = require("http");
 http.getJSON("http://httpbin.org/get").then(function (r) {
    alert(JSON.stringify(r))
}).fail(function (e) {
    // Argument (e) is Error!
    alert("Failed")
});
}

when i click on button application is getting crashed. I changed the button action to a string alert, it worked. So i made some mistakes in http request part it seems.

Broken links in README.md

The iOS- and Android-specific links at the bottom of index.md are broken. I'd fix them but I'm not sure where they should link to.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.