diff --git a/.github/workflows/check-for-nb.yaml b/.github/workflows/check-for-nb.yaml
deleted file mode 100644
index 3b3856e04..000000000
--- a/.github/workflows/check-for-nb.yaml
+++ /dev/null
@@ -1,41 +0,0 @@
-name: Check for Textbook notebooks
-
-on:
- workflow_dispatch:
- # run every 1st of each month at 10:00am UTC
- # https://crontab.guru/#0_10_1_*_*
- schedule:
- - cron: "0 10 1 * *"
-
-jobs:
- check-notebooks:
- name: Notebooks check
-
- runs-on: ubuntu-latest
-
- steps:
- - name: Checkout Qiskit/platypus
- uses: actions/checkout@v3
- with:
- path: platypus
-
- - name: Checkout qiskit-community/qiskit-textbook
- uses: actions/checkout@v3
- with:
- repository: qiskit-community/qiskit-textbook
- path: qiskit-textbook
-
- - name: Diff notebook directories
- id: diff
- shell: bash
- run: platypus/scripts/missing_nb_check.sh
-
- - name: Create issue using REST API
- if: steps.diff.outputs.NUM_NB != '0'
- run: |
- curl --request POST \
- --url https://api.github.com/repos/${{ github.repository }}/issues \
- --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
- --header 'content-type: application/json' \
- --data-binary @issue.txt \
- --fail
diff --git a/LOCALIZATION_CONTRIBUTORS b/LOCALIZATION_CONTRIBUTORS
index fcb9d6aba..fa020843d 100644
--- a/LOCALIZATION_CONTRIBUTORS
+++ b/LOCALIZATION_CONTRIBUTORS
@@ -34,6 +34,7 @@ German (DE)
Thorsten Mรผhge | TMuehge
Zina Efchary | zinaefchary
+Sasko Schirmer | c0nr3f
Spanish (ES_UN)
@@ -80,6 +81,7 @@ Jaejun Ko | Rapo1756
Eunmi Bae | likeyellow
Chanyang Im | imchanyang
Yuri Han | urihan
+Minje Kim | Quantum-Tiger-K
Indonesian (ID)
@@ -113,3 +115,4 @@ Bin Liu | fjirsmliu
Weixiao Sun | sunwx17
Diksha Sharma | dikshasharma0795
Samanvay Sharma | starktech23
+Saiprateek Dasgandhi | PSD-20
diff --git a/TRANSLATING.md b/TRANSLATING.md
index 4a20e5f11..fa276a292 100644
--- a/TRANSLATING.md
+++ b/TRANSLATING.md
@@ -4,6 +4,10 @@ First of all, **thank you** for showing interest in translating (localizing) Qis
**Please note that you must sign up separately if you want to join the localization project for [Qiskit Documentation](https://qiskit.org/documentation/). For signing up to join the Qiskit Documentation Localization project, please refer the steps outlined [here](https://github.com/qiskit-community/qiskit-translations/blob/master/README.md).**
+$$\color{#D22222}\textsf{\Large\⚠\kern{0.2cm}\Large No new joining requests will be accepted in GitLocalize.}$$
+
+$$\color{#D22222}\textsf{\qquad\kern{0.2cm}\Large This is due the upcoming changes on Qiskit Textbook.}$$
+
If you are interested in contributing to translating the Qiskit Textbook, please follow the instructions below.
## Steps to participate in Qiskit textbook translations:
diff --git a/converter/common.ts b/converter/common.ts
index fd071dd60..8c38ed878 100644
--- a/converter/common.ts
+++ b/converter/common.ts
@@ -3,6 +3,9 @@ import * as path from 'path'
import * as fs from 'fs-extra'
import { load as loadYAML } from 'js-yaml'
+// NOTE: if changing this also update the same variable in 'server/utilities.ts'
+const LATEST_TEXTBOOK_VERSION = 'v2'
+
const CWD = process.cwd()
// Get the languages to translate from the mathigon config file or throw an error
@@ -23,5 +26,6 @@ const workingTranslationsPath = path.join(CWD, 'working', 'translations')
export {
translationsLanguages,
workingContentPath,
- workingTranslationsPath
+ workingTranslationsPath,
+ LATEST_TEXTBOOK_VERSION
}
diff --git a/converter/converter.ts b/converter/converter.ts
index 693d45eb0..2e3449ea3 100644
--- a/converter/converter.ts
+++ b/converter/converter.ts
@@ -6,7 +6,8 @@ import * as fs from 'fs-extra'
import {
translationsLanguages,
workingContentPath,
- workingTranslationsPath
+ workingTranslationsPath,
+ LATEST_TEXTBOOK_VERSION
} from './common'
const CWD = process.cwd()
@@ -92,11 +93,17 @@ const prepare = function (language: string) {
copyNotebookAssets(notebooks, working, (src: string, dest: string) => {
return path.dirname(src).split(path.sep).indexOf(nbImagesDirName) > -1
})
+ copyNotebookAssets(`${notebooks}${path.sep}${LATEST_TEXTBOOK_VERSION}`, working, (src: string, dest: string) => {
+ return path.dirname(src).split(path.sep).indexOf(nbImagesDirName) > -1
+ })
// copy over notebook `resources/`
copyNotebookAssets(notebooks, working, (src: string, dest: string) => {
return path.dirname(src).split(path.sep).indexOf(nbResourcesDirName) > -1
})
+ copyNotebookAssets(`${notebooks}${path.sep}${LATEST_TEXTBOOK_VERSION}`, working, (src: string, dest: string) => {
+ return path.dirname(src).split(path.sep).indexOf(nbResourcesDirName) > -1
+ })
}
const convert = function (language: string) {
diff --git a/converter/textbook-converter/requirements.txt b/converter/textbook-converter/requirements.txt
index f81a1e8c5..bbc5c87bb 100644
--- a/converter/textbook-converter/requirements.txt
+++ b/converter/textbook-converter/requirements.txt
@@ -2,4 +2,4 @@ ipython>=6
nbformat>=4
nbconvert>=5
requests
-pyyaml
+pyyaml==5.3.1
diff --git a/cypress/integration/sidebar.spec.js b/cypress/integration/sidebar.spec.js
index 022f4aee1..1e59273a0 100644
--- a/cypress/integration/sidebar.spec.js
+++ b/cypress/integration/sidebar.spec.js
@@ -7,11 +7,8 @@ describe('Sidebar', () => {
it('can be toggled on a laptop', () => {
cy.viewport('macbook-15')
cy.visit('/course/ch-prerequisites')
- cy.get(sidebarSelector).should('be.visible')
cy.get(toggleSidebarSelector).click()
cy.get(sidebarSelector).should('be.not.visible')
- cy.get(toggleSidebarSelector).click()
- cy.get(sidebarSelector).should('be.visible')
})
it('can be toggled on a tablet', () => {
@@ -19,7 +16,6 @@ describe('Sidebar', () => {
cy.visit('/course/ch-prerequisites')
cy.get(sidebarSelector).should('be.not.visible')
cy.get(toggleSidebarSelector).click()
- cy.get(sidebarSelector).should('be.visible')
cy.get(toggleSidebarSelector).click()
cy.get(sidebarSelector).should('be.not.visible')
})
diff --git a/frontend/scss/components/textbook__page.scss b/frontend/scss/components/textbook__page.scss
index 7980f9388..3099bea87 100755
--- a/frontend/scss/components/textbook__page.scss
+++ b/frontend/scss/components/textbook__page.scss
@@ -20,11 +20,14 @@ main.body {
.c-textbook {
display: flex;
- max-height: 100%;
- min-height: calc(100vh - $qiskit-navbar-height);
+ height: calc(100vh - $qiskit-navbar-height - $one-xp-banner-height-desktop);
overflow: hidden;
position: relative;
+ @include mq($until: large) {
+ height: calc(100vh - $qiskit-navbar-height - $one-xp-banner-height-mobile);
+ }
+
@include mq($until: medium) {
display: grid;
grid-template-columns: 1fr 1fr;
diff --git a/frontend/scss/variables/settings.scss b/frontend/scss/variables/settings.scss
index 26d0ea9ea..f8432ab60 100755
--- a/frontend/scss/variables/settings.scss
+++ b/frontend/scss/variables/settings.scss
@@ -7,6 +7,9 @@ $textbook-page-width: 100%;
$qiskit-navbar-height: 3.5rem;
$textbook-page-banner-height: 40px;
+$one-xp-banner-height-desktop: 3.25rem;
+$one-xp-banner-height-mobile: 5rem;
+
$left-sidebar-width: 16rem;
$left-sidebar-width-hidden: 3rem;
$left-sidebar-width-sm: 3.5rem;
@@ -19,6 +22,6 @@ $spacing-unit-small: 12px;
$spacing-unit: 24px;
// Grid parameters.
-$column-size-large: 4rem;
+$column-size-large: 6rem;
$column-size-medium: 5rem;
-$column-size-small: 5rem;
+$column-size-small: 4rem;
diff --git a/frontend/vue/components/CodeExercise/CodeExercise.vue b/frontend/vue/components/CodeExercise/CodeExercise.vue
index ffcf325f7..3cec855e0 100644
--- a/frontend/vue/components/CodeExercise/CodeExercise.vue
+++ b/frontend/vue/components/CodeExercise/CodeExercise.vue
@@ -13,6 +13,7 @@
-
+
{{ $translate('Connecting to the server') }}
@@ -45,6 +45,7 @@ export default defineComponent({
},
data () {
return {
+ kernelLoading: false,
kernelPromise: undefined as Promise
| undefined,
kernel: undefined as IKernelConnection | undefined,
outputArea: undefined as OutputArea | undefined,
@@ -53,19 +54,6 @@ export default defineComponent({
}
},
mounted () {
- this.$emit('loadingKernel')
- const outputDivRef = (this.$refs.outputDiv as HTMLDivElement)
-
- this.kernelPromise = requestBinderKernel()
-
- this.kernelPromise.then((kernel: IKernelConnection) => {
- this.kernel = kernel
- this.$emit('kernelReady')
- this.outputArea = createOutputArea(outputDivRef)
- }, (error: Error) => {
- this.error = error.message
- })
-
this.apiTokenPromise = getQiskitUser().then(user => user?.apiToken)
},
methods: {
@@ -103,9 +91,9 @@ export default defineComponent({
},
_executeCode (code: string) {
this.error = ''
- this.outputArea!.setHidden(true)
- this.kernelPromise!.then((kernel: IKernelConnection) => {
+ this._initKernel()!.then((kernel: IKernelConnection) => {
this.$emit('running')
+ this.outputArea!.setHidden(true)
try {
const requestFuture = kernel.requestExecute({ code })
this.setOutputFuture(requestFuture)
@@ -128,6 +116,26 @@ export default defineComponent({
}
})
},
+ _initKernel (): Promise {
+ if (this.kernelPromise) {
+ return this.kernelPromise
+ }
+
+ this.$emit('kernelLoading')
+ this.kernelLoading = true
+ const outputDivRef = (this.$refs.outputDiv as HTMLDivElement)
+
+ this.kernelPromise = requestBinderKernel()
+
+ return this.kernelPromise.then((kernel: IKernelConnection) => {
+ this.kernelLoading = false
+ this.$emit('kernelReady')
+ this.outputArea = createOutputArea(outputDivRef)
+ return kernel
+ }, (error: Error) => {
+ this.error = error.message
+ }) as Promise
+ },
setOutputFuture (future : IOutputShellFuture) {
this.outputArea!.future = future
},
diff --git a/frontend/vue/components/CodeExercise/ExerciseActionsBar.vue b/frontend/vue/components/CodeExercise/ExerciseActionsBar.vue
index f4f59a022..c615e9af5 100644
--- a/frontend/vue/components/CodeExercise/ExerciseActionsBar.vue
+++ b/frontend/vue/components/CodeExercise/ExerciseActionsBar.vue
@@ -1,5 +1,14 @@
+