### Paranext Walkthroughs and Guides Source: https://github.com/paranext/paranext-core/wiki/Platform.Bible-and-Paratext-10-Studio Guides for getting started with Platform.Bible and Paratext 10 Studio, building the project, and creating extensions, including video walkthroughs. ```GitHub Wiki https://github.com/paranext/paranext/wiki/Getting-Started-with-Platform.Bible-and-Paratext-10-Studio ``` ```GitHub https://github.com/paranext/paranext-core?tab=readme-ov-file#developer-install ``` ```GitHub Wiki https://github.com/paranext/paranext-extension-template/wiki/Your-First-Extension ``` ```Google Drive https://drive.google.com/file/d/12F6XpNu9cjtF9Z6Phe-7GuWWlearcw27/view?t=50m57s ``` ```Google Docs https://docs.google.com/document/d/1KBvnmwTxaO5h4Rq8PV82v2GELNslyVKCbFJ1-FV3TVQ ``` ```Google Drive https://drive.google.com/file/d/17CM4PlL_OikCP1lvBlAp01nDoAJnPoYw/view ``` -------------------------------- ### Install and Setup Extension Template Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/hello-rock3/README.md Instructions for installing and setting up the Platform.Bible extension template. This involves cloning the repository and potentially running installation commands. ```bash # To install and set up this repo # (Skip if creating an extension within paranext-multi-extension-template) # Further instructions would typically follow here, like running npm install or similar. ``` -------------------------------- ### Install Dependencies Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/hello-rock3/README.md Commands to install project dependencies and potentially setup the paranext-core dependency. ```bash # Install paranext-core (assuming it's cloned in a parent directory) git clone https://github.com/paranext/paranext-core.git ../paranext-core # Install local dependencies npm install ``` -------------------------------- ### Install Dependencies Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/hello-someone/README.md Commands to install project dependencies and potentially setup the paranext-core dependency. ```bash # Install paranext-core (assuming it's cloned in a parent directory) git clone https://github.com/paranext/paranext-core.git ../paranext-core # Install local dependencies npm install ``` -------------------------------- ### Install and Set Up Repo Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/platform-get-resources/README.md Instructions for installing and setting up the repository. This typically involves cloning the repository and installing dependencies. ```bash git clone cd npm install ``` -------------------------------- ### Install and Set Up Repository Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/platform-lexical-tools/README.md Instructions for installing and setting up the repository. This is a prerequisite for customizing the template and hooking it up for future updates. ```bash #!/bin/bash # Install dependencies npm install # Build the project npm run build ``` -------------------------------- ### Install and Set Up Repository Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/quick-verse/README.md Instructions for installing and setting up the repository. This is a prerequisite for customizing the template. ```bash # Install dependencies npm install # Build the extension npm run build ``` -------------------------------- ### Install Dependencies Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/platform-scripture-editor/README.md Commands to install project dependencies and potentially setup the paranext-core dependency. ```bash # Install paranext-core (assuming it's cloned in a parent directory) git clone https://github.com/paranext/paranext-core.git ../paranext-core # Install local dependencies npm install ``` -------------------------------- ### Install Dependencies Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/quick-verse/README.md Installs local and published dependencies for the extension. Requires prior installation of paranext-core. ```bash npm install ``` -------------------------------- ### Install and Set Up Repository Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/platform-scripture-editor/README.md Instructions for installing and setting up the repository. This is a prerequisite for customizing the template. ```bash # To install # (Specific commands would go here if provided in the text) ``` -------------------------------- ### Install and Set Up Repo Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/legacy-comment-manager/README.md Instructions for installing and setting up the current repository. This is a prerequisite for customizing the template. ```bash #!/bin/bash # Example installation command (replace with actual commands) # npm install # npm run build ``` -------------------------------- ### Install Dependencies Source: https://github.com/paranext/paranext-core/blob/main/lib/platform-bible-utils/README.md Installs the necessary dependencies for the development environment. ```bash npm i ``` -------------------------------- ### Install Local Snap Package Source: https://github.com/paranext/paranext-core/blob/main/README.md Commands to install a locally created snap package for Platform.Bible on Linux. It includes installing the snap file and connecting it to the dot-platform-bible interface. ```bash sudo snap install --dangerous sudo snap connect platform-bible:dot-platform-bible ``` -------------------------------- ### Install Dependencies Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/platform-lexical-tools/README.md Installs local and published dependencies for the extension. Requires prior installation of paranext-core. ```bash npm install ``` -------------------------------- ### Paranext Development Guides Source: https://github.com/paranext/paranext-core/wiki/Platform.Bible-and-Paratext-10-Studio Guides for developers on code style, code review, testing, UX design, and a project glossary. ```GitHub Wiki https://github.com/paranext/paranext/wiki/Code-Style-Guide ``` ```GitHub Wiki https://github.com/paranext/paranext/wiki/Code-Review-Guide ``` ```GitHub Wiki https://github.com/paranext/paranext/wiki/Testing-Guide ``` ```GitHub Wiki https://github.com/paranext/paranext/wiki/Design-System ``` ```Notion https://www.notion.so/paratext/6ca2c1d0e4f34713a883cc07902c0b9e?v=5a8a02f436b143e0883b28ef98faabda ``` -------------------------------- ### Start Platform.Bible with Extension Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/quick-verse/README.md Starts Platform.Bible with the extension. The built extension is located in the 'dist' folder and is automatically referenced via a command-line argument in the package.json start script. ```bash npm start ``` -------------------------------- ### Install Dependencies Source: https://github.com/paranext/paranext-core/blob/main/lib/platform-bible-react/README.md Installs all necessary dependencies for the development environment. ```bash npm i ``` -------------------------------- ### Run Preview Site Source: https://github.com/paranext/paranext-core/blob/main/lib/platform-bible-react/src/preview/README.md Starts the local development server for the preview site, enabling live reloading of platform-bible-react components. ```bash npm start ``` -------------------------------- ### Start Platform.Bible with Extension Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/platform-lexical-tools/README.md Starts Platform.Bible with the extension. The built extension is located in the 'dist' folder and is automatically provided via a command-line argument in the package.json start script. ```bash npm start ``` -------------------------------- ### Running the Extension Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/hello-someone/README.md Command to start Platform.Bible with the Paranext Core extension. It highlights the need to specify the extension path. ```bash # Start Platform.Bible with the extension npm start ``` -------------------------------- ### Start Platform.Bible with Extension Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/legacy-comment-manager/README.md Starts Platform.Bible with the extension. The built extension is located in the 'dist' folder and is automatically provided via a command-line argument in the package.json 'start' script. ```bash npm start ``` -------------------------------- ### Running the Extension Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/hello-rock3/README.md Command to start Platform.Bible with the Paranext Core extension. It highlights the need to specify the extension path. ```bash # Start Platform.Bible with the extension npm start ``` -------------------------------- ### Install Dependencies Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/platform-get-resources/README.md Installs local and published dependencies for the extension. Requires prior installation of paranext-core. ```bash npm install ``` -------------------------------- ### Install Dependencies Source: https://github.com/paranext/paranext-core/blob/main/extensions/README.md Installs project dependencies using npm. This includes installing local and published dependencies for the extensions. ```bash npm install ``` -------------------------------- ### Installing Dependencies and Building Paranext Core Source: https://github.com/paranext/paranext-core/blob/main/README.md Installs project dependencies using npm and then builds the project. These are standard commands for Node.js projects managed with npm. ```bash npm install npm run build ``` -------------------------------- ### Starting Paranext Core Development Server Source: https://github.com/paranext/paranext-core/blob/main/README.md Starts the Paranext application in the development environment. This command also enables hot reloading for code changes during development. ```bash npm start ``` -------------------------------- ### Install Dependencies Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/paratext-registration/README.md Installs local and published dependencies for the extension. Assumes paranext-core is installed. ```bash npm install ``` -------------------------------- ### Setup WebView event handlers and data subscriptions Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/hello-someone/src/hello-someone.web-view.html Sets up event listeners for buttons to interact with a people data provider. Includes handlers for getting greetings, deleting people, setting greetings, and setting ages. Also subscribes to people and greeting updates to update the UI. ```javascript const papi = require('@papi/frontend'); const { logger } = require('@papi/frontend'); const { getErrorMessage, htmlEncode, isPlatformError, serialize, } = require('platform-bible-utils'); function print(input) { logger.debug(input); } const dataProviderPromise = papi.dataProviders.get('helloSomeone.people'); async function setupWebView() { const peopleDataProvider = await dataProviderPromise; // Attach handler for greetings-button const greetingsButton = document.getElementById('greetings-button'); greetingsButton.addEventListener('click', async () => { const nameInput = document.getElementById('name-input'); const greeting = await peopleDataProvider.getGreeting(nameInput.value.toLowerCase()); const helloSomeoneOutput = document.getElementById('greetings-button-output'); helloSomeoneOutput.textContent = htmlEncode(greeting || ''); print(greeting); }); greetingsButton.addEventListener('contextmenu', async (e) => { e.preventDefault(); const nameInput = document.getElementById('name-input'); const name = nameInput.value.toLowerCase(); const promises = new Array(10000); for (let i = 0; i < 10000; i += 1) promises[i] = peopleDataProvider.getGreeting(name); await Promise.all(promises); print('Done'); }); // Attach handler for delete-button const deleteButton = document.getElementById('delete-button'); deleteButton.addEventListener('click', async () => { const nameInput = document.getElementById('name-input'); const success = await peopleDataProvider.deletePerson(nameInput.value.toLowerCase()); const helloSomeoneOutput = document.getElementById('greetings-button-output'); helloSomeoneOutput.textContent = htmlEncode( `${success ? 'Successfully' : 'Unsuccessfully'} deleted ${nameInput.value}.${ success ? ' RIP ⚰️' : '' }`.replace(/'/g, '`'), ); }); // Attach handler for set-greetings-button const setGreetingsButton = document.getElementById('set-greetings-button'); setGreetingsButton.addEventListener('click', async () => { const nameInput = document.getElementById('name-input'); const name = nameInput.value; const setGreetingsInput = document.getElementById('set-greetings-input'); const success = await peopleDataProvider.setGreeting( name.toLowerCase(), setGreetingsInput.value, ); const helloSomeoneOutput = document.getElementById('greetings-button-output'); helloSomeoneOutput.textContent = htmlEncode( `${success ? 'Successfully' : 'Unsuccessfully'} set ${name}'s greeting!`.replace( /'/g, '`', ), ); }); // Attach handler for set-age-button const setAgeButton = document.getElementById('set-age-button'); setAgeButton.addEventListener('click', async () => { const nameInput = document.getElementById('name-input'); const name = nameInput.value; const setAgeInput = document.getElementById('set-age-input'); const success = await peopleDataProvider.setAge( name.toLowerCase(), parseInt(setAgeInput.value), ); const helloSomeoneOutput = document.getElementById('greetings-button-output'); helloSomeoneOutput.textContent = htmlEncode( `${success ? 'Successfully' : 'Unsuccessfully'} set ${name}'s age!`.replace(/'/g, '`'), ); }); // Update the 'people' display on load and on updates peopleDataProvider.subscribePeople(undefined, (people) => { if (isPlatformError(people)) { logger.warn(`subscribePeople received PlatformError: ${getErrorMessage(people)}`); return; } const peopleData = document.getElementById('people-data'); const peopleString = serialize(people, undefined, 2); peopleData.textContent = htmlEncode(peopleString.replace(/"/g, '`')); print(peopleString); }); // Update the people update count on any people update let peopleUpdateCount = 0; peopleDataProvider.subscribePeople( undefined, () => { peopleUpdateCount += 1; const peopleUpdateCountDiv = document.getElementById('people-update-count'); peopleUpdateCountDiv.textContent = htmlEncode(`People Updates: ${peopleUpdateCount}`); }, { retrieveDataImmediately: false }, ); // Update the greetings count on greetings updates let billAnyGreetingsUpdateCount = 0; peopleDataProvider.subscribeGreeting( 'BiLl', () => { billAnyGreetingsUpdateCount += 1; const billAnyGreetingsUpdateCountDiv = document.getElementById( 'bill-any-greetings-update-count', ); billAnyGreetingsUpdateCountDiv.textContent = htmlEncode( `Any Greetings Updates (via Bill): ${billAnyGreetingsUpdateCount}`, ); }, { retrieveDataImmediately: false, whichUpdates: '*' }, ); // Update the greetings count on greetings updates let billGreetingsUpdateCount = -1; peopleDataProvider.subscribeGreeting('bIlL', () => { billGreetingsUpdateCount += 1; const billGreetingsUpdateCountDiv = document.getElementById( 'bill-greetings-update-count', ); billGreetingsUpdateCountDiv.textContent = htmlEncode( `Bill Greetings Updates: ${billGreetingsUpdateCount}`, ); }); // Update the age count on age updates let billAnyAgeUpdateCount = 0; peopleDataProvider.subscribeAge( 'BiLl', () => { billAnyAgeUpdateCount += 1; const billAnyAgeUpdateCountDiv = document.getElementById( 'bill-any-age-update-count', ); billAnyAgeUpdateCountDiv.textContent = htmlEncode( `Any Age Updates (via Bill): ${billAnyAgeUpdateCount}`, ); }, { retrieveDataImmediately: false, whichUpdates: '*' }, ); // Update the age count on age updates let billAgeUpdateCount = -1; peopleDataProvider.subscribeAge('bIlL', () => { billAgeUpdateCount += 1; const billAgeUpdateCountDiv = document.getElementById('bill-age-update-count'); billAgeUpdateCountDiv.textContent = htmlEncode(`Bill Age Updates: ${billAgeUpdateCount}`); }); } setupWebView(); ``` -------------------------------- ### Install Dependencies Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/legacy-comment-manager/README.md Installs local and published dependencies for the extension. Requires prior installation of 'paranext-core'. ```bash npm install ``` -------------------------------- ### Preview Platform.Bible React Components Source: https://github.com/paranext/paranext-core/blob/main/lib/platform-bible-react/README.md Starts a development server to preview the platform-bible-react components. The preview is located at `src/preview/app.component.tsx`. ```bash npm start ``` -------------------------------- ### Run Platform.Bible with Extension Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/paratext-registration/README.md Starts Platform.Bible with the built extension located in the 'dist' folder. The command-line argument for the extension path is included in the package.json 'start' script. ```bash npm start ``` -------------------------------- ### Start Platform.Bible with Extension Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/platform-get-resources/README.md Starts Platform.Bible with the extension. The built extension is located in the 'dist' folder and is automatically referenced via a command-line argument in the package.json start script. ```bash npm start ``` -------------------------------- ### GitHub Actions Workflow Example Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/quick-verse/README.md An example of a GitHub Actions workflow file for automating processes in the repository. ```yaml name: CI # Controls when the action will run. # For example, running it only on push to the main branch: on: push: branches: [ main ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: # A workflow run is made up of one or more jobs that can be run independently. jobs: # The build job build: # The type of runner that the job will run on runs-on: ubuntu-latest # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository into the workspace so your job can access it - uses: actions/checkout@v3 # Runs a single command using the OS shell - name: Run a one-line script run: echo Hello, world! # Runs a set of commands using the OS shell - name: Run a multi-line script run: | echo Add other tools, just as 'make' echo Build the project npm install npm run build ``` -------------------------------- ### Paranext Development Help and Resources Source: https://github.com/paranext/paranext-core/wiki/Platform.Bible-and-Paratext-10-Studio Provides links to the Platform.Bible Discord server, API documentation, troubleshooting guides, and React learning resources. ```Discord https://discord.gg/tzw22PUEAY ``` ```APIDOC https://paranext.github.io/paranext-core/ ``` ```GitHub Wiki https://github.com/paranext/paranext/wiki/Troubleshooting-Guide ``` ```GitHub Wiki https://github.com/paranext/paranext-extension-template/wiki ``` ```Google Docs https://docs.google.com/document/d/1sT85MJosKWHH4Kbljsl_Wmzy3bRdrlHav7faGA9GQmo/edit#heading=h.67pi94imi9qb ``` -------------------------------- ### Run Platform.Bible with Extensions Source: https://github.com/paranext/paranext-core/blob/main/extensions/README.md Starts Platform.Bible with the included extensions. The built extensions are located in the 'dist' folder and are automatically watched for changes. ```bash npm start ``` -------------------------------- ### Running the Extension Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/platform-scripture-editor/README.md Command to start Platform.Bible with the Paranext Core extension. It highlights the need to specify the extension path. ```bash # Start Platform.Bible with the extension npm start ``` -------------------------------- ### Package.json Configuration Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/hello-someone/README.md This snippet shows the relevant parts of package.json for configuring the extension, including scripts for starting, watching, building, and packaging, as well as how it might reference external dependencies like paranext-core. ```json { "name": "paranext-core", "version": "1.0.0", "scripts": { "start": "node run-platform.js --extensionPath=./dist", "watch": "npm run build -- --watch", "build": "tsc", "package": "npm run build && node scripts/package.js" }, "devDependencies": { "@types/node": "^18.0.0", "typescript": "^5.0.0" } } ``` -------------------------------- ### Install Dependencies Command Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/platform-scripture/README.md Command to install local and published dependencies for the extension. ```bash npm install ``` -------------------------------- ### Start Platform.Bible Command Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/platform-scripture/README.md Command to run Platform.Bible with the extension included. ```bash npm start ``` -------------------------------- ### GitHub Actions Workflow Example Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/platform-get-resources/README.md An example of a GitHub Actions workflow file for automating processes in the repository. ```yaml name: CI # Controls when the action will run. # For example, running it only on push to the main branch: on: push: branches: [ main ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: # A workflow run is made up of one or more jobs that can be run independently. jobs: # The build job build: # The type of runner that the job will run on runs-on: ubuntu-latest # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository into the workspace so your job can access it - uses: actions/checkout@v3 # Runs a single command using the OS shell - name: Run a one-line script run: echo Hello, world! # Runs a set of commands using the OS shell - name: Run a multi-line script run: | echo Add other tools, just as 'make' echo Build the project npm install npm run build ``` -------------------------------- ### Package.json Configuration Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/hello-rock3/README.md This snippet shows the relevant parts of package.json for configuring the extension, including scripts for starting, watching, building, and packaging, as well as how it might reference external dependencies like paranext-core. ```json { "name": "paranext-core", "version": "1.0.0", "scripts": { "start": "node run-platform.js --extensionPath=./dist", "watch": "npm run build -- --watch", "build": "tsc", "package": "npm run build && node scripts/package.js" }, "devDependencies": { "@types/node": "^18.0.0", "typescript": "^5.0.0" } } ``` -------------------------------- ### Add Template Git Remote Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/quick-verse/README.md Adds the paranext-extension-template repository as a remote named 'template'. This is a one-time setup command. ```bash git remote add template https://github.com/paranext/paranext-extension-template ``` -------------------------------- ### Add Template Git Remote Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/platform-lexical-tools/README.md Adds the paranext-extension-template repository as a remote named 'template'. This is a one-time setup command. ```bash git remote add template https://github.com/paranext/paranext-extension-template ``` -------------------------------- ### Add Template Git Remote Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/hello-rock3/README.md Adds the paranext-extension-template repository as a remote named 'template'. This is a one-time setup command. ```bash git remote add template https://github.com/paranext/paranext-extension-template ``` -------------------------------- ### Add Template Git Remote Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/hello-someone/README.md Adds the paranext-extension-template repository as a remote named 'template'. This is a one-time setup command. ```bash git remote add template https://github.com/paranext/paranext-extension-template ``` -------------------------------- ### Package.json Configuration Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/platform-scripture-editor/README.md This snippet shows the relevant parts of package.json for configuring the extension, including scripts for starting, watching, building, and packaging, as well as how it might reference external dependencies like paranext-core. ```json { "name": "paranext-core", "version": "1.0.0", "scripts": { "start": "node run-platform.js --extensionPath=./dist", "watch": "npm run build -- --watch", "build": "tsc", "package": "npm run build && node scripts/package.js" }, "devDependencies": { "@types/node": "^18.0.0", "typescript": "^5.0.0" } } ``` -------------------------------- ### DOMContentLoaded Setup Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/hello-someone/src/hello-someone.web-view.html Ensures that the `setupWebView` function is called after the DOM is fully loaded. It checks the `document.readyState` and either calls `setupWebView` immediately or adds an event listener for the `DOMContentLoaded` event. ```javascript if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', setupWebView); } else { setupWebView(); } ``` -------------------------------- ### Add Template Git Remote Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/platform-scripture-editor/README.md Adds the paranext-extension-template repository as a remote named 'template'. This is a one-time setup command. ```bash git remote add template https://github.com/paranext/paranext-extension-template ``` -------------------------------- ### Run Storybook Locally Source: https://github.com/paranext/paranext-core/blob/main/README.md Starts the Storybook development server locally. This allows you to view and interact with your UI components in an isolated environment. ```bash npm run storybook ``` -------------------------------- ### Add Template Git Remote Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/platform-get-resources/README.md Adds the paranext-extension-template repository as a remote named 'template'. This is a one-time setup command. ```bash git remote add template https://github.com/paranext/paranext-extension-template ``` -------------------------------- ### Webpack Project Template for Platform.Bible Extensions Source: https://github.com/paranext/paranext-core/blob/main/extensions/src/hello-someone/README.md This section describes the Webpack project template used for building Platform.Bible extensions. It outlines the basic structure and mentions that certain files and folders (like *.web-view.* and public/assets) are not included in this minimal template but can be found in other example extensions. ```html