Skip to content

Commit 26a7fd7

Browse files
committed
Merge pull request #6 from nhr/readme_update
Updated README to relfect build system changes
2 parents 0bcda60 + e200dcd commit 26a7fd7

File tree

1 file changed

+76
-5
lines changed

1 file changed

+76
-5
lines changed

README.adoc

Lines changed: 76 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,86 @@ Each directory of the repo represents a different collection of topics (you can
3535

3636
== Metadata
3737

38-
In order to construct the documentation site from these sources, the build system looks at certain metdata files. The actual format of these configuration files is TBD.
38+
In order to construct the documentation site from these sources, the build system looks at the `_build_cfg.yml` metdata file. The format of this files is as indicated:
3939

40-
=== builder_top_cfg.yaml
40+
----
41+
--- <1>
42+
Name: Origin of the Species <2>
43+
Dir: origin_of_the_species <3>
44+
Topics:
45+
- Name: The Majestic Marmoset <4>
46+
File: the_majestic_marmoset <5>
47+
- Name: The Curious Crocodile
48+
File: the_curious_crocodile
49+
----
50+
<1> Record separator at the top of each topic group
51+
<2> Display name of topic group
52+
<3> Directory name of topic group
53+
<4> Topic name
54+
<5> Topic file under the topic group dir withour without '.adoc'
55+
56+
The build system only looks in this file for information on which files to include, so any new file submissions must be accompanied by an update to this metadata file.
57+
58+
== Live Editing
59+
If you would like to work on one of the documentation files in an editing environment that automatically redraws the resulting HTML, follow these steps.
60+
61+
=== Prerequisites
62+
You will need the following tools in your editing environment:
63+
64+
* A bash shell environment (Linux distributions and OS X include these out of the box, for Windows consider http://cygwin.com/[Cygwin])
65+
* https://www.ruby-lang.org/en/[Ruby]
66+
* http://www.git-scm.com/[git]
67+
* A web browser (Firefox, Chrome or Safari) with the http://livereload.com/[LiveReload] extension
68+
69+
With these tools available, first perform a one-time setup:
70+
71+
1. Clone the https://github.com/openshift/openshift-docs[openshift-docs] repo from GitHub:
72+
+
73+
----
74+
$ git clone https://github.com/openshift/openshift-docs.git
75+
----
76+
2. From the cloned directory, run a bundle install:
77+
+
78+
----
79+
$ cd openshift-docs
80+
$ bundle install
81+
----
82+
+
83+
TIP: If you don't have bundler installed, you can get it by running `gem install bundler`
4184

42-
The top-level configuration file tells the build system the order in which to display the "book-grouped" topics.
85+
That's it for setup, the next section explains how to run the LiveReload system.
4386

44-
=== builder_book_cfg.yaml
87+
=== Running with LiveReload
88+
Once you've installed the link:#prerequisites[prerequisites] you can fire up the LiveReload setup as follows:
4589

46-
A "book" level configuration file exists in each book directory. It tells the build system the order in which to display the topics with the "book" grouping.
90+
1. From the `openshift-docs` directory, run a preliminary build:
91+
+
92+
----
93+
$ cd openshift-docs
94+
$ bundle exec rake build
95+
----
96+
2. Now open the generated HTML file in your browser. It will be under `openshift-docs/_preview` with the same path and filename as the original file. The only difference will be the name ending in '.html' instead of '.adoc'.
97+
3. Now start up the `guard` utility:
98+
+
99+
----
100+
$ bundle exec guard
101+
----
102+
+
103+
TIP: This utility will run in the terminal where you started it, so you should leave it running off to the side and use other terminals for regular tasks.
104+
4. Finally, back in your browser, enable the LiveReload plugin in the same tab where the preview file is displayed. You will know this step succeeded if the LiveReload icon changes, and if you see output similar to the following in the terminal where `guard` is running:
105+
+
106+
----
107+
[1] guard(main)> 17:29:22 - INFO - Browser connected.
108+
----
109+
110+
That's it. Now any changes that you make to the source file will automatically trigger a rebuild of the target HTML file.
111+
112+
=== Clean Up
113+
The `.gitignore` file is set up to prevent anything under `_preview` from being committed. However, you can reset the environment manually by running:
114+
115+
----
116+
$ bundle exec rake clean
117+
----
47118

48119
== Contacts
49120

0 commit comments

Comments
 (0)