VVDocumenter-Xcode github README.md 中英文翻译

news2024/7/4 6:05:09

最近在学习 Xcode 的使用,查到有一款用于生成注释文档的插件:VVDocumenter-Xcode
进入其 github 页面之后看 README,看到两句话:

在这里插入图片描述1. Goodbye World: 再不更新了?
2. 从 Xcode 8 之后Apple官方提供了插件做相同的工作,是基于本项目的。
在这里插入图片描述
觉得这个项目很有意思,在此翻译一下其中的 README。

VVDocumenter-Xcode


Goodbye World

永别了

In Xcode 8, Apple integrated a comment documentation generator plugin, which is built on top of VVDocumenter. Now this project is proud to be a part of Apple. It means you could just use the shortcut (⌥ Option + ⌘ Command + /) to add a documentation comment to your code if you are using Xcode 8 or above!
从 Xcode 8 开始,Apple公司在本项目(VVDocumenter)的基础上,自己集成了一款用于生成注释文档的插件。
如今本项目对于成为 Apple 生态的一部分而深感荣幸。
这意味着:如果你在使用 Xcode 8 或其更高版本,直接使用快捷键(option+command+/)就可以在代码中生成文档注释。

VVDocumenter is one of my hobby projects from 2013, back to the age of Xcode 4. It serves well for these years and I am so glad that it helps a lot of developers to improve their productivity. Since there is no need to install this plugin anymore, the development of VVDocumenter will not continue. Yes, it’s time to say goodbye, with a happy ending.
回溯至 Xcode 4的那个年代,本项目始于2013年、是我的爱好项目之一。
这些年里它提供了很好的服务,我也很高兴它帮助了很多的开发者提高(了他们的)生产力。
因为以后(开发者/我们)不再需要手动安装这个插件了,所以本项目的开发将会终止。
是的,到了该说再见的时候了,已经有了一个圆满的结局。

Thank you all for your selfless support to this project. Let’s build more great things and make the world better in future!
非常感谢各位自发为本项目提供的支持。将来我们会一起制造更多更好的东西,让这个世界变得更美好!

What is this?

这是什么

Writing documentation is so important for developing, but it is really painful with Xcode. Think about how much time you are wasting in pressing ‘*’ or ‘/’, and typing the parameters again and again. Now, you can find the method (or any code) you want to document to, and type in ///, the document will be generated for you and all params and return will be extracted into a Javadoc style, which is compatible with appledoc, Doxygen and HeaderDoc. You can just fill the inline placeholder tokens to finish your document.
写文档在开发过程中很重要,可是在 Xcode 中这件事变得令人头疼。
回想一下你在敲击*/、以及一次又一次拼写参数名的过程中浪费过多少的时间。
就那现在来说,你可以随意找一个需要你为其书写文档的方法(或一段代码),然后输入///,(紧接着)文档就会为你生成好,并且(该方法的)所有形参和返回值都会被提取、按照 Javadoc 的方式表现出来(Javadoc 是和 appledoc、Doxygen、HeaderDoc等标准兼容的)。
接下来你只需要手动填充(方法,参数,返回值等的)具体信息来替换占位符,文档就完成了。

Here is an image which can show what it exactly does.
这里有一张gif可以展示你操作的效果:

Screenshot

By the way, it also supports Swift now. Cheers!
哦对了,现在(该功能)也支持 Swift 语法了。干杯!

Screenshot

How to install and use?

如何安装以及使用?

The best way of installing is by Alcatraz. Install Alcatraz followed by the instruction, restart your Xcode and press ⇧⌘9. You can find VVDocumenter-Xcode in the list and click the icon on left to install.
最好的安装方式是通过 Alcatraz 站点。按照该站点中的指导去安装 Alcatraz ,重启你的 Xcode 后按下 ⇧⌘9
你可以在弹出界面中的列表中找到 VVDocumenter-Xcode 这一项,点击左侧对应的图标就会开始安装了。

If you do not like the Alcatraz way, you can also clone the repo. Then build the VVDocumenter-Xcode target in the Xcode project and the plug-in will automatically be installed in ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins. Relaunch Xcode and type in /// above any code you want to write a document to.
如果你不喜欢 Alcatraz 的安装方式,你也可以直接克隆本项目的代码库到本地。
然后用 Xcode 打开该项目,编译 VVDocumenter-Xcode target,这样该插件就会自动安装到 ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins
重新运行 Xcode 后,在任意你想为之写文档的代码的上一行输入 /// 就可以开始工作了。

