Skip to content

Commit da69e8c

Browse files
committed
Fix xref guidelines for contrib doc, make 1 scenario
Fix xref guidelines for contrib doc, make 1 scenario openshiftGH-53958: Fix xref guidelines for contrib doc As called out in the comments: openshift#53958 This updates the `/baz/zig` and `/baz/zag` examples. @openshift/team-documentation PTAL
1 parent a725b8e commit da69e8c

File tree

1 file changed

+17
-34
lines changed

1 file changed

+17
-34
lines changed

contributing_to_docs/doc_guidelines.adoc

+17-34
Original file line numberDiff line numberDiff line change
@@ -744,56 +744,39 @@ IMPORTANT: You must use `link:` before the start of the URL.
744744

745745
IMPORTANT: You cannot link to a repository that is hosted on www.github.com.
746746

747-
TIP: If you want to build a link from a URL _without_ changing the text from the actual URL, just print the URL without adding a `[friendly text]` block at the end; it will automatically be rendered as a link.
747+
TIP: If you want to build a link from a URL _without_ changing the text from the actual URL, print the URL without adding a `[friendly text]` block at the end; it will automatically render as a link.
748748

749749
=== Links to internal content
750-
There are two scenarios for linking to other assemblies:
751750

752-
1. Link to another file that exists in the same directory.
753-
2. Link to another file that exists in a separate directory.
754-
755-
The following examples use the example directory structure shown here:
756-
....
757-
/
758-
/foo
759-
/foo/bar.adoc
760-
/baz
761-
/baz/zig.adoc
762-
/baz/zag.adoc
763-
....
764-
765-
*Link to assembly in same directory*
751+
If you want to link to other assemblies or modules in the repository, use the following format:
766752

767753
----
768-
xref:<filename>#anchor-id[friendly title]
754+
xref:../<dir>/<assembly_name>.adoc#<anchor_id>[<section_title>]
769755
----
770756

771-
You must use the `.adoc` file extension. The document processor will correctly link this to the resulting HTML file.
772-
773-
For example, using the above syntax, if you are working on `zig.adoc` and want to link to `zag.adoc`, do it this way:
774-
775-
----
776-
xref:../zag.adoc#baz-zag[comment]
777-
----
757+
Note the following guidelines:
778758

779-
where `baz-zag` is the anchor ID at the top of the file `zag.adoc`.
759+
* You must use the `.adoc` extension.
760+
* You must specify an anchor ID.
761+
* You must back up the appropriate number of levels (`../`, `../../`, and so on) to get back to the top-level `openshift-docs/` repository, and then specify the subdirectories to get back down to the assembly.
780762

781-
*Link to assembly in different directory*
763+
For example, if you have the following directory structure:
782764

783-
----
784-
xref:../dir/<filename>.adoc#anchor-id[friendly title]
785-
----
765+
....
766+
openshift-docs/
767+
openshift-docs/foo
768+
openshift-docs/foo/bar.adoc
769+
openshift-docs/baz
770+
openshift-docs/baz/zig.adoc
771+
....
786772

787-
For example, if you are working on `bar.adoc` and you want to link to `zig.adoc`, do it this way:
773+
And you are working in `bar.adoc` and want to link to `zig.adoc`, use the following xref:
788774

789775
----
790776
For more information, see the xref:../baz/zig.adoc#baz-zig[ZIG manual].
791777
----
792778

793-
[NOTE]
794-
====
795-
You must use the `.adoc` extension in order for the link to work correctly and you must specify an anchor ID.
796-
====
779+
where `baz-zig` is the anchor ID.
797780

798781
== Embedding an external file
799782

0 commit comments

Comments
 (0)