Repository: cordova-docs
Updated Branches:
  refs/heads/master ff73ab2d6 -> 7ed25bba5


Adding style guide for xml references


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

Branch: refs/heads/master
Commit: 7ed25bba5ac57cb7bb3017fb57dd821a374b9706
Parents: ff73ab2
Author: Raghav Katyal <[email protected]>
Authored: Wed Jan 20 16:06:08 2016 -0800
Committer: Raghav Katyal <[email protected]>
Committed: Thu Jan 21 11:39:47 2016 -0800

----------------------------------------------------------------------
 doc/docs-STYLEGUIDE.md | 55 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/7ed25bba/doc/docs-STYLEGUIDE.md
----------------------------------------------------------------------
diff --git a/doc/docs-STYLEGUIDE.md b/doc/docs-STYLEGUIDE.md
index e795bcb..1b0a5b5 100644
--- a/doc/docs-STYLEGUIDE.md
+++ b/doc/docs-STYLEGUIDE.md
@@ -399,6 +399,61 @@ help identify them in Markdown.
 
         grep -hr '\[http' *
 
+## XML References
+
+* Each element has it's own section with the following structure:
+  
+  * Element Name
+  * General Description
+  * Attributes Table
+  * Examples
+
+* If an element has a sub-element, follow a nested structure. The parent 
element becomes a H1 heading, child becomes H2 and so on.
+    
+* Attribute description should include the following in order:
+
+  * Default: Use *italics* formatting to provide default value of the attribute
+  * Required: Use *italics* formatting to provide if the attribute value is 
required
+  * Platforms supported: Use **bold** to specify platforms supported. Default 
is supported in all platforms.
+  * Textual Description.
+
+* Below is an example documentation for 'platform' element for plugin.xml. 
'source-file' is a sub-element of the 'platform' element.
+
+  ### platform
+    Identifies platforms that have associated native code or require 
modifications to their configuration files. Tools using this specification can 
identify supported platforms and install the code into Cordova projects. 
Plugins without <platform> tags are assumed to be JavaScript-only, and 
therefore installable on any and all platforms.
+
+    Attributes(type) | Description
+    ---------------- | ------------
+    name(string) | *Required: true* <br/> Allowed values: ios, android, 
blackberry10, amazon-fireos, wp8, windows <br/> Identifies a platform as 
supported, associating the element's children with that platform.
+
+    Example:
+    ```
+    <platform name="android">
+      <!-- android-specific elements -->
+    </platform>
+    ```
+
+  #### source-file
+    Identifies executable source code that should be installed into a project.
+
+    Attributes (type) | Description
+    ----------------- | ------------
+    src(string) | *Required: true* <br/> Location of the file relative to 
plugin.xml. If the src file can't be found, plugman stops and reverses the 
installation, issues a notification about the problem, and exits with a 
non-zero code.
+    target-dir(string) | A directory into which the files should be copied, 
relative to the root of the Cordova project. In practice, this is most 
important for Java-based platforms, where a file in the com.alunny.foo package 
must be located within the com/alunny/foo directory. For platforms where the 
source directory is not important, this attribute should be omitted.
+    framework(boolean) | *Default: false* <br/> **Platforms supported: iOS** 
<br/> If set to true, also adds the specified file as a framework to the 
project.
+    compiler-flags(string) | **Platforms supported: iOS** <br/> If set, 
assigns the specified compiler flags for the particular source file.
+
+    Examples:
+    ```
+    <!-- android -->
+    <source-file src="src/android/Foo.java"
+                  target-dir="src/com/alunny/foo" />
+    <!-- ios -->
+    <source-file src="src/ios/CDVFoo.m" />
+    <source-file src="src/ios/someLib.a" framework="true" />
+    <source-file src="src/ios/someLib.a" compiler-flags="-fno-objc-arc" />
+    ```
+
 ## Miscellaneous
 
 * OK to use shorthand notation for version ranges, e.g. "5.0+" rather


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to