If you want to use other text beside of /// to trigger the document insertion, you can find a setting panel by clicking VVDocument in the Window menu of Xcode. You can also find some other useful options there, including setting using spaces instead of tab in the panel or changing the format of generated documentation.
如果你不想用 /// 来触发文档插入,而是想用别的文本段,也有办法。
你可以点击 Xcode 窗口菜单栏中的 VVDocument 菜单项,在弹出的设置面板中有很多有用的选项,包括:“自动用多个空格替换跳格键”,“改变要生成文档的格式”。

Xcode version?

Xcode 版本?

This plug-in is supported in Xcode 5, 6 and 7. From Xcode 5, Apple added a UUID-verification to all plugins to ensure the stability when Xcode gets updated. The value of DVTPlugInCompatibilityUUIDs in project plist should contains current UUID of Xcode version, or the plugin does not work. And from Xcode 6.3, you will be prompt to “Load third party bundle” if you are using a plugin. You should always select “Load bundles” to enable this plugin.
这个插件可以在 Xcode 5, 6, 7 上使用。从 Xcode 5 开始,苹果公司新增了一种机制:当 Xcode 更新时会向每个插件都添加一个用于校验的 UUID 以确保稳定性。项目的 plist 配置文件中的 DVTPlugInCompatibilityUUIDs 变量的值应该包含:当前的 UUID 值,和 Xcode 版本,否则插件不能正常运行
从 Xcode 6.3 开始,如果你使用一个插件,会有弹框提示你“是否要加载第三方的程序包”,你可以一直选择“加载该程序包”来启用该插件。

All plugins will be disabled once you update your Xcode, since the supported UUIDs in the plugins do not contain the one. You should try to clean your plugins folder (~/Library/Application Support/Developer/Shared/Xcode/Plug-ins by default) and clone/build the latest version from master branch. If you happened to skip the bundle loading, you can use this to reset the prompt:
当你更新 Xcode 之后,之前在里面装过的所有插件都会被禁用,因为在本版本 Xcode 可用插件对应的 UUID 的列表中不包含旧版本插件的UUID。
你要做的是去手动清空你的 Xcode 插件目录: (默认是 ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins),
然后克隆代码库,编译最新的 master 分支, 如果在之后的操作中你没有碰到关于程序包载入的弹框提示,可以用下面的命令去重设该弹框提示:

defaults delete com.apple.dt.Xcode DVTPlugInManagerNonApplePlugIns-Xcode-{your_xcode_version}

Please do not open an issue if this plugin not work in your newly updated Xcode. Pull request for new DVTPlugInCompatibilityUUIDs is welcome, and if UUID of your Xcode version is already there, please try to reinstall the plugin from a clean state.
如果本插件在你最新版本的 Xcode 中无法正常运行,请不要新开 issue
关于 DVTPlugInCompatibilityUUIDs 变量值的 PR 随时欢迎你提。
不过如果你的 Xcode 版本对应的 UUID 值已经合到了主分支,清尝试在 clean 状态下重新安装插件。

The default deployment target is 10.8. If you want to use it in a earlier OS version, you should change OS X Deployment Target (in project info setting) to your system version.
默认的部署目标(macOS版本)是 10.8 。
如果你想使用更早的操作系统版本,需要修改 OS X 部署目标到你自己的系统版本值(在项目信息设置的那个界面)。

Swift Support

Swift 支持

Yes, this plugin supports documentation for Swift 2 now. Check this post to see how to write the documentation for swift. By using VVDocumenter-Xcode, you can just type /// to make the magic happen.
是的,本插件现在也支持 Swift 2 了。看看这个网页中关于“如何向 Swift 代码添加文档注释”的内容。
通过使用 VVDocumenter-Xcode ,你只需要键入 /// 就能让魔幻之事发生。

The documentation format changed from Swift 1.x to 2. If you are using Swift 1.x, you could build from branch Xcode6 to get the support for the earlier format.
Swift 从 1 升版本到 2 时,文档的格式也有改动。
如果你在使用 Swift 1 ,可以从 Xcode6 分之编译来获取更早的格式。

