编辑文章帮助

本文档使用 Markdown 语法编写。每个页面或“文章”都是一个 Markdown (.md) 文件,位于官方 SUMO GitHub 仓库的 此处

静态 HTML 页面随后使用 Mkdocs 生成。

欢迎为 SUMO 文档做出贡献并进行改进。所有更改都需要通过 Pull Request(拉取请求)进行。您可以点击每个页面右上角的“Edit on GitHub”按钮,或者直接在键盘上按 e 键。

Note

虽然可以在 Markdown 中编写 HTML,但请尽量避免使用 HTML,尽可能保持所有内容为原生 Markdown 格式。



创建文章#

要创建新文章(或页面),只需在 文档目录 中创建一个 Markdown (.md) 文件。

Note

文件名首字母请大写,并使用 _(下划线)代替单词之间的 (空格)。

每个页面的前 3 行应为:

---
title: 文章名称
---

如果您想创建一篇全新的文章,请首先查看任何现有文章的源代码,以学习并掌握一些基本概念。



章节和子章节#

文档中的章节和子章节使用 # 字符标记。

# 等同于 <h1> 章节,## 等同于 <h2>,依此类推。

Note

在每个页面右侧的目录(toc)侧边栏中,仅列出 ###### 章节。尽管如此,所有其他级别都会生成内部链接,因此可以从其他页面引用和链接。

示例#

#### 这是一个子章节,等同于 <h4>

将显示为:

这是一个子章节,等同于 <h4>#



CSS 类、ID 和键值对#

Markdown 允许使用 CSS 类、ID 和键值对:https://python-markdown.github.io/extensions/attr_list/

自定义类:

  • .cellNoWrap : 防止换行(在表格中很有用)。

示例#

