2021-06-15 22:38:40 +02:00
/ * *
* Copyright ( c ) Facebook , Inc . and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* /
const path = require ( 'path' ) ;
2022-07-27 18:39:04 +02:00
2023-06-20 16:26:05 +02:00
// read this text file
const fs = require ( 'fs' ) ;
const versions = fs . readFileSync ( '../../version.txt' , 'utf8' ) . split ( '\n' ) ;
2021-06-15 22:38:40 +02:00
2024-11-06 13:15:27 +01:00
const ArchivedVersionsDropdownItems = [
{
2024-11-12 22:18:33 +01:00
version : '3.8.5' ,
href : 'https://v3p8.docs.ohif.org' ,
isExternal : true ,
} ,
{
version : '2.0' ,
2024-11-06 13:15:27 +01:00
href : 'https://v2.docs.ohif.org' ,
isExternal : true ,
} ,
{
2024-11-12 22:18:33 +01:00
version : '1.0' ,
2024-11-06 13:15:27 +01:00
href : 'https://v1.docs.ohif.org' ,
isExternal : true ,
} ,
] ;
2021-06-16 14:30:10 +02:00
const baseUrl = process . env . BASE _URL || '/' ;
2021-06-15 22:38:40 +02:00
2021-06-15 17:50:38 +02:00
/** @type {import('@docusaurus/types').DocusaurusConfig} */
2022-07-27 18:39:04 +02:00
module . exports = {
2024-11-06 13:15:27 +01:00
future : {
experimental _faster : true ,
} ,
2021-06-16 05:32:37 +02:00
title : 'OHIF' ,
2021-08-24 14:13:54 +02:00
tagline : 'Open-source web-based medical imaging platform' ,
2021-07-15 00:04:36 +02:00
organizationName : 'Open Health Imaging Foundation' ,
2021-06-16 05:32:37 +02:00
projectName : 'OHIF' ,
2021-06-15 22:38:40 +02:00
baseUrl ,
baseUrlIssueBanner : true ,
2023-06-06 19:34:26 +02:00
url : 'https://docs.ohif.org' ,
2021-06-15 22:38:40 +02:00
i18n : {
defaultLocale : 'en' ,
2024-10-15 15:53:26 +02:00
locales : [ 'en' ] ,
2021-06-15 22:38:40 +02:00
} ,
onBrokenLinks : 'warn' ,
2021-06-15 17:50:38 +02:00
onBrokenMarkdownLinks : 'warn' ,
2021-06-22 23:12:00 +02:00
favicon : 'img/favicon.ico' ,
2021-06-15 22:38:40 +02:00
themes : [ '@docusaurus/theme-live-codeblock' ] ,
plugins : [
2023-09-26 05:13:43 +02:00
( ) => ( {
name : 'resolve-react' ,
configureWebpack ( ) {
return {
resolve : {
alias : {
// assuming root node_modules is up from "./packages/<your-docusaurus>
react : path . resolve ( '../../node_modules/react' ) ,
} ,
} ,
} ;
} ,
} ) ,
2024-10-15 15:53:26 +02:00
// path.resolve(__dirname, './pluginOHIFWebpackConfig.js'),
// /path.resolve(__dirname, './postcss.js'),
2024-01-09 16:15:56 +01:00
'docusaurus-plugin-image-zoom' , // 3rd party plugin for image click to pop
2021-06-15 22:38:40 +02:00
[
'@docusaurus/plugin-ideal-image' ,
{
quality : 70 ,
max : 1030 , // max resized image's size.
min : 640 , // min resized image's size. if original is lower, use that size.
steps : 2 , // the max number of images generated between min and max (inclusive)
} ,
] ,
] ,
presets : [
[
2022-07-27 18:39:04 +02:00
'classic' ,
2024-10-15 15:53:26 +02:00
{
2021-06-15 22:38:40 +02:00
debug : true , // force debug plugin usage
docs : {
routeBasePath : '/' ,
path : 'docs' ,
sidebarPath : require . resolve ( './sidebars.js' ) ,
editUrl : ( { locale , docPath } ) => {
2021-08-24 14:13:54 +02:00
/ * i f ( l o c a l e ! = = ' e n ' ) {
2021-06-15 22:38:40 +02:00
return ` https://crowdin.com/project/docusaurus-v2/ ${ locale } ` ;
2021-08-24 14:13:54 +02:00
} * /
2021-06-15 22:38:40 +02:00
// We want users to submit doc updates to the upstream/next version!
// Otherwise we risk losing the update on the next release.
2023-06-06 19:34:26 +02:00
return ` https://github.com/OHIF/Viewers/edit/master/platform/docs/docs/ ${ docPath } ` ;
2021-06-15 22:38:40 +02:00
} ,
showLastUpdateAuthor : true ,
showLastUpdateTime : true ,
// remarkPlugins: [
// [require('@docusaurus/remark-plugin-npm2yarn'), { sync: true }],
// ],
2021-06-16 01:11:09 +02:00
// disableVersioning: isVersioningDisabled,
2021-08-24 14:13:54 +02:00
lastVersion : 'current' ,
2021-06-16 01:11:09 +02:00
// onlyIncludeVersions:
// !isVersioningDisabled && (isDev || isDeployPreview)
// ? ['current', ...versions.slice(0, 2)]
// : undefined,
2021-08-24 14:13:54 +02:00
versions : {
current : {
2023-06-20 16:26:05 +02:00
label : ` ${ versions } (Latest) ` ,
2021-08-24 14:13:54 +02:00
} ,
} ,
2021-06-15 22:38:40 +02:00
} ,
theme : {
customCss : [ require . resolve ( './src/css/custom.css' ) ] ,
} ,
2023-06-13 04:05:01 +02:00
gtag : {
trackingID : 'G-DDBJFE34EG' ,
anonymizeIP : true ,
} ,
2024-10-15 15:53:26 +02:00
} ,
2021-06-15 22:38:40 +02:00
] ,
] ,
2022-07-27 18:39:04 +02:00
themeConfig :
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
( {
liveCodeBlock : {
playgroundPosition : 'bottom' ,
} ,
docs : {
sidebar : {
hideable : true ,
autoCollapseCategories : true ,
} ,
} ,
colorMode : {
defaultMode : 'dark' ,
disableSwitch : false ,
// respectPrefersColorScheme: true,
} ,
2023-07-27 18:39:12 +02:00
announcementBar : {
2024-11-12 22:18:33 +01:00
id : 'cornerstone20_ohif_anniversary' ,
2023-07-27 18:39:12 +02:00
content :
2024-11-12 22:18:33 +01:00
'🎉 Celebrating OHIF’ s 10-Year Anniversary with Cornerstone 2.0! Explore enhanced segmentation, new video & microscopy viewports, UI/UX upgrades, and blazing fast prefetching. Dive into the release notes <a target="_blank" rel="noopener noreferrer" href="https://ohif.org/release-notes/3p9/">here</a>! 🚀' ,
2023-07-27 18:39:12 +02:00
} ,
2024-11-12 22:18:33 +01:00
2022-07-27 18:39:04 +02:00
prism : {
2024-10-15 15:53:26 +02:00
theme : require ( 'prism-react-renderer' ) . themes . github ,
darkTheme : require ( 'prism-react-renderer' ) . themes . dracula ,
2021-06-15 17:50:38 +02:00
} ,
2022-07-27 18:39:04 +02:00
algolia : {
appId : 'EFLT6YIHHZ' ,
apiKey : 'c220dd24fe4f86248eea3b1238a1fb60' ,
indexName : 'ohif' ,
} ,
navbar : {
hideOnScroll : false ,
logo : {
alt : 'OHIF Logo' ,
src : 'img/ohif-logo-light.svg' ,
srcDark : 'img/ohif-logo.svg' ,
2021-06-15 17:50:38 +02:00
} ,
2022-07-27 18:39:04 +02:00
items : [
{
position : 'left' ,
to : '/' ,
activeBaseRegex : '^(/next/|/)$' ,
docId : 'Introduction' ,
label : 'Docs' ,
} ,
{
2024-11-12 18:33:09 +01:00
to : '/components' ,
label : 'Components' ,
position : 'left' ,
} ,
{
href : 'https://ohif.org/showcase' ,
label : 'Showcase' ,
2023-06-06 19:34:26 +02:00
target : '_blank' ,
2022-07-27 18:39:04 +02:00
position : 'left' ,
} ,
2023-06-20 16:26:05 +02:00
{
2024-11-12 18:33:09 +01:00
href : 'https://ohif.org/collaborate' ,
label : 'Collaborate' ,
target : '_blank' ,
2023-06-20 16:26:05 +02:00
position : 'left' ,
} ,
2022-07-27 18:39:04 +02:00
{
to : '/help' ,
//activeBaseRegex: '(^/help$)|(/help)',
label : 'Help' ,
2024-11-12 18:33:09 +01:00
position : 'left' ,
2022-07-27 18:39:04 +02:00
} ,
2024-11-14 18:37:04 +01:00
{
to : '/migration-guide/3p8-to-3p9/' ,
//activeBaseRegex: '(^/help$)|(/help)',
label : '3.9 Migration Guides' ,
position : 'left' ,
} ,
2022-07-27 18:39:04 +02:00
{
type : 'docsVersionDropdown' ,
position : 'right' ,
dropdownActiveClassDisabled : true ,
dropdownItemsAfter : [
{
type : 'html' ,
value : '<hr class="dropdown-separator">' ,
} ,
{
2024-11-06 13:15:27 +01:00
type : 'html' ,
className : 'dropdown-archived-versions' ,
value : '<b>Archived versions</b>' ,
2022-07-27 18:39:04 +02:00
} ,
2024-11-06 13:15:27 +01:00
... ArchivedVersionsDropdownItems . map ( item => ( {
label : ` ${ item . version } ` ,
href : item . href ,
target : item . isExternal ? '_blank' : undefined ,
rel : item . isExternal ? 'noopener noreferrer' : undefined ,
} ) ) ,
2022-07-27 18:39:04 +02:00
] ,
} ,
{
type : 'localeDropdown' ,
position : 'right' ,
dropdownItemsAfter : [
{
to : '/platform/internationalization' ,
label : 'Help Us Translate' ,
} ,
] ,
} ,
{
to : 'https://github.com/OHIF/Viewers' ,
position : 'right' ,
className : 'header-github-link' ,
'aria-label' : 'GitHub Repository' ,
} ,
] ,
} ,
footer : {
style : 'dark' ,
links : [
{
title : ' ' ,
items : [
{
// This doesn't show up on dev for some reason, but displays in build
html : `
2021-08-30 15:36:05 +02:00
< a href = "https://www.massgeneral.org/" target = "_blank" rel = "noreferrer noopener" >
2021-08-31 16:30:53 +02:00
< img src = "/img/mgh-logo.png" id = "mgh-logo" alt = "MGH" / >
2021-06-23 03:02:14 +02:00
< / a >
` ,
2022-07-27 18:39:04 +02:00
} ,
] ,
} ,
{
title : 'Learn' ,
items : [
{
label : 'Introduction' ,
to : '/' ,
} ,
{
2023-06-20 16:26:05 +02:00
label : 'Getting Started' ,
2022-07-27 18:39:04 +02:00
to : 'development/getting-started' ,
} ,
2023-06-20 16:26:05 +02:00
{
label : 'FAQ' ,
to : '/faq' ,
} ,
{
label : 'Resources' ,
to : '/resources' ,
} ,
2022-07-27 18:39:04 +02:00
] ,
} ,
{
title : 'Community' ,
items : [
{
label : 'Discussion board' ,
2023-06-20 16:26:05 +02:00
href : 'https://community.ohif.org/' ,
2022-07-27 18:39:04 +02:00
} ,
{
label : 'Help' ,
to : '/help' ,
} ,
] ,
} ,
{
title : 'More' ,
items : [
{
label : 'Donate' ,
2023-06-20 16:26:05 +02:00
href : 'https://giving.massgeneral.org/ohif' ,
2022-07-27 18:39:04 +02:00
} ,
{
label : 'GitHub' ,
2023-06-20 16:26:05 +02:00
href : 'https://github.com/OHIF/Viewers' ,
2022-07-27 18:39:04 +02:00
} ,
{
label : 'Twitter' ,
2023-06-20 16:26:05 +02:00
href : 'https://twitter.com/OHIFviewer' ,
2022-07-27 18:39:04 +02:00
} ,
] ,
} ,
] ,
logo : {
alt : 'OHIF ' ,
src : 'img/netlify-color-accent.svg' ,
2023-06-06 19:34:26 +02:00
href : 'https://viewer.ohif.org/' ,
2021-06-22 01:35:41 +02:00
} ,
2022-07-27 18:39:04 +02:00
copyright : ` OHIF is open source software released under the MIT license. ` ,
2021-08-30 15:36:05 +02:00
} ,
2022-07-27 18:39:04 +02:00
} ) ,
} ;