当前位置: 首页 > article >正文

0-1开发自己的obsidian plugin DAY 8

昨天的pull request遭受了ObsidianReviewBot的修改意见,比较有共性的应该是css,原话是:You should avoid assigning styles via JavaScript or in HTML and instead move all these styles into CSS so that they are more easily adaptable by themes and snippets.

意思是和控件布局格式相关的配置另外放在styles.css文件中。需要进行以下三步操作:

一是打开styles.css文件修改(修改:作用的pluggin - 作用的component - 作用的具体格式)

.your-plugin-name.your-modal-content-name {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 120%;
}

二是打开需要引用这些内容的.ts文件,在对应的控件上 加上这句:

contentEl.classList.add('your-plugin-name', 'your-modal-content-name');

(这里的classList直接用,不需要另外引用,copilot对此的解释是(我不理解,但供参考):

在标准的浏览器环境中,classList 是 DOM 元素的一个属性,不需要额外导入。你可以直接使用 element.classList.add()、element.classList.remove() 等方法来操作元素的类。

如果你在 TypeScript 中使用 classList,也不需要额外导入任何东西,因为 TypeScript 会自动识别 DOM 元素的这些属性和方法。

---------------------------

【暂未解决】根据obsidian的意见修改推送到自己的repo生成release以后,不确定这样的行为能否触发re-validation,对此,obsidian的提示是:

Do NOT open a new PR for re-validation.
Once you have pushed all of the required changes to your repo, the bot will update the labels on this PR within 6 hours.
If you think some of the required changes are incorrect, please comment with /skip and the reason why you think the results are incorrect.

不明确的点在于,我并没有直接修改我fork的obsidian-releases的内容,所有的改动都是我自己的插件repo,下面这个链接似乎提到了同样的问题,但是回答似乎是个同语反复:

How to trigger validation - Developers: Plugin & API - Obsidian Forum

先等6 hours再说吧))


http://www.kler.cn/news/339098.html

相关文章:

  • springboot 打包部署jsp页面两种方式war/jar
  • 中文llama3仿openai api实战
  • Python虚拟环境打包
  • 【题解】【模拟】—— [NOIP2013 普及组] 表达式求值
  • 【物流配送中心选址问题】基于改进粒子群算法
  • 回归预测 | Matlab基于SABO-SVR减法平均算法优化支持向量机的数据多输入单输出回归预测
  • 力扣之603.连续空余座位
  • Spring Boot:打造下一代医院管理系统
  • Go语言实现长连接并发框架 - 消息
  • 根据视频id查询播放量
  • ARTS Week 43
  • GO网络编程(一):基础知识
  • 【数据结构】【顺序表算法】 删除特定值
  • 搜索引擎相关的一段实习经历
  • AR智能眼镜之战:Meta vs Snap
  • 探索计算机科学的奥秘:从基础到进阶
  • Py2neo 教程
  • 实施威胁暴露管理、降低网络风险暴露的最佳实践
  • 面向对象技术——设计模式
  • 通过Dockerfile 安装rabbitMq