{: #someid .someclass somekey='some value' }



文本样式#

元素 代码 将显示为
粗体 **test** test
斜体 *test* test
粗体 + 斜体 ***test*** test
删除线 ~~test~~ test

Markdown 兼容 <sub><sup> HTML 标签。

  • η<sub>recup</sub>=e<sup>x</sup> ηrecup=ex

示例#

Lorem *ipsum* dolor sit amet, *consetetur sadipscing elitr*, sed diam **nonumy** eirmod **tempor invidunt ut labore** et ~~dolore~~ magna ***aliquyam erat, sed diam*** voluptua.

将显示为:

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.



转义字符#

使用转义字符来显示在 Markdown 中具有特殊含义的字面字符。转义字符是 \(反斜杠)。在 `` 标记(行内代码)或代码块内编写文本时,不需要转义字符。

以下是一些需要转义字符的表达式:

  • @ : 否则会被视为 GitHub 用户名
  • # : 否则会被视为标题或 GitHub issue
  • | : 在表格中使用时
  • >
  • {
  • }
  • *

示例#

`<TEST1>` 使用代码。此处不需要转义字符。
<TEST2> 不使用转义字符。此处元素会消失。
<TEST3\> 使用转义字符

将显示为:

<TEST1> 使用代码。此处不需要转义字符。
不使用转义字符。此处元素会消失。
<TEST3> 使用转义字符



图片#

所有图片必须保存在 图片目录 中。 要插入图片,只需使用通常的 Markdown 语法:

![<alt>](images/Wikicommons_rail_fast.jpg "<title>")

<alt> 替换为替代文本,将 <title> 替换为鼠标悬停时显示的标题。

Note

<alt><title> 属性不是必须的,如示例所示。

示例#

![](images/Wikicommons_rail_fast.jpg)

将显示为:



表格#

请参阅此 在线表格生成器 以获取创建 Markdown 表格的帮助,或将现有的电子表格(例如 Microsoft Excel)转换为 Markdown。

表格有一个表头(第一行),通过连字符 - 与表格的其余部分分隔。 要分隔列,只需使用竖线 |

示例#

|   |   |   |   |   |
|---|---|---|---|---|
|   |   |   |   |   |
|   |   |   |   |   |
|   |   |   |   |   |

将显示为:

Note

在表格之前和之后立即留一个空行(换行)非常重要。



数学公式#

为了插入数学表达式(符号或方程),您应该使用 LaTeX 格式 编写它们。数学元素将使用 HTML <img> 元素显示为图像。 只需在以下 HTML 元素中将 <HERE> 替换为您的数学表达式:

<img src="https://latex.codecogs.com/gif.latex?<HERE>" border="0" style="margin:0;"/>

示例#

<img src="https://latex.codecogs.com/gif.latex?R" border="0" style="margin:0;"/>

将显示为:


<img src="https://latex.codecogs.com/gif.latex?F(x)=\int^a_b\frac{1}{3}x^3" border="0" style="margin:0;"/>

将显示为:



宏 / 变量#

为了使编写此文档更容易,我们实现了一些宏。宏会将一些特殊文本替换为其他内容。

示例#

{{SUMO}} {{DT_FILE}} {{DT_STR}} {{Version}}

将显示为:

<SUMO_HOME> <FILE> <STRING> 1.25.0

Note

可用宏的完整列表可以在 此处extra 部分找到。

Caution

宏在行内代码或代码块中不起作用。



链接#

当链接到本文档中的页面时,请考虑 Markdown 文件的绝对路径。 不要忘记为每个内部链接添加 .md 扩展名。

链接到外部页面将在末尾显示一个箭头(例如 DLR)。

链接到 SUMO GitHub 仓库中的文件#

使用 {{Source}} 宏,链接到官方 SUMO GitHub 仓库中的文件非常简单:

Note

{{Source}} 宏等同于 https://github.com/eclipse-sumo/sumo/blob/main/,包括末尾的 /。请分析以下示例:

内部链接#

内部链接用于引用文章的特定部分。您可以通过将光标悬停在章节标题旁边来获取该部分的内部链接(将出现一个 # 字符)。

链接到同一页面内的部分非常简单:阅读关于数学的内容 [Read about Math](#math)

Caution

内部链接中的所有文本均为小写。

要引用另一页面上的部分,请不要忘记使用绝对路径和 .md 扩展名,如下所示:阅读关于 SUMO 输入的内容 [Read about SUMO input](sumo.md#input)

在生成内部链接时,某些字符会被忽略(删除)或替换:

  • . 被忽略
  • : 被忽略
  • ? 被忽略
  • ' 被忽略
  • " 被忽略
  • / 被忽略
  • > 被忽略
  • ( 转换为 _
  • ) 转换为 _
  • (空格) 转换为 _

以下是一些实际示例:

章节标题 实际链接
tools fail with a SyntaxError or ImportError or some TypeError concerning ">>" #tools_fail_with_a_syntaxerror_or_importerror_or_some_typeerror_concerning
Why do I get errors about missing files / file not found even though the file exists? #why_do_i_get_errors_about_missing_files_file_not_found_even_though_the_file_exists
Version 1.3.1 (27.08.2019) #version_131_27082019

Note

没有永久链接以 _ 字符结尾。

示例#

转到 [sumo-gui](sumo-gui.md)[netconvert 选项](netconvert.md#options)  [符号](Basics/Notation.md)

<https://www.dlr.de>  [DLR](https://www.dlr.de)
  • [Read the gitignore file]({{Source}}.gitignore)
  • [{{SUMO}}/src/sumo_main.cpp]({{Source}}src/sumo_main.cpp)

将显示为:

转到 sumo-guinetconvert 选项符号

https://www.dlr.deDLR



GitHub issues、commits 和 users#

为了自由使用 # 和 @ 字符,请使用 转义字符

元素 代码 将显示为
GitHub issue #5697 #5697
GitHub user @namdre @namdre
GitHub commit 3aa106d1bf3221031cca75cfe259913d9d3e88ae (完整的 Commit Hash) 3aa106d

示例#

The issue #5697 was reported by @angelobanse. @behrisch committed 3aa106d1bf3221031cca75cfe259913d9d3e88ae to close that issue.

将显示为:

The issue #5697 was reported by @angelobanse. @behrisch committed 3aa106d to close that issue.



注释#

NOTECAUTION 元素对于突出显示重要信息非常有用。 您也可以使用自定义注释类型。

Note 元素内部,您可以使用 Markdown 语法插入链接、设置文本样式甚至插入图片。

Caution

不幸的是,您无法在表格中插入注释。

示例#

!!! note
    When citing SUMO in general please use our current reference
    publication: ["Microscopic Traffic Simulation using SUMO"](https://elib.dlr.de/124092/);
    Pablo Alvarez Lopez, Michael Behrisch, Laura Bieker-Walz, Jakob Erdmann, Yun-Pang Flötteröd,
    Robert Hilbrich, Leonhard Lücken, Johannes Rummel, Peter Wagner, and Evamarie Wießner.
    IEEE Intelligent Transportation Systems Conference (ITSC) 2018.

!!! caution
    The list of not allowed characters is incomplete

!!! incomplete "Missing:"
    This is just a test

{{Outdated}}

将显示为:

Note

When citing SUMO in general please use our current reference publication: "Microscopic Traffic Simulation using SUMO"; Pablo Alvarez Lopez, Michael Behrisch, Laura Bieker-Walz, Jakob Erdmann, Yun-Pang Flötteröd, Robert Hilbrich, Leonhard Lücken, Johannes Rummel, Peter Wagner, and Evamarie Wießner. IEEE Intelligent Transportation Systems Conference (ITSC) 2018.

Caution

The list of not allowed characters is incomplete

Missing:

This is just a test

This information is outdated.



另请参阅#