summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2018-04-24 20:10:01 -0600
committerDan Allen <dan.j.allen@gmail.com>2018-04-24 20:11:33 -0600
commit6f16adaab7487fbfe61a2d21ab364366839786fe (patch)
tree1a5c3d4cda7c157399f9f8cdef7afdc42e794a9c /features
parentd2b96b232a0e2d88bed056c7df437312b3b8fe00 (diff)
resolves #2365 allow xrefstyle to be overridden per xref using the xrefstyle attribute (PR #2706)
- allow xrefstyle to be overridden per xref by assigning xrefstyle attribute on xref macro - allow xrefstyle to be overridden in different parts of the document
Diffstat (limited to 'features')
-rw-r--r--features/xref.feature67
1 files changed, 66 insertions, 1 deletions
diff --git a/features/xref.feature b/features/xref.feature
index 260fbde5..5feb3378 100644
--- a/features/xref.feature
+++ b/features/xref.feature
@@ -375,7 +375,7 @@ Feature: Cross References
"""
@wip
- Scenario: Create a cross reference to a part using a custom chapter reference signifier
+ Scenario: Create a cross reference to a part using a custom part reference signifier
Given the AsciiDoc source
"""
:doctype: book
@@ -972,3 +972,68 @@ Feature: Cross References
|refer to
a< href='#_section_one' class='spotlight' "The Premier Section"
"""
+
+ Scenario: Override xrefstyle for a given part of the document
+ Given the AsciiDoc source
+ """
+ :xrefstyle: full
+ :doctype: book
+ :sectnums:
+
+ == Foo
+
+ refer to <<#_bar>>
+
+ == Bar
+ :xrefstyle: short
+
+ refer to xref:#_foo[xrefstyle=short]
+ """
+ When it is converted to html
+ Then the result should match the HTML structure
+ """
+ .sect1
+ h2#_foo 1. Foo
+ .sectionbody: .paragraph: p
+ |refer to
+ a< href='#_bar' Chapter 2, <em>Bar</em>
+ .sect1
+ h2#_bar 2. Bar
+ .sectionbody: .paragraph: p
+ |refer to
+ a< href='#_foo' Chapter 1
+ """
+
+ Scenario: Override xrefstyle for a specific reference by assigning the xrefstyle attribute on the xref macro
+ Given the AsciiDoc source
+ """
+ :xrefstyle: full
+ :doctype: book
+ :sectnums:
+
+ == Foo
+
+ content
+
+ == Bar
+
+ refer to <<#_foo>>
+
+ refer to xref:#_foo[xrefstyle=short]
+ """
+ When it is converted to html
+ Then the result should match the HTML structure
+ """
+ .sect1
+ h2#_foo 1. Foo
+ .sectionbody: .paragraph: p content
+ .sect1
+ h2#_bar 2. Bar
+ .sectionbody
+ .paragraph: p
+ |refer to
+ a< href='#_foo' Chapter 1, <em>Foo</em>
+ .paragraph: p
+ |refer to
+ a< href='#_foo' Chapter 1
+ """