mayurankv / Obsidian-Code-Styler

A plugin for Obsidian.md for styling codeblocks and inline code
Other
229 stars 6 forks source link

Feature Request: Compatibility with dataview rendered codeblocks #10

Open mayurankv opened 1 year ago

mayurankv commented 1 year ago

Summary

Be able to style codeblocks generated by dataview and dataviewjs from the dataview plugin.

Basic example

```dataviewjs
dv.span(`\`\`\`python <parameters here>
codeblock content
\`\`\``)

should have the parameters properly applied and be styled.

### Motivation
<!-- Why are we doing this? -->
<!-- What use cases does it support? -->
<!-- What is the expected outcome? -->
For better compatibility.

## Existing Requests?
<!-- Is there any open feature requests or pull requests for this feature? -->
No existing requests.
mayurankv commented 1 year ago

How to deal with codeblocks generated using content which is not in Markdown, i.e. using customJS plugin? Maybe have to settle for adding parameters to dataviewjs block itself and style all resulting codeblocks using those parameters?

Moyf commented 4 months ago

Still want this feature.

For now a plugin called Editor Syntax Highlight could add syntax for dataview js, but i think this plugin is overlapped with Code Styler, If possible, I hope to only use one.

mayurankv commented 4 months ago

Hiya! Sorry just to clarify what are you requesting for dataview codeblocks? Just dataview syntax highlighting? This feature request was made so that codeblocks created dynamically via dataview could be decorated as normal static codeblocks, but I'm of course very happy to consider other improvements. Would be great to have a clearer idea of what you're asking for :)

Moyf commented 4 months ago

Hiya! Sorry just to clarify what are you requesting for dataview codeblocks? Just dataview syntax highlighting? This feature request was made so that codeblocks created dynamically via dataview could be decorated as normal static codeblocks, but I'm of course very happy to consider other improvements. Would be great to have a clearer idea of what you're asking for :)嗨!抱歉,只是想澄清一下您对数据视图代码块的要求是什么?只是数据视图语法突出显示?提出此功能请求是为了使通过 dataview 动态创建的代码块可以装饰为普通的静态代码块,但我当然很高兴考虑其他改进。如果能更清楚地了解您的要求,那就太好了:)

Oh, I think maybe just rendering the dataviewjs same as js is enough?

For now, the dataviewjs code block looks like this: image

And I hope it could be rendered like this: image