-
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Markdown + Mermaid template #210
Markdown + Mermaid template #210
Conversation
We require all PRs to follow Conventional Commits specification.
|
5ad5d8e
to
a530584
Compare
Hi @nikhilkalburgi, I am considering rendering using the ETA template and, instead of directly generating the markdown (MD), display the content in HTML format first. This way, we will be able to establish a clear relationship between the HTML and the corresponding MD. Also, we could include a button at the end to allow users to export the content in MD or even PDF format. What do you think ? |
Hi @josephinoo,
|
a530584
to
0b9ce5a
Compare
Quality Gate passedIssues Measures |
Hi @ivangsa @josephinoo, Below you will find the prototype that I have designed on Figma 28.02.2024_13.51.56_REC-ezgif.com-mute-video.mp4I would appreciate your input on this to improve it further. I also tried to set the template engine ETA but found that it is not very compatible with VS Code Env. So, I have used EJS instead and have developed the project structure with it. Soon I will raise a PR. |
I think the diagram in second 0:09 doesn`t make too much sense but it would require something similar for the payload of each message I would create a separate one for each message, because maybe they are shared objects between messages and it's nice to to have everything mixed up.. I think EJS is good, it has more traction behind and ETA features are not that definitive for this usage.. |
hi @nikhilkalburgi @josephinoo because the extension is webpacked you can not access EJS templates by path, you need to pack them as resources with webpack, here an example as how I solved this in another extension: then you can load the contents like this: const testTemplateFile = require('./templates/test.feature.ejs');
...
render(testTemplateFile, targetFile, model);
...
// this renders the results to a file, but you can use as an example to get the contents
function render(template, target: vscode.Uri, model): Promise<void> {
return new Promise((resolve, reject) => {
const options = {};
try {
ejs.renderFile(path.join(__dirname, template), model, options, async function (err, output) {
await vscode.workspace.fs.writeFile(target, Buffer.from((err && err.message) || output));
resolve();
});
} catch (error) {
console.error(error.message);
reject(error);
}
});
} |
Hi @ivangsa, I had implemented it like below: In webpack.confi.js:
This will copy the .ejs files in ./components folder into ./dist/components then:
But, now I am following your suggestion. Initially, I will build the markdown for the objects and later integrate the mermaid diagrams |
@nikhilkalburgi if it works in all cases, development and packaged, don't need to change it.. |
Okay! |
Description
Related issue(s)