Limitations and Future

当前局限性 & 未来发展

The plugin is using simulation of keyboard event to insert the doc comments for you. So it is depending the keyboard shortcut of Xcode. These two kinds of operation are being used:
本插件是通过模拟键盘事件的方式帮你自动插入大段文档的,所以它对 Xcode 的键盘快捷键是有依赖的。
这两种操作被应用:

  • Delete to Beginning of the Line (⌘⌫) 删除到本行的行首(command ⌫)
  • Paste (⌘V) 粘贴(command+V)

If you have modified these two shortcuts in your Xcode, the newset version of the plugin would not work correctly. Instead, you can use a earlier version such as this one(commit 03c4169ff7). Be causion you may suffer an undo and redo issue .
如果你在 Xcode 中修改了这两个快捷键,本插件的最新版本就不能正常运行了。
也有替代的解决方式:你可以使用更早的版本,比如:this one(commit 03c4169ff7)。
但是要小心点你可能会碰到这个问题:undo and redo issue 。

VVDocumenter-Xcode is now using regular expression to extract things needed, which is not the best way to do such thing. A better approach could be using the AST, and I also have a plan to do it later if I have some more time 😃
VVDocumenter-Xcode 现在已经开始用正则表达式来提取所需信息了(其实正则表达式并不是解决这个问题最好的方式)。
有种更好的解决方案就是用抽象语法树 (AST, Abstract Syntax Tree) ,我也有相关的计划就是如果之后我有更多的空余时间,我会用新方式去解决。

License

许可证

VVDocumenter is published under MIT License. See the LICENSE file for more.
VVDocumenter 是按 MIT 许可发布的,你可以查看该许可证内容获知更多明细。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/173771.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Python爬虫---爬虫介绍,实战案例

目录标题1、爬虫介绍1.1 爬虫的合法性1.2 网络爬虫的尺寸1.3 robots.txt协议1.4 http&https协议1.5 requests模块1.5.1 request库的异常2、实战案例2.1 百度页面2.2 爬取京东商品页面2.3 爬取亚马逊商品页面-更改headers2.4 百度/360搜索关键词提交-params2.5 网络图片的爬…

Nacos 报Statement cancelled due to timeout or client request

1. 问题:nacos 启动报错,启动失败,全部报错下面贴出。 2. 结论:排查结果为服务器带宽不够,mysql 查询的数量量太大,传输时间损坏在网络io上! 3. 下面开始回溯事故起因: 前期config…

2022年一年级入学小结

2022年即将过去,在这里,简单回顾一下Richard同学进入小学一学期后的成长经历和小结。先说说学校生活Richard很喜欢目前的学校,喜爱给他授课的每一位老师,也和老师和同学们相处得不错,自诩自己现在的”粉丝“蛮多。从我…

C++设计模式(6)——适配器模式

亦称: 封装器模式、Wrapper、Adapter 意图 适配器模式是一种结构型设计模式, 它能使接口不兼容的对象能够相互合作。 问题 假如你正在开发一款股票市场监测程序, 它会从不同来源下载 XML 格式的股票数据, 然后向用户呈现出美…

9.框架SpringMVC

一、基本概念 Spring MVC 是 Spring 提供的一个基于 MVC 设计模式的轻量级 Web 开发框架,本质上相当于 Servlet。Spring MVC 使用 MVC 架构模式的思想,将 Web 应用进行职责解构,把一个复杂的 Web 应用划分成模型(Model&#xff09…

HashMap的使用:put、remove和get方法原理

关联项目需求进行FeatureAB上报的时候,我们使用HashSet的add方法存key值,如果key已存在,则add失败,返回false,如果key不存在,add成功,返回true。看源码中HashSet的add(E e)方法实现:…

【Git】IDEA 集成 GitHub

8、IDEA 集成 GitHub 8.1、设置 GitHub 账号 如果出现 401 等情况连接不上的,是因为网络原因,可以使用以下方式连接: 然后去 GitHub 账户上设置 token。 点击生成 token。 复制红框中的字符串到 idea 中。 点击登录。 8.2、分享工程到 GitHu…

【甄选靶场】Vulnhub百个项目渗透——项目五十五:SP-LEOPOLD v1.2(beef联动msf,脏牛提权)

Vulnhub百个项目渗透 Vulnhub百个项目渗透——项目五十五:SP-LEOPOLD v1.2(beef联动msf,脏牛提权) 🔥系列专栏:Vulnhub百个项目渗透 🎉欢迎关注🔎点赞👍收藏⭐️留言&am…

ZooKeeper-集群搭建

5)ZooKeeper 集群搭建 5.1)Zookeeper集群介绍 Leader选举: •Serverid:服务器ID 比如有三台服务器,编号分别是1,2,3。 编号越大在选择算法中的权重越大。 •Zxid:数据ID 服务器中存放的最大数据ID.值越大说明数据 越新&…

