Warning
|
This repo is deprecated. Check the code repos for associated docs. |
This repository is used to build the documentation site for AeroGear Mobile Services. To view the documentation please visit docs.aerogear.org.
Our goal is to help users of AeroGear projects "understand things well and not feel like they’re dealing with a capricious minor god instead of a product." [1]
This readme introduces the standards for AeroGear docs.
To work with mobile-docs you must have the latest antora version installed on your local machine.
If you just want to edit or verify technical content, you can edit the file and jump to:
An introduction to a new term, process, module or component. For example, "Mobile Service" : what is it? why do I care? and how does it fit into my development environment?
-
Name file by slugifying title
-
Prefix filenames with con_
The important information that gets me using AeroGear software, for example, write your procedure by answering the following questions:
-
Who should perform this procedure?
-
Why am I performing this procedure? benefits or context in a higher level user story
-
What is the object of the task? eg adding a dashboard.. to what?
-
What do I need to know and/or do before installing or provisioning the software?
-
What do I need to do to provision the software?
-
What are the minimum configuration tasks that I need to do to get value from the software?
-
What additional information would be useful after completing procedure (eg, next steps)
-
Name file by slugifying title
-
no prefix on filenames
Information I might need to debug or extend the normal usage of AeroGear software. For example:
-
API syntax and definitions
-
Configuration optionss
-
Name file by slugifying title
-
Prefix filenames with ref_
-
If you make a filename change (eg adding or renaming a file), you must update the appropriate modules/ROOT/nav.adoc file.
-
Test your changes using Antora
-
Determine which functionality is this documentation related to?
-
Push
-
Metrics
-
Common to all mobile services
-
Common to all services or SDKs but with some information that is specific to each.
With this information, you should be able to determine where the file should be located in the repo, eg modules/ROOT/push
If you intend to reuse a part of a file, create a partial in modules/ROOT/_partials and refer to it using an
include
.Only create links to the files in the
pages
directory. Links to files under_partials
will not resolve.
-
-
Stick to present tense, eg `When you add the dashboard, it appears on `, not `When you add the dashboard, it will appear on `
For a ful list of asciidoc syntax, see the quick reference, note the following syntax to avoid:
-
Headings using --, ~~, ^^, ++ syntax
-
Markdown
-
Source block without syntax. Try to use syntax highlighting where possible, for example
[source, bash]
Note
|
When you create a PR, an Antora preview is automatically generated. and is linked to the PR. If you are making a small change, this may be sufficient. |
After modifying documentation, you can validate your changes and preview the results by:
-
Install Antora v2 globally as described in their install guide.
-
Fork this repo and set up origin and upstream remotes.
-
Change to the
mobile-docs
directory. -
Run antora:
./bin/quick-build.sh local-site.yml
Note: <site-file> refers to either:
-
local-site - your current directory
-
site.yml - the master branch of the github repo
When building for publication use:
./bin/build.sh
-
Note
|
After changes to antora-ui, you might need to run 'antora --pull --clean <site-file>' to pick up those changes. |
The site.yml
currently creates HTML for:
-
master branch of this repo
-
v1.0 branch of this repo
-
master branch of the https://github.com/aerogear/mobile-security repo
To create a live preview that picks up changes while working on the docs:
-
Install the dependencies specified in
package.json
.npm install
-
Run the following command to watch for changes in the
modules
folder and automatically rebuild the site.npm run watch
You should see new output in the terminal window when changes are made. This indicates the site is being rebuilt automatically.
-
In a separate terminal, run the following command to serve the website.
npm run serve
This starts a static server that serves the built website. It will automatically open your browser and the current page will reload any time the site is rebuilt.
Note
|
It usually takes 3-5 seconds to see the changes automatically reflected in your browser. |
After reviewing a html file, you might identify a change. When editing a file, you might find that the content is not in the associated adoc file, because it’s rendered by using the asciidoc include
command. You can edit the included file, but note that editing the source file can have unintended effect. For example, when editing the registering-an-app.adoc
, avoid problems by:
-
Regex search for
include.*registering-an-app
across the whole repo. -
Review the list of files from this search to understand of the context of the content.
-
Use your judgement when editing the file to make sure the content is appropriate for each rendering of that content.
Currently, the publishing process is manual:
-
Run antora using following command:
./bin/build.sh
-
Review the output (
build\site\index.html
) for errors. Correct if required.NoteCheck for correct styling changes too. -
Make a PR against https://github.com/aerogear/docs.aerogear.org
Note
|
This repo contains more than just the output of mobile-docs repo. See https://github.com/aerogear/docs.aerogear.org/blob/master/README.adoc for more details. |
No remote repos were harmed in the production of this documentation ;)
However, references to code maybe be included as follows:
-
Decide on a name for the snippet, eg push-ios-register
-
Create a partial in mobile-docs, eg https://github.com/aerogear/mobile-docs/blob/master/modules/ROOT/pages/_partials/push-ios-register.inc
-
Reference the code file you want to use (with a tags filter):
// include::https://raw.githubusercontent.com/aerogear/ios-showcase-template/push-push/ios-showcase-template/push/PushHelper.swift[tags=push-ios-register]
-
Add tags to the code repo, eg
// tag::push-ios-register[] public func registerUPS(_ deviceToken: Data) { AgsCore.logger.info("Registered for notifications with token") var config = UnifiedPushConfig() config.alias = "Example App" config.categories = ["iOS", "Example"] AgsPush.instance.register( deviceToken, config, success: { AgsCore.logger.info("Successfully registered to Unified Push Server") }, failure: { (error: Error!) in AgsCore.logger.error("Failure to register for on Unified Push Server: \(error)") } ) } // end::push-ios-register[]
-
Edit adoc file with the following to display the content:
include::{partialsdir}/push-ios-register.inc-rantora.adoc[]
NoteYou need to run mobile-docs:/bin/build.sh <site>.yml to make sure the temp files are in place when building site
You can lint the English prose you’ve written using the following command:
$ ./node_modules/write-good/bin/write-good.js <path-to-adoc>
The output gives you suggestions as to how to improve the text, but many suggestions can be ignored.
If you encounter problems creating a preview:
-
Delete the
build
and.cache
directories. -
Uninstall antora:
npm uninstall -g @antora/cli npm uninstall -g @antora/site-generator-default
-
Reinstall antora v2:
npm i -g @antora/[email protected] @antora/[email protected]
-
Run
/bin/quick-build.sh local-site.yml
If there is still an issue, contact aerogear at googlegroups.com.