如何定义多行@Description元数据



以下一项工作:

// @description  ...text1...
// @description  ...text2...

仅显示text2

// @description  ...text1...
                 ...text2...

仅显示text1

// @description  ...text1...
//               ...text2...

仅显示text1

// @description  ...text1...<br />...text2...
显示

字面&lt; br/>。

// @description  ...text1...n...text2...

显示字面 n。

您不这样做。总体上的想法是,描述应该是简洁的"微态",如果不使扩展名UI更加麻烦,大小就不会太大。

GreaseMonKey Doc说:

只是脚本所做的工作的简短摘要,在安装脚本时向用户呈现,并在"管理对话框"中。

Tampermonkey Doc说:

a 简短重要描述。

暴力monkey doc说:

a 简介摘要描述脚本。

现在,您可以提交功能请求或提取请求以尝试更改该请求,但我认为使用可用性/tldr/"执行摘要"方法更好。

so:

  1. 使用类似SEO的有用描述性标题
  2. 如果描述似乎需要超过128个字符(a(您正在做错事,/或(b(链接到适当的Wiki/Faq/homepage。
  3. 使用@homepage@supportURL密钥。 TampermonKey和FilesMonkey也将使用这些链接图标在各个地方。(无论如何,您都不应该使用GreaseMonKey 4 ,如其他地方所讨论的。(

所以这里有一些示例:

  1. 无需描述:

    // @name     YouTube, hide all comments.
    
  2. 简短描述帮助:

    // @name        YouTube, redirect to show only Yanni videos.
    // @description Chooses the best Yanni-related replacement for any YouTube video.
    
  3. 真的想要很多描述:

    // @name        Stack Overflow, Insta-answer with guaranteed vote magnets.
    // @description See the terms, conditions and FAQS at stackingtheodds.mil.
    
  4. 半度性描述,但支持URL和图标的全部杠杆作用:

    // @name        Stack Exchange, replace badge icons with duckies
    // @description Does what it says on the tin.
    // @homepage    https://stackapps.com/q/8116/7653
    // @supportURL  https://github.com/BrockA/SE-misc/blob/master/Stack%20Exchange,%20replace%20badge%20icons%20with%20duckies.user.js
    

最新更新