剑指offer—day1.用两个栈实现队列、包含min函数的栈

1.用两个栈实现队列 本题来源:力扣 剑指 Offer 09. 用两个栈实现队列 - 力扣(LeetCode)https://leetcode.cn/problems/yong-liang-ge-zhan-shi-xian-dui-lie-lcof/题目描述 用两个栈实现一个队列。队列的声明如下,请实现它的两…

IP-guard如何映射到外网登录访问管理

终端安全管理(endpoint security management)是一种保护网络安全的策略式方法,它需要终端设备在得到访问网络资源的许可之前遵从特定的标准。随着企业信息化发展,终端安全管理系统需求不断扩大,相关系统软件被广泛应用。 IPguard即IP-guard&a…

线段树(重要!多加理解懒惰标记!)

基础概念: 线段(区间)[L,R] 所对应的线段树是由区间 [L,R] 及其子区间构成的二叉树(如下图所示) 线段树具有的特性: (1)线段树的叶结点为只有一个元素的区间,因此长度为…

最新版海豚调度dolphinscheduler-3.1.3安装部署详细教程

0 背景 本文基于Ambari集群搭建最新版本的海豚调度dolphinscheduler-3.1.3版本,后续会尝试整合到Ambari中。 1 安装准备 安装dolphinscheduler需要在环境中安装如下依赖 ① JDK8 下载JDK (1.8),安装并配置 JAVA_HOME 环境变量,并将其下的 …

用 22 张照片打开 23 年

魔幻又带有现实主义色彩的三年似乎终将见底。这也为 2023 年赋予了一些新的意义,或许是充满生机、怀揣希望、满怀爱意,或许是重新启航、步履不停、勇敢探索……为此,我们收集了 22 位社区用户和公司小伙伴在过去一年的「特别 Moment」及新年愿…

你认为DAO是否可行?新年计划,卯足干劲,兔必No.1

文章目录🌟 课前小差🌟 聚沙成塔🌟 社会价值🌟 DAO是什么🌟 国产化🌟 商业化回报🌟 写在最后🌟 课前小差 哈喽,大家好,我是几何心凉,这是一份全新…

Spring高级之BeanFactory功能

首先,我们想要知道一个接口有哪些功能,就必须要看这个接口的源代码,在idea中,选中这个接口CtrlF12,来查看这个接口里面有哪些方法: 表面上来看,功能其实很少,查看源码及其方法功能 …

来吧,Jenkins+git+mvn+shell一键部署实践起来

环境:centosJenkins-2.319系统自带gitmvn3.8.7jdk1.8一、安装jdk1、https://blog.csdn.net/codedz/article/details/124044974centos自带了openjdk,我是选择自己重新搞一个,用的上面链接地址的yum安装方式2、安装完成查看版本查看java安装路径…

优思学院|质量人对控制图中的规格线和控制线傻傻分不清?

质量人、六西格玛[1]人和很多不同类型的工程师都需要了解什么是控制图,而在控制图中的规格限制(Specification Limit)"和"控制限制(Control Limit)"原来对好多人来说都是傻傻分不清! 规格限…

线段树入门

对于一个区间进行询问,进行修改,都是用线段树进行处理。线段树和普通的树不一样,普通的树的节点存的是一个编号,线段树存的是一个区间,而且线段树一定是一棵完全二叉树。例如:这就是一棵线段树。例如对于[1…

【Ajax】数据交换格式XML 和 JSON

一、什么是数据交换格式数据交换格式,就是服务器端与客户端之间进行数据传输与交换的格式。前端领域,经常提及的两种数据交换格式分别是 XML 和 JSON。其中 XML 用的非常少,所以,我们重点要学习的数据交换格式就是 JSON。二、XML1…