Skip to content

Commit 5e40bb8

Browse files
author
Marek Suchánek
committed
Translate the atree readme to MD for readability
1 parent 7614ec2 commit 5e40bb8

File tree

1 file changed

+60
-50
lines changed

1 file changed

+60
-50
lines changed

atree/README.txt atree/README.md

+60-50
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
atree - print a tree of asciidoc document inclusions
2-
3-
syntax: atree [file|directory|option]...
1+
# atree - print a tree of asciidoc document inclusions
42

53
Prints a tree of asciidoc document inclusions.
64

5+
syntax:
6+
7+
```
8+
atree [file|directory|option]...
9+
```
10+
711

8-
INPUT
9-
-----
12+
## Input
1013

1114
The possible parameters are:
1215

@@ -19,123 +22,130 @@ You can specify as many inputs as needed. Inputs are processed in order of appea
1922

2023
If no input files or directories are specified, the current directory is tried.
2124

22-
Path handling details
23-
---------------------
25+
### Path handling details
2426

2527
When atree encounters a glob pattern, it expands it first and then handles the resulting paths as if listed manually.
2628

2729
If a path is a file, atree tries to parse and analyze it as an AsciiDoc file. If a path is a directory instead, atree checks for existence of files in this order:
2830

29-
1. master.adoc
30-
2. index.adoc
31-
3. any *.adoc file, but only if there is just a single such file
31+
1. `master.adoc`
32+
2. `index.adoc`
33+
3. any `*.adoc` file, but only if there is just a single such file
3234

3335

34-
OPTIONS
35-
-------
36+
### Options
3637

37-
-a Use annotated output (default).
38-
-b Use full path output.
39-
-l Use literal include line output.
38+
* `-a` Use annotated output (default).
39+
* `-b` Use full path output.
40+
* `-l` Use literal include line output.
4041

41-
-c Display commented-out includes in annotated mode.
42-
-x Analyze commented-out includes.
43-
-h Hide hints for human user.
42+
* `-c` Display commented-out includes in annotated mode.
43+
* `-x` Analyze commented-out includes.
44+
* `-h` Hide hints for human user.
4445

45-
All options in the second group have their inverse in uppercase, which is also the default state. For example, atree does not show commented out includes by default, but you can get them with -c, and later return to the default with -C.
46+
All options in the second group have their inverse in uppercase, which is also the default state. For example, atree does not show commented out includes by default, but you can get them with `-c`, and later return to the default with `-C`.
4647

4748

48-
OUTPUT
49-
------
49+
## Output
5050

5151
Output differs by mode. Default mode is annotated.
5252

53-
Annotated output
54-
----------------
53+
### Annotated output
5554

5655
This output mode is intended for consumption by humans. Included files are printed in order of appearance. Indentation shows the level of nesting. If the inclusion of a file is modified in some way, this is displayed:
5756

58-
* If a file is included, but the inclusion is commented out, the line with the included path begins with the // characters, to idicate the file is included but does not affect output:
57+
* If a file is included, but the inclusion is commented out, the line with the included path begins with the `//` characters, to indicate the file is included but does not affect output:
5958

