Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enforce 50 <= description length <= 160 #890

Merged
merged 2 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/api/migration-guides/qiskit-1.0-features.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Qiskit 1.0 feature migration guide
description: Adapt to feature changes with Qiskit 1.0
description: Description of feature changes introduced in Qiskit 1.0 and how to update your code to work with them.
---

# Qiskit 1.0 feature changes
Expand Down
2 changes: 1 addition & 1 deletion docs/api/migration-guides/qiskit-1.0.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Qiskit 1.0 migration guide
description: Update your project to use Qiskit 1.0
description: How to update your project so that it works with Qiskit 1.0.
---

# Qiskit 1.0 migration guide
Expand Down
2 changes: 1 addition & 1 deletion docs/api/migration-guides/qiskit-algorithms-module.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: qiskit.algorithms migration guide
description: Use the new interface for `qiskit.algorithms`
description: How to update your code to use the new interface for `qiskit.algorithms`.
---

# Algorithms migration guide
Expand Down
2 changes: 1 addition & 1 deletion docs/api/migration-guides/qiskit-opflow-module.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: qiskit.opflow migration guide
description: Stop using the deprecated `qiskit.opflow` module
description: How to update your code to stop using the deprecated `qiskit.opflow` module.
---

# Opflow migration guide
Expand Down
2 changes: 1 addition & 1 deletion docs/build/circuit-construction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@
}
],
"metadata": {
"description": "How to create and manipulate circuits in Qiskit",
"description": "How to construct and visualize quantum circuits in Qiskit.",
"kernelspec": {
"display_name": "Python 3",
"language": "python",
Expand Down
2 changes: 1 addition & 1 deletion docs/build/interoperate-qiskit-qasm2.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: OpenQASM 2 and Qiskit
description: Convert code between OpenQASM 2 and Qiskit
description: How to convert code between OpenQASM 2 and Qiskit.

---

Expand Down
2 changes: 1 addition & 1 deletion docs/build/interoperate-qiskit-qasm3.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: OpenQASM 3 and Qiskit
description: Convert code between OpenQASM 3 and Qiskit
description: How to convert code between OpenQASM 3 and Qiskit.

---

Expand Down
2 changes: 1 addition & 1 deletion docs/build/qasm-feature-table.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: OpenQASM 3 feature table
description: A list of the OpenQASM 3 language features
description: A table of the language features included in OpenQASM 3.

---

Expand Down
2 changes: 1 addition & 1 deletion docs/run/configure-error-mitigation.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Configure error mitigation
description: Configure error mitigation with Qiskit Runtime
description: How to configure error mitigation with Qiskit Runtime.
---

# Configure error mitigation for Qiskit Runtime
Expand Down
2 changes: 1 addition & 1 deletion docs/run/configure-runtime-compilation.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Configure runtime compilation
description: How to use runtime compilation techniques
description: How to configure runtime compilation in Qiskit Runtime.

---

Expand Down
2 changes: 1 addition & 1 deletion docs/run/primitives-examples.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Primitives examples
description: Practical examples of primitive usage
description: Practical examples of using primitives in Qiskit Runtime.

---

Expand Down
2 changes: 1 addition & 1 deletion docs/run/primitives-get-started.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Get started with primitives
description: Use Qiskit Runtime Estimator and Sampler
description: How to use the Estimator and Sampler primitives in Qiskit Runtime.

---

Expand Down
2 changes: 1 addition & 1 deletion docs/run/quantum-serverless.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Run workloads remotely with Quantum Serverless
description: Run workloads remotely with Quantum Serverless
description: How to run quantum computing workloads remotely using Quantum Serverless.
---

# Run workloads remotely with Quantum Serverless
Expand Down
2 changes: 1 addition & 1 deletion docs/run/run-jobs-batch.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Run jobs in a batch
description: How to run jobs in batch mode.
description: How to run quantum computing jobs in batch mode using Qiskit Runtime.

---

Expand Down
2 changes: 1 addition & 1 deletion docs/run/run-jobs-in-session.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Run jobs in a session
description: Run a job in a session
description: How to run a quantum computing job in a Qiskit Runtime session.

---

Expand Down
2 changes: 1 addition & 1 deletion docs/run/sessions.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Sessions
description: An overview of sessions and when to use them.
description: An overview of Qiskit Runtime sessions and when to use them.

---

Expand Down
2 changes: 1 addition & 1 deletion docs/start/configure-qiskit-local.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Configure Qiskit locally
description: Configure Qiskit on your local machine
description: How to customize the configuration of a local Qiskit installation.

---
# Configure Qiskit locally
Expand Down
2 changes: 1 addition & 1 deletion docs/start/index.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Introduction
description: Introduction to IBM Quantum documentation
description: Introduction to IBM Quantum, Qiskit, and Qiskit Runtime.
kevinsung marked this conversation as resolved.
Show resolved Hide resolved

in_page_toc_max_heading_level: 2

Expand Down
2 changes: 1 addition & 1 deletion docs/transpile/defaults-and-configuration-options.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Transpilation defaults and configuration options
description: Default settings and configuration options
description: The default settings and configuration options for quantum circuit transpilation in Qiskit.

---
# Transpilation default settings and configuration options
Expand Down
2 changes: 1 addition & 1 deletion docs/transpile/index.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Introduction
description: Introduction to the transpiler
description: Introduction to transpiling quantum circuits in Qiskit.

---

Expand Down
2 changes: 1 addition & 1 deletion docs/transpile/set-optimization.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Set transpiler optimization level
description: Learn how to set the optimization level
description: How to set the optimization level for transpiling quantum circuits in Qiskit.

---
# Set the optimization level
Expand Down
2 changes: 1 addition & 1 deletion docs/transpile/transpiler-stages.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@
],
"metadata": {
"celltoolbar": "Raw Cell Format",
"description": "Overview of transpiler stages and the PassManager",
"description": "The default stages of the quantum circuit transpilation pipeline in Qiskit.",
"kernelspec": {
"display_name": "Python 3",
"language": "python",
Expand Down
2 changes: 1 addition & 1 deletion docs/verify/index.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Introduction
description: Introduction to the Verify phase
description: Introduction to verifying quantum circuits in Qiskit.
---
# Introduction

Expand Down
2 changes: 1 addition & 1 deletion docs/verify/simulate-with-qiskit-primitives.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Exact simulation with Qiskit primitives
description: Simulate with Qiskit reference primitives. How to compute an expectation value with the Estimator primitive, and how to compute circuit output probabilities with the Sampler primitive
description: How to perform exact simulation of quantum circuits using primitives in Qiskit.
---

# Exact simulation with Qiskit primitives
Expand Down
2 changes: 1 addition & 1 deletion docs/verify/stabilizer-circuit-simulation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
}
],
"metadata": {
"description": "Efficient simulation of stabilizer circuits with Qiskit Aer primitives",
"description": "How to efficiently simulate stabilizer circuits using Qiskit Aer primitives.",
"kernelspec": {
"display_name": "Python 3",
"language": "python",
Expand Down
13 changes: 9 additions & 4 deletions scripts/commands/checkMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ const readMetadata = async (filePath: string): Promise<Record<string, any>> => {
};

const isValidMetadata = (metadata: Record<string, any>): boolean =>
metadata.title && metadata.description;
metadata.title &&
metadata.description &&
metadata.title != metadata.description &&
metadata.description.length <= 160 &&
metadata.description.length >= 50;

const main = async (): Promise<void> => {
const args = readArgs();
Expand Down Expand Up @@ -106,7 +110,7 @@ function handleErrors(mdErrors: string[], notebookErrors: string[]): void {
---
The title should be the page title: it's used for browser tabs and the top line of search results. The description should describe the page
in <160 characters, ideally using some keywords. The description is what
in at least 50 but no more than 160 characters, ideally using some keywords. The description is what
shows up as the text in search results. See https://github.com/Qiskit/documentation/issues/131 for some tips.
Please fix these files:\n\n${mdErrors.join("\n")}
Expand All @@ -116,7 +120,8 @@ function handleErrors(mdErrors: string[], notebookErrors: string[]): void {
console.error(`
Invalid Jupyter notebook metadata. Every .ipynb file needs to
set 'title' and 'description' in the file metadata. You need to
manually add this metadata.
manually add this metadata. Furthermore, the length of the description
must be at least 50 but no more than 160 characters.
For example, if using VSCode, open up the file with
the "Open With..." option and then "Text Editor".
Expand All @@ -130,7 +135,7 @@ function handleErrors(mdErrors: string[], notebookErrors: string[]): void {
Finally, add new keys in the "metadata" section for "title" and "description".
The title should be the page title: it's used for browser tabs
and the top line of search results. The description should describe the page
in <160 characters, ideally using some keywords. The description is what
in at least 50 but no more than 160 characters, ideally using some keywords. The description is what
shows up as the text in search results. See
https://github.com/Qiskit/documentation/issues/131 for some tips.
Expand Down
Loading