先为Jupyter Notebook中的代码生成结构完整的Markdown注释(含总标题、功能概述、依赖参数、输出、代码步骤、注意事项),再将其转为带折叠功能的HTML,标题加粗、关键要点加粗,方便复制使用。
中文版提示词
请用 Markdown 语法为下面这段代码在 Jupyter Notebook 中编写整体注释。注释首先需要有一个概括代码总体功能的总标题(使用三级标题样式,即三个#),然后包含"功能概述""依赖参数""输出""代码功能步骤""注意事项"五个部分,每个部分的分标题使用四级标题样式(即四个#)。请将 Markdown 格式的注释写入代码框内,方便我复制后粘贴到 Jupyter Notebook 中直接使用。 代码内容: [代码] 随后,请将上述 Markdown 注释转为 HTML,以便在 Jupyter Notebook 中展示时,三级标题和四级标题具有折叠功能(想看再展开,不想看就收起)。要求:所有标题均加粗;"依赖参数""输出"两个四级标题单独标为红色;标题下的具体内容中,每个无序列表里":"前面的部分是关键要点需加粗,":"后面的部分是普通内容不加粗;其余布局不变。请用 <details> 和 <summary> 标签实现折叠展开,每个标题用 <summary> 表示,并在标题下方用 <details> 包裹具体内容。
英文版提示词
Please write an overall comment in Markdown syntax for the following code in a Jupyter Notebook. The comment should first include a general title summarizing the code's overall function (using a level-3 heading style, i.e., three #), then include five sections: "Function Overview," "Dependencies & Parameters," "Output," "Code Steps," and "Notes," with each section heading using a level-4 heading style (four #). Please put the Markdown-formatted comment in a code block so I can copy and paste it directly into Jupyter Notebook. Code: [code] Then, convert the above Markdown comment into HTML so that, when displayed in Jupyter Notebook, the level-3 and level-4 headings have a collapsible function (expand to view, collapse to hide). Requirements: all headings must be bold; the two level-4 headings "Dependencies & Parameters" and "Output" must be marked in red; within the content under each heading, the part before ":" in each unordered list item is the key point and must be bold, while the part after ":" is normal content and must not be bold; keep the rest of the layout unchanged. Use <details> and <summary> tags to implement the collapse/expand function, with each heading represented by a <summary> tag and the specific content wrapped in a <details> tag below it. 🛠️ **适用 AI 工具**:Claude、ChatGPT、Cursor、Copilot、DeepSeek

◯ 评论 0