第 6 章 Visual Studio Code
6.1 下载安装
请在Visual Studio Code官网下载该软件。
6.2 制作公开数据的README.md文件
更新于:2024-11-29
- 在Visual Studio Code中新建一个文本文档:

图 6.1: 在VS Code中新建一个文本文档
之后,你应该看到类似的新建文件:

图 6.2: VS Code中的新建文本文档
2. 将新建文档保存为README.md
文件:

图 6.3: 将新建文本文档另存为…
README.md
:

图 6.4: 重命名文件为“README.md”并选择文件存储位置
3. 根据数据文件编辑README.md
文件
在README.md
文件中,你可以添加根据数据文件的内容,添加列名称(Header
)和内容描述(Description
):

图 6.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
选项

图 6.6: 右键点击README.md
文件,选择Open Preview
选项

图 6.7: 预览md文件
5. 将README.md
文件保存为pdf文件
完成编辑README.md
文件后,我们可以将其保存为或生成一个pdf文档。
5.1 在VS Code中安装Markdown PDF
插件

图 6.8: VS Code中打开Extension
Markdown PDF
,并点击安装(Install
):

图 6.9: 搜索并安装Markdown PDF
5.2 生成pdf文件
安装完成Markdown PDF
插件后,请确保README.md
已在VS Code中打开,然后通过View -> Command Palette
打开Command Palette
:

图 6.10: 打开Command Palette
Command Palette
中搜索并打开Markdown PDF: Export (pdf)
:

图 6.11: Markdown PDF Export (pdf)

图 6.12: 正在生成PDF文件…
README.md
文件所在的文件夹中找到生成的pdf文件:

图 6.13: 正在生成PDF文件…

图 6.14: PDF文件