Skip to content

Commit 5c71e3a

Browse files
committed
State differences between XML and Markdown formats
1 parent 25adcc8 commit 5c71e3a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

docs/query-help-style-guide.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Query help files must have the same base name as the query they describe and mus
2020

2121
### File structure and layout
2222

23-
Query help files can be written in either a custom XML format (with a `.qhelp` extension) or in Markdown (with a `.md` extension). Both formats are supported by the CodeQL documentation tooling.
23+
Query help files can be written in either a custom XML format (with a `.qhelp` extension) or in Markdown (with a `.md` extension). Both formats are supported by the CodeQL documentation tooling. There are a few minor differences, noted in the section `Differences between XML and markdown formats` below.
2424

2525
#### Markdown query help files
2626

@@ -126,7 +126,7 @@ For example:
126126
127127
### Referencing potential security weaknesses
128128

129-
If your query checks code for a CWE weakness, you should use the `@tags` element in the query file to reference the associated CWEs, as explained [here](query-metadata-style-guide.md). When you use these tags, a link to the appropriate entry from the [MITRE.org](https://cwe.mitre.org/scoring/index.html) site will automatically appear as a reference in the output HTML file.
129+
If your query checks code for a CWE weakness, you should use the `@tags` element in the query file to reference the associated CWEs, as explained [here](query-metadata-style-guide.md). When you use these tags in a query help file in the custom XML format, a link to the appropriate entry from the [MITRE.org](https://cwe.mitre.org/scoring/index.html) site will automatically appear as a reference in the output HTML file.
130130

131131
## Validating query help files
132132

@@ -143,6 +143,11 @@ Please include the query help files (and any associated code snippets) in your p
143143

144144
More information on how to test your query help files can be found [within the documentation](https://docs.github.com/en/code-security/codeql-cli/using-the-codeql-cli/testing-query-help-files)
145145

146+
## Differences between XML and markdown formats
147+
148+
1. The XML format allows for the contents of other files to be included in the output generated by processing the file, as mentioned in the section `Code examples`. This is not possible with the Markdown format.
149+
2. When using the XML format, references are added to the output HTML file based on CWE tags, as mentioned in the section `Referencing potential security weaknesses`.
150+
146151
## Query help example
147152

148153
The following example is a query help file for a query from the standard query suite for Java, shown in both Markdown and XML formats.

0 commit comments

Comments
 (0)