Repository navigation
Export menu: copy as image, download PNG, save as PDF
The toolbar's Copy as image button is now an Export menu (#433, #442):
- Copy as image puts the whole page on the clipboard as a PNG.
- Download PNG saves the same image as a file named from the page title. The code comes from #434 by @Linuxdazhao.
- Save as PDF opens the browser's print dialog with the page's print styles.
Copying also works in Firefox now. When the browser, the clipboard or a policy rules copying out, the menu item is disabled and says why, instead of the button disappearing. Safari and other browsers can try it, with a note that the result is not guaranteed (#424, #425, #438). A long page stays within the browser's canvas limit, and a table or diagram that scrolls on the page no longer shows stray scrollbars in the image (#435, #436).
am render checks path:line references
An inline code span that is only a path and a line, such as `src/cli.js:42` or `src/cli.js:18-30`, cites that file. am render checks it against the current folder and prints a refs warning with the draft line (L12 [ref] ...) when the file is missing, the lines go past its end, or the range runs backwards. A missing file counts only when its first folder exists here (src/clii.js:4 when src/ exists), so a path of another project is not checked. A page with these warnings does not open by itself, the same as with code warnings (#426, #429).
The skill also has a method for pages that explain a codebase: find the entry points, draw the modules, trace one request end to end, and cite every claim as path:line (#426, #427).
api: one change across several endpoints
An api block can hold several HTTP and RPC endpoints that one requirement changes together. Mark endpoints, sections or fields with +, - or ~, and the block gets the same Before / Changes / After switch as other change views. A paired - old and + new line keeps both exact definitions (#393).
Fixes
- Private pages:
am render --replacekeeps a private page private when the new page gets a new file name, so a 0600 page in a sharedpages_diris no longer rewritten as 0644 (#443). - Diagram viewer: a diagram stays sharp when you zoom in, instead of showing a stretched bitmap (#430, #441).
- api tables: a narrow column wraps field names and types between words (
Order|Status,refund_|amount), not at any letter (#428). - Tests: two races in the live-reload browser tests are fixed (#444).
- Dependencies: marked 18.2.0 (#437).
Full list: #393, #425, #427, #428, #429, #436, #437, #438, #441, #442, #443, #444.
导出菜单:复制为图片、下载 PNG、保存为 PDF
工具栏上的「复制为图片」按钮改成了导出菜单(#433、#442):
- 复制为图片:把整页作为 PNG 放进剪贴板。
- 下载 PNG:把同一张图片存成文件,文件名取自页面标题。代码来自 @Linuxdazhao 的 #434。
- 保存为 PDF:打开浏览器的打印对话框,使用页面自带的打印样式。
Firefox 现在也能复制。浏览器、剪贴板或权限策略不允许复制时,菜单项会变灰并说明原因,按钮不再直接消失。Safari 等其他浏览器可以尝试,同时提示效果不保证(#424、#425、#438)。很长的页面不会超出浏览器的画布上限;页面上可横向滚动的表格或图表,在图片里不再出现多余的滚动条(#435、#436)。
am render 核对 路径:行号 引用
正文里只写路径和行号的行内代码,如 `src/cli.js:42` 或 `src/cli.js:18-30`,表示引用该文件。am render 会在当前目录里核对:文件不存在、行号超出文件末尾、或范围前大后小时,打印带稿件行号的 refs 警告(L12 [ref] ...)。文件不存在时,只有它的第一级目录在当前目录里存在才算警告(例如 src/ 存在而写了 src/clii.js:4),所以其他项目的路径不检查。有这类警告的页面和有代码警告的一样,不会自动打开(#426、#429)。
skill 里还新增了讲解代码库的方法:先找入口,画出模块,从头到尾追一条请求,每个结论都用 路径:行号 标出出处(#426、#427)。
api:一次改动涉及多个接口
一个 api 块可以放同一需求一起改动的多个 HTTP 和 RPC 接口。在接口、分区或字段前加 +、- 或 ~,块上就会出现和其他改动视图一样的「改前 / 变更 / 改后」切换。成对的 - 旧定义和 + 新定义会各自原样保留(#393)。
修复
- 私有页面:
am render --replace生成的新页面换了文件名时,私有页面仍保持私有,共用pages_dir里权限 0600 的页面不会再变成 0644(#443)。 - 图示查看器:放大图表时保持清晰,不再显示拉伸的位图(#430、#441)。
- api 表格:列太窄时,字段名和类型在词与词之间换行(
Order|Status、refund_|amount),不会在任意字母处断开(#428)。 - 测试:修复 live 自动刷新浏览器测试里的两处竞态(#444)。
- 依赖:marked 18.2.0(#437)。
完整列表:#393、#425、#427、#428、#429、#436、#437、#438、#441、#442、#443、#444。