diff --git a/docs/_static/precontent.css b/docs/_static/precontent.css new file mode 100644 index 00000000..a671f564 --- /dev/null +++ b/docs/_static/precontent.css @@ -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"; +} diff --git a/docs/_static/seealso.css b/docs/_static/seealso.css new file mode 100644 index 00000000..59cdb963 --- /dev/null +++ b/docs/_static/seealso.css @@ -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"; +} diff --git a/docs/conf.py b/docs/conf.py index 14a8edfd..b71daca1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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") diff --git a/docs/faq/basic_concepts/c_string.rst b/docs/faq/basic_concepts/c_string.rst index 5dac3a04..afe0bf67 100644 --- a/docs/faq/basic_concepts/c_string.rst +++ b/docs/faq/basic_concepts/c_string.rst @@ -2,7 +2,8 @@ C 风格字符串和字符串字面值 (C-style string and string literal) ************************************************************************************************************************ -.. seealso:: +.. admonition:: 前置内容 + :class: precontent - :doc:`/faq/basic_concepts/c_array` diff --git a/docs/faq/copy_functions_parameter/main.rst b/docs/faq/copy_functions_parameter/main.rst index 361a7e33..c202d25f 100644 --- a/docs/faq/copy_functions_parameter/main.rst +++ b/docs/faq/copy_functions_parameter/main.rst @@ -54,7 +54,8 @@ :cpp:`Widget&` 只能引用左值, 但很多情况需要用右值拷贝 ------------------------------------------------------------------------------------------------------------------------ -.. seealso:: +.. admonition:: 前置内容 + :class: precontent - :doc:`/faq/basic_concepts/value_category` diff --git a/docs/faq/east_const/main.rst b/docs/faq/east_const/main.rst index e80b4cd7..c5adba89 100644 --- a/docs/faq/east_const/main.rst +++ b/docs/faq/east_const/main.rst @@ -2,7 +2,8 @@ :cpp:`const` 的阅读: 常量指针? 指针常量? *********************************************************************************************************************** -.. seealso:: +.. admonition:: 前置内容 + :class: precontent - :doc:`/faq/basic_concepts/const` - :doc:`/faq/basic_concepts/reference` diff --git a/docs/faq/index.rst b/docs/faq/index.rst index c20baca9..d9dd8195 100644 --- a/docs/faq/index.rst +++ b/docs/faq/index.rst @@ -12,6 +12,11 @@ .. admonition:: 阅读方法 :class: dropdown + .. admonition:: 前置内容 + :class: precontent + + 这是阅读本部分所需的前置内容. + .. hint:: 这是对思维的进一步启发. @@ -26,7 +31,7 @@ .. seealso:: - 放在开头, 表示必需的前置知识; 放在最后, 表示可用的扩展内容. + 这是可用的扩展资料. .. admonition:: 相关核心准则 :class: coreguidelines diff --git a/docs/faq/md_c_array/main.rst b/docs/faq/md_c_array/main.rst index 5c3810dc..f1715755 100644 --- a/docs/faq/md_c_array/main.rst +++ b/docs/faq/md_c_array/main.rst @@ -2,7 +2,8 @@ 多维数组 (multi-dimensional C-style array) ************************************************************************************************************************ -.. seealso:: +.. admonition:: 前置内容 + :class: precontent - :doc:`/faq/basic_concepts/c_array` diff --git a/docs/faq/pointer_output/main.rst b/docs/faq/pointer_output/main.rst index e312bef9..39a3841e 100644 --- a/docs/faq/pointer_output/main.rst +++ b/docs/faq/pointer_output/main.rst @@ -2,7 +2,8 @@ 为什么字符指针不输出地址值, 而其他指针输出地址值? ************************************************************************************************************************ -.. seealso:: +.. admonition:: 前置内容 + :class: precontent :cpp:`/faq/basic_concepts/operator_overloading` diff --git a/docs/faq/range_iterator_and_algorithm/main.rst b/docs/faq/range_iterator_and_algorithm/main.rst index 3a8af7c3..98d3aead 100644 --- a/docs/faq/range_iterator_and_algorithm/main.rst +++ b/docs/faq/range_iterator_and_algorithm/main.rst @@ -2,7 +2,8 @@ 范围、迭代器和算法 (range, iterator and algorithm) ************************************************************************************************************************ -.. seealso:: +.. admonition:: 前置内容 + :class: precontent - :doc:`/faq/basic_concepts/auto` - :doc:`/faq/basic_concepts/c_array` @@ -1098,7 +1099,8 @@ TODO, 没想到好的解释. 用不同层次的迭代器定义算法 ------------------------------------------------------------------------------------------------------------------------ -.. seealso:: +.. admonition:: 前置内容 + :class: precontent :doc:`/faq/virtual_function_invocation_explain/main` diff --git a/docs/faq/rule_of_350/main.rst b/docs/faq/rule_of_350/main.rst index 98742c63..4ab8ed10 100644 --- a/docs/faq/rule_of_350/main.rst +++ b/docs/faq/rule_of_350/main.rst @@ -2,7 +2,8 @@ rule of 3/5/0: 要么不定义任何特殊函数, 要么定义它们全部 ************************************************************************************************************************ -.. seealso:: +.. admonition:: 前置内容 + :class: precontent - :doc:`/faq/basic_concepts/resource`