Comments (8)
这挺cool的!至少我愿意接受这个样式!
from hexo-theme-next.
Thanks for opening this issue, maintainers will get back to you as soon as possible!
from hexo-theme-next.
butterfly主题有该功能,next凭什么没有呢?❌
next特立独行,不盲从✅
主要是如果你指定了代码块的文件名,例如
```yml _config.yml
```
那么代码块上方会显示_config.yml
而不是代码块的语言。把它放在哪还需要进一步研究。
from hexo-theme-next.
butterfly主题有该功能,next凭什么没有呢?❌ next特立独行,不盲从✅
主要是如果你指定了代码块的文件名,例如
```yml _config.yml
那么代码块上方会显示`_config.yml`而不是代码块的语言。把它放在哪还需要进一步研究。
我平时在markdown格式下使用```
代码块时,习惯于只标明代码语言(并不会额外指定代码块文件名等),这可能和我的使用习惯有关,所以我并没有注意到这个问题:多个参数时,如何识别显示正确的参数。 但我想,简单粗暴就都显示或者干脆不显示;希望正确显示代码语言,那就建立一个代码语言库,显示的时候搜索一下有没有参数属于这个库,确认属于这个库就显示这个代码语言。
总而言之,这只是我的简单思考后的想法,可能并不实用,我只是希望next不要落后于butterfly🐶希望读者在阅读代码块时能第一时间确认代码语言
from hexo-theme-next.
不是这个意思,Hexo当然是知道代码语言的,不然都没法进行高亮。主要是这个位置已经另作他用了,如果要显示语言的话放在哪里是个问题。
from hexo-theme-next.
不是这个意思,Hexo当然是知道代码语言的,不然都没法进行高亮。主要是这个位置已经另作他用了,如果要显示语言的话放在哪里是个问题。
哦哦,之前我理解错误了。
我觉得这个左上角的位置显示代码块的文件名并不常用吧?至少在我使用的时候是这样,并不知道大家的使用习惯。
如果有空位能加上代码语言就够了,对我来说,放在哪里都一样,都足够我确认代码语言。放在哪里只是美观问题。如果一个空位也没有,那确实没办法了
from hexo-theme-next.
from hexo-theme-next.
同意题主的观点,个人认为这个位置要么什么都不显示,要么显示语言名称更合理。
如果作者真的有意强调一串代码所属的文件,往往是在代码块开头通过注释列出。
可以考虑再增加一个显示语言名称的选项:
- 默认为 false
- 或者默认为 true,但是如果也设置了文件名,则优先显示文件名,这样依然向下兼容
这个功能如果要做的话该怎么实现?通过一个 filter 来操作生成的 HTML 吗?
from hexo-theme-next.
Related Issues (20)
- The subtitle achieves the typing effect? HOT 6
- ' 被渲染成了 ’ HOT 2
- Mermaid codeblock folding and copy button style issue HOT 14
- 求助:如何修改文章计数的样式 HOT 5
- 侧边栏锚点位置异常 HOT 2
- Inject annotations HOT 4
- How to modify whether the Gemini menu bar can follow the style of miss instead of being placed in the sidebar? HOT 3
- 8.20.0菜单栏圆点位置异常 HOT 2
- Dose next support multi-lingual ? HOT 3
- muse.min.js 404 HOT 1
- Is it possible to have multipe `updates`? HOT 1
- Request support for Typst HOT 3
- Add Giscus as a comment system. HOT 4
- Why I have additional `$$` characters before and after rendered LaTex equations? HOT 1
- add new tab, lost logo HOT 2
- 【建议】能否支持首页文章缩略图,以及文章内顶端大图 HOT 3
- Add hexo-renderer-stylus as a peer dependency HOT 2
- feat: support disabling animation on mobile devices
- 文章中加入了<!-- more -->,但在主页中还是显示全文 HOT 3
- Cannot find module 'css' HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hexo-theme-next.