Skip to content

Commit

Permalink
[faq] 区分参见和前置内容
Browse files Browse the repository at this point in the history
  • Loading branch information
FeignClaims committed Feb 5, 2024
1 parent 1cde306 commit 9a4b588
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 9 deletions.
11 changes: 11 additions & 0 deletions docs/_static/precontent.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
div.admonition.precontent {
border-color: #71c1de;
}
div.admonition.precontent > .admonition-title {
background-color: #def4fa;
color: #222832;
}
div.admonition.precontent > .admonition-title:after {
color: #71c1de;
content: "\f08d";
}
11 changes: 11 additions & 0 deletions docs/_static/seealso.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
div.admonition.seealso {
border-color: #1a0357;
}
div.admonition.seealso > .admonition-title {
background-color: #e0d4ef;
color: #222832;
}
div.admonition.seealso > .admonition-title:after {
color: #1a0357;
content: "\f02d";
}
3 changes: 3 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,7 @@ def setup(app):
app.add_css_file("coreguidelines.css")
app.add_css_file("dontread.css")
app.add_css_file("monofont.css")
app.add_css_file("precontent.css")
app.add_css_file("seealso.css")

app.add_css_file("theme.css")
3 changes: 2 additions & 1 deletion docs/faq/basic_concepts/c_string.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
C 风格字符串和字符串字面值 (C-style string and string literal)
************************************************************************************************************************

.. seealso::
.. admonition:: 前置内容
:class: precontent

- :doc:`/faq/basic_concepts/c_array`

Expand Down
3 changes: 2 additions & 1 deletion docs/faq/copy_functions_parameter/main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
:cpp:`Widget&` 只能引用左值, 但很多情况需要用右值拷贝
------------------------------------------------------------------------------------------------------------------------

.. seealso::
.. admonition:: 前置内容
:class: precontent

- :doc:`/faq/basic_concepts/value_category`

Expand Down
3 changes: 2 additions & 1 deletion docs/faq/east_const/main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
:cpp:`const` 的阅读: 常量指针? 指针常量?
***********************************************************************************************************************

.. seealso::
.. admonition:: 前置内容
:class: precontent

- :doc:`/faq/basic_concepts/const`
- :doc:`/faq/basic_concepts/reference`
Expand Down
7 changes: 6 additions & 1 deletion docs/faq/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
.. admonition:: 阅读方法
:class: dropdown

.. admonition:: 前置内容
:class: precontent

这是阅读本部分所需的前置内容.

.. hint::

这是对思维的进一步启发.
Expand All @@ -26,7 +31,7 @@

.. seealso::

放在开头, 表示必需的前置知识; 放在最后, 表示可用的扩展内容.
这是可用的扩展资料.

.. admonition:: 相关核心准则
:class: coreguidelines
Expand Down
3 changes: 2 additions & 1 deletion docs/faq/md_c_array/main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
多维数组 (multi-dimensional C-style array)
************************************************************************************************************************

.. seealso::
.. admonition:: 前置内容
:class: precontent

- :doc:`/faq/basic_concepts/c_array`

Expand Down
3 changes: 2 additions & 1 deletion docs/faq/pointer_output/main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
为什么字符指针不输出地址值, 而其他指针输出地址值?
************************************************************************************************************************

.. seealso::
.. admonition:: 前置内容
:class: precontent

:cpp:`/faq/basic_concepts/operator_overloading`

Expand Down
6 changes: 4 additions & 2 deletions docs/faq/range_iterator_and_algorithm/main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
范围、迭代器和算法 (range, iterator and algorithm)
************************************************************************************************************************

.. seealso::
.. admonition:: 前置内容
:class: precontent

- :doc:`/faq/basic_concepts/auto`
- :doc:`/faq/basic_concepts/c_array`
Expand Down Expand Up @@ -1098,7 +1099,8 @@ TODO, 没想到好的解释.
用不同层次的迭代器定义算法
------------------------------------------------------------------------------------------------------------------------

.. seealso::
.. admonition:: 前置内容
:class: precontent

:doc:`/faq/virtual_function_invocation_explain/main`

Expand Down
3 changes: 2 additions & 1 deletion docs/faq/rule_of_350/main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
rule of 3/5/0: 要么不定义任何特殊函数, 要么定义它们全部
************************************************************************************************************************

.. seealso::
.. admonition:: 前置内容
:class: precontent

- :doc:`/faq/basic_concepts/resource`

Expand Down

0 comments on commit 9a4b588

Please sign in to comment.