mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-04 05:59:32 +01:00 
			
		
		
		
	Change ToC script to use <br> instead of trailing spaces
Also updated docs that contain ToC. Fixes #1048
This commit is contained in:
		@@ -1,11 +1,11 @@
 | 
				
			|||||||
<a id="top"></a>
 | 
					<a id="top"></a>
 | 
				
			||||||
# Assertion Macros
 | 
					# Assertion Macros
 | 
				
			||||||
 | 
					
 | 
				
			||||||
**Contents**  
 | 
					**Contents**<br>
 | 
				
			||||||
[Natural Expressions](#natural-expressions)  
 | 
					[Natural Expressions](#natural-expressions)<br>
 | 
				
			||||||
[Exceptions](#exceptions)  
 | 
					[Exceptions](#exceptions)<br>
 | 
				
			||||||
[Matcher expressions](#matcher-expressions)  
 | 
					[Matcher expressions](#matcher-expressions)<br>
 | 
				
			||||||
[Thread Safety](#thread-safety)  
 | 
					[Thread Safety](#thread-safety)<br>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Most test frameworks have a large collection of assertion macros to capture all possible conditional forms (```_EQUALS```, ```_NOTEQUALS```, ```_GREATER_THAN``` etc).
 | 
					Most test frameworks have a large collection of assertion macros to capture all possible conditional forms (```_EQUALS```, ```_NOTEQUALS```, ```_GREATER_THAN``` etc).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,29 +1,29 @@
 | 
				
			|||||||
<a id="top"></a>
 | 
					<a id="top"></a>
 | 
				
			||||||
# Command line
 | 
					# Command line
 | 
				
			||||||
 | 
					
 | 
				
			||||||
**Contents**  
 | 
					**Contents**<br>
 | 
				
			||||||
[Specifying which tests to run](#specifying-which-tests-to-run)  
 | 
					[Specifying which tests to run](#specifying-which-tests-to-run)<br>
 | 
				
			||||||
[Choosing a reporter to use](#choosing-a-reporter-to-use)  
 | 
					[Choosing a reporter to use](#choosing-a-reporter-to-use)<br>
 | 
				
			||||||
[Breaking into the debugger](#breaking-into-the-debugger)  
 | 
					[Breaking into the debugger](#breaking-into-the-debugger)<br>
 | 
				
			||||||
[Showing results for successful tests](#showing-results-for-successful-tests)  
 | 
					[Showing results for successful tests](#showing-results-for-successful-tests)<br>
 | 
				
			||||||
[Aborting after a certain number of failures](#aborting-after-a-certain-number-of-failures)  
 | 
					[Aborting after a certain number of failures](#aborting-after-a-certain-number-of-failures)<br>
 | 
				
			||||||
[Listing available tests, tags or reporters](#listing-available-tests-tags-or-reporters)  
 | 
					[Listing available tests, tags or reporters](#listing-available-tests-tags-or-reporters)<br>
 | 
				
			||||||
[Sending output to a file](#sending-output-to-a-file)  
 | 
					[Sending output to a file](#sending-output-to-a-file)<br>
 | 
				
			||||||
[Naming a test run](#naming-a-test-run)  
 | 
					[Naming a test run](#naming-a-test-run)<br>
 | 
				
			||||||
[Eliding assertions expected to throw](#eliding-assertions-expected-to-throw)  
 | 
					[Eliding assertions expected to throw](#eliding-assertions-expected-to-throw)<br>
 | 
				
			||||||
[Make whitespace visible](#make-whitespace-visible)  
 | 
					[Make whitespace visible](#make-whitespace-visible)<br>
 | 
				
			||||||
[Warnings](#warnings)  
 | 
					[Warnings](#warnings)<br>
 | 
				
			||||||
[Reporting timings](#reporting-timings)  
 | 
					[Reporting timings](#reporting-timings)<br>
 | 
				
			||||||
[Load test names to run from a file](#load-test-names-to-run-from-a-file)  
 | 
					[Load test names to run from a file](#load-test-names-to-run-from-a-file)<br>
 | 
				
			||||||
[Just test names](#just-test-names)  
 | 
					[Just test names](#just-test-names)<br>
 | 
				
			||||||
[Specify the order test cases are run](#specify-the-order-test-cases-are-run)  
 | 
					[Specify the order test cases are run](#specify-the-order-test-cases-are-run)<br>
 | 
				
			||||||
[Specify a seed for the Random Number Generator](#specify-a-seed-for-the-random-number-generator)  
 | 
					[Specify a seed for the Random Number Generator](#specify-a-seed-for-the-random-number-generator)<br>
 | 
				
			||||||
[Identify framework and version according to the libIdentify standard](#identify-framework-and-version-according-to-the-libidentify-standard)  
 | 
					[Identify framework and version according to the libIdentify standard](#identify-framework-and-version-according-to-the-libidentify-standard)<br>
 | 
				
			||||||
[Wait for key before continuing](#wait-for-key-before-continuing)  
 | 
					[Wait for key before continuing](#wait-for-key-before-continuing)<br>
 | 
				
			||||||
[Specify multiples of clock resolution to run benchmarks for](#specify-multiples-of-clock-resolution-to-run-benchmarks-for)  
 | 
					[Specify multiples of clock resolution to run benchmarks for](#specify-multiples-of-clock-resolution-to-run-benchmarks-for)<br>
 | 
				
			||||||
[Usage](#usage)  
 | 
					[Usage](#usage)<br>
 | 
				
			||||||
[Specify the section to run](#specify-the-section-to-run)  
 | 
					[Specify the section to run](#specify-the-section-to-run)<br>
 | 
				
			||||||
[Filenames as tags](#filenames-as-tags)  
 | 
					[Filenames as tags](#filenames-as-tags)<br>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Catch works quite nicely without any command line options at all - but for those times when you want greater control the following options are available.
 | 
					Catch works quite nicely without any command line options at all - but for those times when you want greater control the following options are available.
 | 
				
			||||||
Click one of the followings links to take you straight to that option - or scroll on to browse the available options.
 | 
					Click one of the followings links to take you straight to that option - or scroll on to browse the available options.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,15 +1,15 @@
 | 
				
			|||||||
<a id="top"></a>
 | 
					<a id="top"></a>
 | 
				
			||||||
# Compile-time configuration
 | 
					# Compile-time configuration
 | 
				
			||||||
 | 
					
 | 
				
			||||||
**Contents**
 | 
					**Contents**<br>
 | 
				
			||||||
[main()/ implementation](#main-implementation)
 | 
					[main()/ implementation](#main-implementation)<br>
 | 
				
			||||||
[Prefixing Catch macros](#prefixing-catch-macros)
 | 
					[Prefixing Catch macros](#prefixing-catch-macros)<br>
 | 
				
			||||||
[Terminal colour](#terminal-colour)
 | 
					[Terminal colour](#terminal-colour)<br>
 | 
				
			||||||
[Console width](#console-width)
 | 
					[Console width](#console-width)<br>
 | 
				
			||||||
[stdout](#stdout)
 | 
					[stdout](#stdout)<br>
 | 
				
			||||||
[Other toggles](#other-toggles)
 | 
					[Other toggles](#other-toggles)<br>
 | 
				
			||||||
[Windows header clutter](#windows-header-clutter)
 | 
					[Windows header clutter](#windows-header-clutter)<br>
 | 
				
			||||||
[Enabling stringification](#enabling-stringification)
 | 
					[Enabling stringification](#enabling-stringification)<br>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Catch is designed to "just work" as much as possible. For most people the only configuration needed is telling Catch which source file should host all the implementation code (```CATCH_CONFIG_MAIN```).
 | 
					Catch is designed to "just work" as much as possible. For most people the only configuration needed is telling Catch which source file should host all the implementation code (```CATCH_CONFIG_MAIN```).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,11 +1,11 @@
 | 
				
			|||||||
<a id="top"></a>
 | 
					<a id="top"></a>
 | 
				
			||||||
# Why do my tests take so long to compile?
 | 
					# Why do my tests take so long to compile?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
**Contents**  
 | 
					**Contents**<br>
 | 
				
			||||||
[Short answer](#short-answer)  
 | 
					[Short answer](#short-answer)<br>
 | 
				
			||||||
[Long answer](#long-answer)  
 | 
					[Long answer](#long-answer)<br>
 | 
				
			||||||
[Practical example](#practical-example)  
 | 
					[Practical example](#practical-example)<br>
 | 
				
			||||||
[Other possible solutions](#other-possible-solutions)  
 | 
					[Other possible solutions](#other-possible-solutions)<br>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Several people have reported that test code written with Catch takes much longer to compile than they would expect. Why is that?
 | 
					Several people have reported that test code written with Catch takes much longer to compile than they would expect. Why is that?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,14 +1,14 @@
 | 
				
			|||||||
<a id="top"></a>
 | 
					<a id="top"></a>
 | 
				
			||||||
# Tutorial
 | 
					# Tutorial
 | 
				
			||||||
 | 
					
 | 
				
			||||||
**Contents**  
 | 
					**Contents**<br>
 | 
				
			||||||
[Getting Catch](#getting-catch)  
 | 
					[Getting Catch](#getting-catch)<br>
 | 
				
			||||||
[Where to put it?](#where-to-put-it)  
 | 
					[Where to put it?](#where-to-put-it)<br>
 | 
				
			||||||
[Writing tests](#writing-tests)  
 | 
					[Writing tests](#writing-tests)<br>
 | 
				
			||||||
[Test cases and sections](#test-cases-and-sections)  
 | 
					[Test cases and sections](#test-cases-and-sections)<br>
 | 
				
			||||||
[BDD-Style](#bdd-style)  
 | 
					[BDD-Style](#bdd-style)<br>
 | 
				
			||||||
[Scaling up](#scaling-up)  
 | 
					[Scaling up](#scaling-up)<br>
 | 
				
			||||||
[Next steps](#next-steps)  
 | 
					[Next steps](#next-steps)<br>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Getting Catch
 | 
					## Getting Catch
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -30,7 +30,7 @@ headingExcludeRelease = [2,3,4,5]  # use level 1 headers for release-notes.md
 | 
				
			|||||||
documentsDefault = os.path.join(os.path.relpath(catchPath), 'docs/*.md')
 | 
					documentsDefault = os.path.join(os.path.relpath(catchPath), 'docs/*.md')
 | 
				
			||||||
releaseNotesName = 'release-notes.md'
 | 
					releaseNotesName = 'release-notes.md'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
contentTitle = '**Contents**  '
 | 
					contentTitle = '**Contents**'
 | 
				
			||||||
contentLineNo = 4
 | 
					contentLineNo = 4
 | 
				
			||||||
contentLineNdx = contentLineNo - 1
 | 
					contentLineNdx = contentLineNo - 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -210,14 +210,14 @@ def createToc(headlines, hyperlink=True, top_link=False, no_toc_header=False):
 | 
				
			|||||||
    if not no_toc_header:
 | 
					    if not no_toc_header:
 | 
				
			||||||
        if top_link:
 | 
					        if top_link:
 | 
				
			||||||
            processed.append('<a class="mk-toclify" id="table-of-contents"></a>\n')
 | 
					            processed.append('<a class="mk-toclify" id="table-of-contents"></a>\n')
 | 
				
			||||||
        processed.append(contentTitle)
 | 
					        processed.append(contentTitle + '<br>')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for line in headlines:
 | 
					    for line in headlines:
 | 
				
			||||||
        if hyperlink:
 | 
					        if hyperlink:
 | 
				
			||||||
            item = '[%s](#%s)  ' % (line[0], line[1])
 | 
					            item = '[%s](#%s)' % (line[0], line[1])
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            item = '%s- %s' % ((line[2]-1)*'    ', line[0])
 | 
					            item = '%s- %s' % ((line[2]-1)*'    ', line[0])
 | 
				
			||||||
        processed.append(item)
 | 
					        processed.append(item + '<br>')
 | 
				
			||||||
    processed.append('\n')
 | 
					    processed.append('\n')
 | 
				
			||||||
    return processed
 | 
					    return processed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user