60-
// this-is-a-commented-out-file.adoc
59+
```
60+
// this-is-a-commented-out-file.adoc
61+
```
6162
6263
* If a file is included, but the inclusion is altered by conditionals, an additional line is shown which explains the conditionals, such as:
6364
64-
modules/developer/con_hardening_c_cpp_code.adoc
65-
\- !!! ifndef::developer-book
65+
```
66+
modules/developer/con_hardening_c_cpp_code.adoc
67+
\- !!! ifndef::developer-book
68+
```
6669
6770
* If a file can not be read, its inclusion will be displayed, but no includes inside that file can be analyzed.
6871
6972
* If a file cannot be analyzed, the reason will be shown with flags. The flags are:
7073
71-
R! the file includes itself, infinitely recursive inclusion
72-
N! the file does not exist
73-
X! the file name is not valid
74+
* `R!` the file includes itself, infinitely recursive inclusion
75+
* `N!` the file does not exist
76+
* `X!` the file name is not valid
7477
75-
Example of outputs with flags:
78+
Example of outputs with flags:
7679
77-
N! some/nonexistent/file.adoc
78-
//R! the-same-file.adoc
79-
X! an|invalid*path/somefile.adoc
80+
```
81+
N! some/nonexistent/file.adoc
82+
//R! the-same-file.adoc
83+
X! an|invalid*path/somefile.adoc
84+
```
8085
8186
82-
Full path output
83-
----------------
87+
### Full path output
8488
8589
This mode is intended for consumption by other tools. The output consists only of absolute paths, one on a line. No indenting to show include level is printed. Commented out files will not be listed. Conditionals and flags are not displayed. Invalid or nonexistent files will still be listed.
8690
87-
Note that using the -c option will enable analysis of commented out includes, but they will not be shown.
91+
Note that using the `-c` option will enable analysis of commented out includes, but they will not be shown.
8892
89-
Literal output
90-
--------------
93+
### Literal output
9194
9295
This mode prints include lines as encountered in the files. Handling of flags, conditions, comments etc. is identical to full path output.
9396
94-
The top level file has no include statement and therefore has a special line: "<top: the-top-file.adoc>".
97+
The top level file has no include statement and therefore has a special line: `<top: the-top-file.adoc>`.
9598
96-
Note that attributes are expanded before this listing, so the icludeds are not verbatim as shown in the files.
99+
Note that attributes are expanded before this listing, so the includes are not verbatim as shown in the files.
97100
98101
99-
EXAMPLE
100-
-------
102+
## Example
101103
102104
1. Clone the Fedora quick docs repository:
103105
106+
```
104107
$ git clone https://pagure.io/fedora-docs/quick-docs.git
108+
```
105109
106110
2. Change to the directory with top-level AsciiDoc files:
107111
112+
```
108113
$ cd quick-docs/modules/ROOT/pages
114+
```
109115
110116
3. Show tree of some of the files:
111117
118+
```
112119
$ atree securing-the-system-by-keeping-it-up-to-date.adoc
113120
securing-the-system-by-keeping-it-up-to-date.adoc
114121
{partialsdir}/con_why-it-is-important-keeping-your-system-up-to-date.adoc
115122
{partialsdir}/proc_manual-updating-using-gui.adoc
116123
{partialsdir}/proc_manual-updating-using-cli.adoc
117124
{partialsdir}/proc_setting-automatic-updates.adoc
125+
```
118126
119127
120-
KNOWN ISSUES
121-
------------
128+
## Known issues
129+
130+
* AsciiDoctor apparently uses some special handling for absolute paths. This syntax is not understood by atree and the file will be treated as non-existent (`N!`).
122131
123-
* AsciiDoctor apparently uses some special handling for absolute paths. This syntax is not understood by atree and the file will be treated as non-existent (N!).
124132
See also https://github.com/redhat-documentation/tools/issues/21
125133
126134
* If an attribute is used in the include macro, the attribute must be defined in the document tree. There is no way to define an attribute manually / externally. Because undefined attributes can not not expanded, includes containing these are displayed, but the actual files can not be loaded and thus any further inclusions are not shown.
127135
128136
* All includes in comments are listed, including these that are not intended as part of the document, but only comment. There is no way to distinguish these automatically.
129137
130138
131-
HINTS
132-
-----
139+
## Hints
133140
134141
* If there is only a single AsciiDoc file in the directory, atree will assume that is the one you want analyzed, even if you do not specify it.
135142
136-
* You can specify the input with glob patterns, including directory traversal /**/. This lets you construct very powerful queries.
143+
* You can specify the input with glob patterns, including directory traversal `/**/`. This lets you construct very powerful queries.
137144
138145
* You can pipe atree output to egrep to add search and highlighting:
139-
atree | egrep --color "SOME-FILE-I-WANT-HIGHLIGHTED|$"
146+
147+
```
148+
$ atree | egrep --color "SOME-FILE-I-WANT-HIGHLIGHTED|$"
149+
```
140150
141151
* When in doubt, check the source...

0 commit comments

Comments
 (0)