- 
  Notifications
 
You must be signed in to change notification settings  - Fork 152
 
-
Suppose we have a src folder that contains multiple subfolders ( random architecture) and all the files have a .ts extension
Is it possible to generate all the .md files for those .ts only by specifying the path to a specific folder ?
For example:
src
│
└───apiWrappers
│ │
│ └───company
│ └─── companyAPIWrapper.ts
│ 
└───models
 │ customfield
 │ 
 └───properties
 | └───customFieldproperties.ts
 └───model.ts
when we run the command ( if it exists)
We will have the following:
src
│
└───apiWrappers
│ │
│ └───company
│ └───companyAPIWrapper.md
│ 
└───models
 │ customfield
 │ 
 └───properties
 | └───customFieldproperties.md
 └───model.md
And all the links & references will be of course made along.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 5 comments
-
Hi, you can use the jsdoc2md API to create your preferred output file and folder structure.. see here for an example custom script..
Beta Was this translation helpful? Give feedback.
All reactions
-
That was not really my question.
Thanks anyway
Beta Was this translation helpful? Give feedback.
All reactions
-
Is it possible to generate all the .md files for those .ts only by specifying the path to a specific folder ?
Yes, it's possible - you can write a script that takes a folder path as input and writes output files to your required locations.. let me know if you have any other questions.
Beta Was this translation helpful? Give feedback.
All reactions
-
Is it possible to generate all the .md files for those .ts only by specifying the path to a specific folder ?
Yes, it's possible - you can write a script that takes a folder path as input and writes output files to your required locations.. let me know if you have any other questions.
Is there a documentation where it says how to make it generate those files according to the same paths of the input folder ?
So if we have a src folder, it'll generate the .md files in the docs folder while keeping the same folder structure.
Because I can't seem to find the part where it does that?
Beta Was this translation helpful? Give feedback.
All reactions
-
how to make it generate those files according to the same paths of the input folder
that's a specialised output file structure opinion that is not built into jsdoc2md (or jsdoc).. Currently, jsdoc2md takes file names as input and returns a string (an output string generated by customisable handlebars templates)..
You would need to write a custom script and control the output file structure yourself, something like this maybe?
/* assuming you have created the `dirs` directory structure already */ for (const dir of dirs) { for (const file of dir.files) { const output = await jsdoc2md.render({ files: file.name }) /* define your output file structure logic here, e.g. */ await fs.writeFile(`docs/${dir.name}/${file.name}.md`, output) } }
Beta Was this translation helpful? Give feedback.