function updateSidebars(docFolder) {
		const contentDir = path.resolve(docsFolder, 'content');
		const conceptsDir = path.resolve(contentDir, 'concepts');

		fs.copyFileSync(path.resolve(docFolder, '_sidebar.md'), path.resolve(contentDir, '_sidebar.md'));
		fs.copyFileSync(path.resolve(docFolder, '_sidebar.md'), path.resolve(conceptsDir, '_sidebar.md'));

		const apiSidebarPath = path.resolve(contentDir, 'api', '_sidebar.md');
		const sdkSidebarPath = path.resolve(contentDir, 'sdk', '_sidebar.md');

		const rootSidebar = fs.readFileSync(path.resolve(docFolder, '_sidebar.md')).toString();

		if (fs.existsSync(apiSidebarPath)) {
			const apiSidebarString = fs.readFileSync(apiSidebarPath).toString();
			const apiSidebarContentMatch = apiSidebarString.match(/(<!-- api_open -->(\s|.)*<!-- api_close -->)/gm);
			if (apiSidebarContentMatch !== null) {
				const apiSidebarContent = apiSidebarContentMatch[0];
				const updatedSidebar = rootSidebar.replace(/(<!-- api_open -->(\s|.)*<!-- api_close -->)/gm, apiSidebarContent);

				fs.writeFileSync(apiSidebarPath, updatedSidebar);
			}
		}

		if (fs.existsSync(sdkSidebarPath)) {
			const sdkSidebarString = fs.readFileSync(sdkSidebarPath).toString();
			const sdkSidebarContentMatch = sdkSidebarString.match(/(<!-- sdk_open -->(\s|.)*<!-- sdk_close -->)/gm);

			if (sdkSidebarContentMatch !== null) {
				const sdkSidebarContent = sdkSidebarContentMatch[0];
				const updatedSidebar = rootSidebar.replace(/(<!-- sdk_open -->(\s|.)*<!-- sdk_close -->)/gm, sdkSidebarContent);

				fs.writeFileSync(sdkSidebarPath, updatedSidebar);
			}
		}
	}
/**
	 * Copy sidebar to other folders.
	 *
	 * @param {string} docFolder - a path to the docs folder
	 */
Copy sidebar to other folders.
@param {string} docFolder - a path to the docs folder
Copy sidebar to other folders . @param { string } docFolder - a path to the docs folder
function updateSidebars(docFolder) {
		const contentDir = path.resolve(docsFolder, 'content');
		const conceptsDir = path.resolve(contentDir, 'concepts');
		fs.copyFileSync(path.resolve(docFolder, '_sidebar.md'), path.resolve(contentDir, '_sidebar.md'));
		fs.copyFileSync(path.resolve(docFolder, '_sidebar.md'), path.resolve(conceptsDir, '_sidebar.md'));
		const apiSidebarPath = path.resolve(contentDir, 'api', '_sidebar.md');
		const sdkSidebarPath = path.resolve(contentDir, 'sdk', '_sidebar.md');
		const rootSidebar = fs.readFileSync(path.resolve(docFolder, '_sidebar.md')).toString();
		if (fs.existsSync(apiSidebarPath)) {
			const apiSidebarString = fs.readFileSync(apiSidebarPath).toString();
			const apiSidebarContentMatch = apiSidebarString.match(/(<!-- api_open -->(\s|.)*<!-- api_close -->)/gm);
			if (apiSidebarContentMatch !== null) {
				const apiSidebarContent = apiSidebarContentMatch[0];
				const updatedSidebar = rootSidebar.replace(/(<!-- api_open -->(\s|.)*<!-- api_close -->)/gm, apiSidebarContent);
				fs.writeFileSync(apiSidebarPath, updatedSidebar);
			}
		}
		if (fs.existsSync(sdkSidebarPath)) {
			const sdkSidebarString = fs.readFileSync(sdkSidebarPath).toString();
			const sdkSidebarContentMatch = sdkSidebarString.match(/(<!-- sdk_open -->(\s|.)*<!-- sdk_close -->)/gm);
			if (sdkSidebarContentMatch !== null) {
				const sdkSidebarContent = sdkSidebarContentMatch[0];
				const updatedSidebar = rootSidebar.replace(/(<!-- sdk_open -->(\s|.)*<!-- sdk_close -->)/gm, sdkSidebarContent);
				fs.writeFileSync(sdkSidebarPath, updatedSidebar);
			}
		}
	}
function updateSidebars ( docFolder ) { const contentDir = path . resolve ( docsFolder , 'content' ) ; const conceptsDir = path . resolve ( contentDir , 'concepts' ) ; fs . copyFileSync ( path . resolve ( docFolder , '_sidebar.md' ) , path . resolve ( contentDir , '_sidebar.md' ) ) ; fs . copyFileSync ( path . resolve ( docFolder , '_sidebar.md' ) , path . resolve ( conceptsDir , '_sidebar.md' ) ) ; const apiSidebarPath = path . resolve ( contentDir , 'api' , '_sidebar.md' ) ; const sdkSidebarPath = path . resolve ( contentDir , 'sdk' , '_sidebar.md' ) ; const rootSidebar = fs . readFileSync ( path . resolve ( docFolder , '_sidebar.md' ) ) . toString ( ) ; if ( fs . existsSync ( apiSidebarPath ) ) { const apiSidebarString = fs . readFileSync ( apiSidebarPath ) . toString ( ) ; const apiSidebarContentMatch = apiSidebarString . match ( / (<!-- api_open -->(\s|.)*<!-- api_close -->) / gm ) ; if ( apiSidebarContentMatch !== null ) { const apiSidebarContent = apiSidebarContentMatch [ 0 ] ; const updatedSidebar = rootSidebar . replace ( / (<!-- api_open -->(\s|.)*<!-- api_close -->) / gm , apiSidebarContent ) ; fs . writeFileSync ( apiSidebarPath , updatedSidebar ) ; } } if ( fs . existsSync ( sdkSidebarPath ) ) { const sdkSidebarString = fs . readFileSync ( sdkSidebarPath ) . toString ( ) ; const sdkSidebarContentMatch = sdkSidebarString . match ( / (<!-- sdk_open -->(\s|.)*<!-- sdk_close -->) / gm ) ; if ( sdkSidebarContentMatch !== null ) { const sdkSidebarContent = sdkSidebarContentMatch [ 0 ] ; const updatedSidebar = rootSidebar . replace ( / (<!-- sdk_open -->(\s|.)*<!-- sdk_close -->) / gm , sdkSidebarContent ) ; fs . writeFileSync ( sdkSidebarPath , updatedSidebar ) ; } } }
Copy sidebar to other folders.
Copy sidebar to other folders .