From c18a9715b83ef94a56c064edee511162998001cc Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Sun, 10 Jan 2021 07:48:34 -0500 Subject: Hotdoc: use template for Commands.md instead of generating the entire file (#8154) * doc: fix hotdoc misuse for dynamically generated content hotdoc has a native include feature for including files inline. Use this to generate one file for each dynamically generated code block, and include that file in Commands.md; see: https://hotdoc.github.io/syntax-extensions.html#smart-file-inclusion-syntax This permits us to move back to using the in-tree version of the hotdoc *.md sources, thus fixing the incorrect inclusion of "builddir/" in the "Edit on github" links which resulted from using copies as the source. Fixes #8061 * doc: call the dummy file a "stamp" as it is a better known term --- run_unittests.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'run_unittests.py') diff --git a/run_unittests.py b/run_unittests.py index 1ff54eb..d6afaff 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -4915,7 +4915,7 @@ class AllPlatformTests(BasePlatformTests): # The docs directory is not in release tarballs. if not os.path.isdir('docs'): raise unittest.SkipTest('Doc directory does not exist.') - doc_path = 'docs/markdown_dynamic/Commands.md' + doc_path = 'docs/markdown/Commands.md' md = None with open(doc_path, encoding='utf-8') as f: @@ -4944,13 +4944,9 @@ class AllPlatformTests(BasePlatformTests): def get_data_pattern(command): return re.compile( - r'^```[\r\n]' - r'{{ cmd_help\[\'' + command + r'\'\]\[\'usage\'\] }}[\r\n]' - r'^```[\r\n]' + r'{{ ' + command + r'_usage.inc }}[\r\n]' r'.*?' - r'^```[\r\n]' - r'{{ cmd_help\[\'' + command + r'\'\]\[\'arguments\'\] }}[\r\n]' - r'^```', + r'{{ ' + command + r'_arguments.inc }}[\r\n]', flags = re.MULTILINE|re.DOTALL) for command in md_commands: @@ -7533,7 +7529,7 @@ class LinuxCrossArmTests(BaseLinuxCrossTests): '-Dbuild.pkg_config_path=' + os.path.join(testdir, 'build_extra_path'), '-Dpkg_config_path=' + os.path.join(testdir, 'host_extra_path'), ]) - + def test_run_native_test(self): ''' https://github.com/mesonbuild/meson/issues/7997 -- cgit v1.1