Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a Getting Started, with emphasis on easy to do steps #18

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2

jobs:
build:
docker:
- image: circleci/ruby:2.2-node
working_directory: ~/docs
steps:
- checkout
- run: gem install ascii_binder
- run: asciibinder package
- store_artifacts:
path: ~/docs/_preview
8 changes: 8 additions & 0 deletions _topic_map.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ Topics:
File: philosophy

---
Name: Getting Started
Dir: getting_started
Topics:
- Name: Quick Start
File: index
- Name: Building a Doc Set
File: building
---
Name: Guides
Dir: guides
Topics:
Expand Down
82 changes: 82 additions & 0 deletions getting_started/building.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
[[building-a-doc-set]]
= Building a Doc Set
{product-author}
{product-version}
:data-uri:
:icons:

Building a doc set involves converting the Asciidoc to HTML using the AsciiBinder configuration files.
The following options are outlined in this guide:

* xref:building-using-ruby[]
* xref:building-using-docker[]
* xref:building-using-cicd[]

[[building-using-ruby]]
== Building Locally Using ruby

NOTE: Installing a supported version of ruby may affect existing ruby applications on your system. To avoid issues, use xref:building-using-docker[] or use `rvm`.

See xref:../guides/user_guide.adoc#installing-asciibinder[Installing AsciiBinder] for the steps required to install AsciiBinder.



[[building-using-docker]]
== Building Locally Using Docker

Docker provides a container based method of building doc sets that only requires the installation of docker, and therefore requires minimal minimal configuration change for your system.

. Install docker.
. Clone the xref:https://github.com/redhataccess/ascii_binder[ascii_binder] repo.
. Change directory into the repo.
. Enter the following command to create the docker image:
+
----
docker build -t asciibinder:latest .
----

. Change to the docs directory:
+
----
cd <docs_path>
----

. Use the following command to run the docker container:
+
----
docker run --rm -it -v ${PWD}:/docs:z -u $(id -u):$(id -g) asciibinder
----
+
The html is generated in the `_preview` directory.


[[building-using-cicd]]
== Building Using CI/CD

There are many build systems that are used in software including:

* Jenkins
* Travis CI
* CircleCI

The xref:..\getting_started\index.adoc#[Quick Start] page describes how to use CircleCI. That process is controlled by the `.circleci\config.yml` file:
----
version: 2 <1>

jobs:
build:
docker:
- image: circleci/ruby:2.2-node <2>
working_directory: ~/docs
steps:
- checkout
- run: gem install ascii_binder
- run: asciibinder package
- store_artifacts:
path: ~/docs/_preview <3>
----

<1> You must use CircleCI version 2.
<2> This is the docker image that is used.
<3> This is the output directory that contains the HTML.

48 changes: 48 additions & 0 deletions getting_started/index.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
= Getting Started
{product-author}
{product-version}
:data-uri:
:icons:

This guide provides instructions for getting started with AsciiBinder, enabling you to:

* Edit an AsciiBinder repo
* Render the results to HTML

This procedure assumes you are familiar with Asciidoc and git:

. Fork the link:https://github.com/redhataccess/ascii_binder-docs[ascii_binder_docs] repo.
. Create a directory and add an asciidoc file, for example:
+
----
doing_stuff
└── index.adoc
----
. Edit the asciidoc file to include your content, for example, edit `doing_stuff\index.doc`:
+
----
= Doing stuff

It is important to do stuff every day. Here are some options:

* eat
* walk
* talk
----
. Edit the `_topic_map.yml` file to provide navigation for your new content:
+
----
---
Name: Doing Stuff
Dir: doing_stuff
Topics:
- Name: Doing Stuff
File: index
----
. Create an account at link:https://circleci.com/[CirlceCI].
. Create a CircleCI project pointing at your fork of the ascii_binder_docs repo.
See the link:https://youtu.be/KhjwnTD4oec?t=19s[CircleCI video] for a demonstration.
. Push your changes to that repo and CircleCI will automatically create the HTML output.
To see the output HTML, navigate to the artifacts tab of the most recent CircleCI build.

For more information on building doc sets, including building locally, see xref:../getting_started/building.adoc#building-a-doc-set[Building a Doc Set].