Skip to content

Commit 6ddfee3

Browse files
DocGen Tool: Don't escape pipe character in metadata (#2124)
We no longer want to escape the pipe character in the metadata fields, but still want to escape it when composing the index.md files.
1 parent ab46dc0 commit 6ddfee3

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

compiler/qsc_doc_gen/src/generate_docs.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ fn generate_index_file(files: &mut FilesWithMetadata, ns: &Rc<str>, items: &mut
522522
"| [{}](xref:Qdk.{}) | {} |",
523523
item.name,
524524
item.fully_qualified_name(),
525-
item.summary
525+
item.summary.replace('|', "\\|")
526526
)
527527
})
528528
.collect::<Vec<_>>()
@@ -698,8 +698,7 @@ fn get_metadata(
698698

699699
let summary = parse_doc_for_summary(&item.doc)
700700
.replace("\r\n", " ")
701-
.replace('\n', " ")
702-
.replace('|', "\\|");
701+
.replace('\n', " ");
703702

704703
Some(Metadata {
705704
uid: format!("Qdk.{ns}.{name}"),

compiler/qsc_doc_gen/src/generate_docs/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ fn generates_unrestricted_item() {
6666
---
6767
uid: Qdk.Std.Diagnostics.CheckZero
6868
title: CheckZero operation
69-
description: "Q# CheckZero operation: Checks whether a qubit is in the \|0⟩ state, returning true if it is."
69+
description: "Q# CheckZero operation: Checks whether a qubit is in the |0⟩ state, returning true if it is."
7070
ms.date: {TIMESTAMP}
7171
ms.topic: managed-reference
7272
qsharp.kind: operation
7373
qsharp.package: __Std__
7474
qsharp.namespace: Std.Diagnostics
7575
qsharp.name: CheckZero
76-
qsharp.summary: "Checks whether a qubit is in the \|0⟩ state, returning true if it is."
76+
qsharp.summary: "Checks whether a qubit is in the |0⟩ state, returning true if it is."
7777
---
7878
7979
# CheckZero operation

library/std/src/Std/Math.qs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Std.Diagnostics.*;
1111

1212
/// # Summary
1313
/// Returns a double-precision approximation of the
14-
/// matematical constant 𝝅 ≈ 3.14159265358979323846
14+
/// mathematical constant 𝝅 ≈ 3.14159265358979323846
1515
///
1616
/// # Remarks
1717
/// Mathematical constant 𝝅 represents the ratio of the circumference

library/std/src/Std/Measurement.qs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ operation MeasureAllZ(register : Qubit[]) : Result {
3434
///
3535
/// # Description
3636
/// Measures each qubit in a register in the `Z` basis
37-
/// and retuns the result of each measurement.
37+
/// and returns the result of each measurement.
3838
/// This operation does not reset the measured qubits to the |0⟩ state,
3939
/// leaving them in the state that corresponds to the measurement results.
4040
///
@@ -46,9 +46,9 @@ operation MeasureAllZ(register : Qubit[]) : Result {
4646
///
4747
/// # Remarks
4848
/// Please note the following differences:
49-
/// - Operation `MeasureEachZ` performs one measurement for each qubit and retuns
49+
/// - Operation `MeasureEachZ` performs one measurement for each qubit and returns
5050
/// an array of results. The operation does not reset the qubits.
51-
/// - Operation `MResetEachZ` performs one measurement for each qubit and retuns
51+
/// - Operation `MResetEachZ` performs one measurement for each qubit and returns
5252
/// an array of results. The operation resets all qubits to |0⟩ state.
5353
/// - Operation `MeasureAllZ` performs a joint measurement on all qubits
5454
/// and returns one result. The operation does not reset the qubits.

0 commit comments

Comments
 (0)