11const { join } = require ( 'node:path' ) ;
22
33const clsx = require ( 'clsx' ) ;
4+ const { createApiPageMD } = require ( 'docusaurus-plugin-openapi-docs/lib/markdown' ) ;
45
56const { config } = require ( './apify-docs-theme' ) ;
67const { collectSlugs } = require ( './tools/utils/collectSlugs' ) ;
@@ -195,15 +196,28 @@ module.exports = {
195196 v2 : {
196197 specPath : 'apify-api.yaml' ,
197198 outputDir : './sources/api' ,
199+ markdownGenerators : {
200+ createApiPageMD : ( pageData ) => {
201+ let md = createApiPageMD ( pageData ) ;
202+
203+ // HTML comments are wrongly escaped, we need to undo that
204+ if ( md . includes ( '<!--' ) ) {
205+ md = md . replace ( '<!--' , '<!--' ) ;
206+ md = md . replace ( '-->' , '-->' ) ;
207+ }
208+
209+ return md ;
210+ } ,
211+ } ,
198212 sidebarOptions : {
199- groupPathsBy : 'tag ' ,
213+ groupPathsBy : 'tagGroup ' ,
200214 categoryLinkSource : 'tag' ,
201215 sidebarCollapsed : false ,
202216 sidebarCollapsible : false ,
203217 sidebarGenerators : {
204218 createDocItem : ( item , context ) => {
205219 const legacyUrls = item . api ?. [ 'x-legacy-doc-urls' ] ?? [ ] ;
206- const altIds = legacyUrls . map ( ( url ) => {
220+ const altids = legacyUrls . map ( ( url ) => {
207221 const { hash } = new URL ( url ) ;
208222 return hash ;
209223 } ) ;
@@ -223,7 +237,7 @@ module.exports = {
223237 type : 'doc' ,
224238 id : context . basePath === '' ? `${ id } ` : `${ context . basePath } /${ id } ` ,
225239 label : sidebarLabel ?? title ?? id ,
226- customProps : { altIds } ,
240+ customProps : { altids } ,
227241 className,
228242 } ;
229243 } ,
0 commit comments