第 7 章 Visual Studio Code
7.1 下载安装
请在Visual Studio Code官网下载该软件。
7.2 制作公开数据的README.md文件
更新于:2024-11-29
- 在Visual Studio Code中新建一个文本文档:
图 7.1: 在VS Code中新建一个文本文档
之后,你应该看到类似的新建文件:
图 7.2: VS Code中的新建文本文档
2. 将新建文档保存为README.md文件:
图 7.3: 将新建文本文档另存为…
README.md:
图 7.4: 重命名文件为“README.md”并选择文件存储位置
3. 根据数据文件编辑README.md文件
在README.md文件中,你可以添加根据数据文件的内容,添加列名称(Header)和内容描述(Description):
图 7.5: 数据文件
我们相应地编辑README.md文件:
Header | Description
---|---
SubjCode | Subject Code
Trial Number | trial number
Orientation | orientation of the stimulus: `upr`: upright vs `inv`: inverted
Congruency | congruency of the trial type in complete composite task: `con`: congruent vs `inc`: incongruent
Alignment | whether the top and bottom halves of faces are aligned (`ali`) or misaligned (`mis`)
CorrectAnswer | whether the correct response was the same (`s`) or different (`d`)
Acc | whether the response was correct (`1`) or incorrect (`0`)
isSame | whether participant reported the same (`1`) or not (`0`) for that trial
RT | response time in milliseconds
4. 编辑README.md文件的同时预览效果
在编辑README.md文件的同时,你可以通过以下方式来预览效果:
Ctrl + Shift + V(Windows)快捷键Cmd + Shift + V(Mac)快捷键- 右键点击
README.md文件,选择Open Preview选项
图 7.6: 右键点击README.md文件,选择Open Preview选项
图 7.7: 预览md文件
5. 将README.md文件保存为pdf文件
完成编辑README.md文件后,我们可以将其保存为或生成一个pdf文档。
5.1 在VS Code中安装Markdown PDF插件
图 7.8: VS Code中打开Extension
Markdown PDF,并点击安装(Install):
图 7.9: 搜索并安装Markdown PDF
5.2 生成pdf文件
安装完成Markdown PDF插件后,请确保README.md已在VS Code中打开,然后通过View -> Command Palette打开Command Palette:
图 7.10: 打开Command Palette
Command Palette中搜索并打开Markdown PDF: Export (pdf):
图 7.11: Markdown PDF Export (pdf)
图 7.12: 正在生成PDF文件…
README.md文件所在的文件夹中找到生成的pdf文件:
图 7.13: 正在生成PDF文件…
图 7.14: PDF文件