Documentation(文档)¶
You can provide users with documentation on projects in Code Repositories by adding a README file. README files in Code Repositories support Markdown for flexible, easy-to-use formatting and styling.
Edit or add a README.md file to your repository to get started. This page contains information on additional features that can be used to customize a README file.
If a README file is insufficient for your documentation needs, you can create custom documentation using Code Repositories that can be published as in-platform documentation.
Features¶
Code Repositories provides a number of formatting options for READMEs.
Inline image previews¶
You can display an image from your repository inline with the text of a Markdown file by using the following syntax:

In order to upload images to a code repository, you will need to clone your repository locally, add the image files to the local repository, and then push the changes to the server.
Mentioning Foundry users¶
To mention a Foundry user in your Markdown files, enter their username with the @ symbol as a prefix. This will create a reference to the mentioned user and a direct link to their profile.
@username
Referencing Foundry resources¶
You can reference any Foundry resource by pasting its Resource ID directly into the Markdown file for the README. Resources referenced like this will automatically be named and linked to the corresponding resource in platform.
This repository will be deployed to ri.foundry.main.deployed-app.a00000aa-a000-000a-0000-000a0aa0a00a
Linking to files in the repository¶
To create a link to a file within your repository, use the repo:// protocol followed by the file path; for example, repo://transforms-python/src/myproject/datasets/examples.py. Files referenced like this will automatically open when clicked. This allows you to easily reference and navigate to other files within your repository.
Syntax highlighting¶
README files support language syntax highlighting in code blocks in order to improve code legibility. To use syntax highlighting, specify the language after the opening code block delimiter as follows:
def hello_world():
print("Hello, World!")
Tables¶
You can also create tables using standard Markdown table syntax:
| Header 1 | Header 2 |
| -------- | -------- |
| Cell 1 | Cell 2 |
Links¶
URLs and email addresses in a README will be automatically converted into clickable links.
中文翻译¶
文档¶
您可以通过添加README文件,为代码仓库(Code Repositories)中的项目提供用户文档。代码仓库中的README文件支持Markdown格式,可实现灵活易用的排版与样式设计。
在仓库中编辑或添加README.md文件即可开始使用。本页介绍了可用于自定义README文件的额外功能。
如果README文件无法满足您的文档需求,您可以使用代码仓库创建自定义文档,并将其发布为平台内文档。
功能特性¶
代码仓库为README文件提供了多种排版选项。
内联图片预览¶
您可以使用以下语法,在Markdown文件的文本中内联显示仓库中的图片:

如需将图片上传至代码仓库,您需要先在本地克隆仓库,将图片文件添加到本地仓库,然后将更改推送至服务器。
提及Foundry用户¶
要在Markdown文件中提及Foundry用户,请在用户名前添加@符号作为前缀。这将创建对被提及用户的引用,并生成指向其个人资料页面的直接链接。
@用户名
引用Foundry资源¶
您可以通过将资源ID(Resource ID)直接粘贴到README的Markdown文件中,来引用任何Foundry资源。以这种方式引用的资源将自动命名,并链接到平台中对应的资源。
此仓库将部署至 ri.foundry.main.deployed-app.a00000aa-a000-000a-0000-000a0aa0a00a
链接仓库中的文件¶
要创建指向仓库内文件的链接,请使用repo://协议后跟文件路径,例如:repo://transforms-python/src/myproject/datasets/examples.py。以这种方式引用的文件在点击时会自动打开。这使您可以轻松引用并导航到仓库中的其他文件。
语法高亮¶
README文件支持代码块中的语言语法高亮,以提高代码可读性。要使用语法高亮,请在代码块起始分隔符后指定语言,示例如下:
def hello_world():
print("Hello, World!")
表格¶
您还可以使用标准Markdown表格语法创建表格:
| 表头1 | 表头2 |
| -------- | -------- |
| 单元格1 | 单元格2 |
链接¶
README中的URL和电子邮件地址将自动转换为可点击的链接。