From ce85b819ff63b5e9ca57dfe7d4d520851921802e Mon Sep 17 00:00:00 2001 From: Nils Lindemann Date: Mon, 27 May 2024 11:00:25 +0200 Subject: Prevent font flashing in the docs (#23622) ... by moving the Google font includes near the top of the head. By including them as early as possible, they are known, when the browser starts rendering the body. Test it by making the change manually in `doc/html/system.html` and then press ctrl+f5 (reload without cache). This removes the font flashing. Tested in Chrome and Firefox. --- config/nimdoc.cfg | 7 ++++--- nimdoc/extlinks/project/expected/_._/util.html | 7 ++++--- nimdoc/extlinks/project/expected/doc/manual.html | 7 ++++--- nimdoc/extlinks/project/expected/main.html | 7 ++++--- nimdoc/extlinks/project/expected/sub/submodule.html | 7 ++++--- nimdoc/extlinks/project/expected/theindex.html | 7 ++++--- nimdoc/rst2html/expected/rst_examples.html | 7 ++++--- nimdoc/test_doctype/expected/test_doctype.html | 7 ++++--- nimdoc/test_out_index_dot_html/expected/index.html | 7 ++++--- nimdoc/test_out_index_dot_html/expected/theindex.html | 7 ++++--- nimdoc/testproject/expected/subdir/subdir_b/utils.html | 7 ++++--- nimdoc/testproject/expected/testproject.html | 7 ++++--- nimdoc/testproject/expected/theindex.html | 7 ++++--- 13 files changed, 52 insertions(+), 39 deletions(-) diff --git a/config/nimdoc.cfg b/config/nimdoc.cfg index 5b902b362..99751f79d 100644 --- a/config/nimdoc.cfg +++ b/config/nimdoc.cfg @@ -232,6 +232,10 @@ doc.file = """ $title + + + + @@ -255,9 +259,6 @@ doc.file = """ $analytics - - - """ diff --git a/nimdoc/extlinks/project/expected/_._/util.html b/nimdoc/extlinks/project/expected/_._/util.html index 2078d208c..32dab9216 100644 --- a/nimdoc/extlinks/project/expected/_._/util.html +++ b/nimdoc/extlinks/project/expected/_._/util.html @@ -7,6 +7,10 @@ nimdoc/extlinks/util + + + + @@ -97,8 +101,5 @@ - - - diff --git a/nimdoc/extlinks/project/expected/doc/manual.html b/nimdoc/extlinks/project/expected/doc/manual.html index 64a0f7b7e..2946f803a 100644 --- a/nimdoc/extlinks/project/expected/doc/manual.html +++ b/nimdoc/extlinks/project/expected/doc/manual.html @@ -7,6 +7,10 @@ Nothing User Manual + + + + @@ -37,8 +41,5 @@ - - - diff --git a/nimdoc/extlinks/project/expected/main.html b/nimdoc/extlinks/project/expected/main.html index d86bd1d35..1e7c9c126 100644 --- a/nimdoc/extlinks/project/expected/main.html +++ b/nimdoc/extlinks/project/expected/main.html @@ -7,6 +7,10 @@ nimdoc/extlinks/project/main + + + + @@ -134,8 +138,5 @@ - - - diff --git a/nimdoc/extlinks/project/expected/sub/submodule.html b/nimdoc/extlinks/project/expected/sub/submodule.html index 786de5b86..408ce2060 100644 --- a/nimdoc/extlinks/project/expected/sub/submodule.html +++ b/nimdoc/extlinks/project/expected/sub/submodule.html @@ -7,6 +7,10 @@ nimdoc/extlinks/project/sub/submodule + + + + @@ -123,8 +127,5 @@ - - - diff --git a/nimdoc/extlinks/project/expected/theindex.html b/nimdoc/extlinks/project/expected/theindex.html index 86af18407..cf250edd1 100644 --- a/nimdoc/extlinks/project/expected/theindex.html +++ b/nimdoc/extlinks/project/expected/theindex.html @@ -7,6 +7,10 @@ Index + + + + @@ -51,8 +55,5 @@ - - - diff --git a/nimdoc/rst2html/expected/rst_examples.html b/nimdoc/rst2html/expected/rst_examples.html index 6bfc4bc79..a26704133 100644 --- a/nimdoc/rst2html/expected/rst_examples.html +++ b/nimdoc/rst2html/expected/rst_examples.html @@ -7,6 +7,10 @@ Not a Nim Manual + + + + @@ -266,8 +270,5 @@ stmt = IND{>} stmt ^+ IND{=} DED # list of statements - - - diff --git a/nimdoc/test_doctype/expected/test_doctype.html b/nimdoc/test_doctype/expected/test_doctype.html index 149c88a18..659aec5e3 100644 --- a/nimdoc/test_doctype/expected/test_doctype.html +++ b/nimdoc/test_doctype/expected/test_doctype.html @@ -7,6 +7,10 @@ nimdoc/test_doctype/test_doctype + + + + @@ -75,8 +79,5 @@ - - - diff --git a/nimdoc/test_out_index_dot_html/expected/index.html b/nimdoc/test_out_index_dot_html/expected/index.html index 80f09c5ad..4370f0df8 100644 --- a/nimdoc/test_out_index_dot_html/expected/index.html +++ b/nimdoc/test_out_index_dot_html/expected/index.html @@ -7,6 +7,10 @@ nimdoc/test_out_index_dot_html/foo + + + + @@ -97,8 +101,5 @@ - - - diff --git a/nimdoc/test_out_index_dot_html/expected/theindex.html b/nimdoc/test_out_index_dot_html/expected/theindex.html index dcda2574c..ca7c2d7af 100644 --- a/nimdoc/test_out_index_dot_html/expected/theindex.html +++ b/nimdoc/test_out_index_dot_html/expected/theindex.html @@ -7,6 +7,10 @@ Index + + + + @@ -35,8 +39,5 @@ - - - diff --git a/nimdoc/testproject/expected/subdir/subdir_b/utils.html b/nimdoc/testproject/expected/subdir/subdir_b/utils.html index 4ddf458f2..6decf79a3 100644 --- a/nimdoc/testproject/expected/subdir/subdir_b/utils.html +++ b/nimdoc/testproject/expected/subdir/subdir_b/utils.html @@ -7,6 +7,10 @@ subdir/subdir_b/utils + + + + @@ -606,8 +610,5 @@ Ref. - - - diff --git a/nimdoc/testproject/expected/testproject.html b/nimdoc/testproject/expected/testproject.html index cd2c71227..43a72d99d 100644 --- a/nimdoc/testproject/expected/testproject.html +++ b/nimdoc/testproject/expected/testproject.html @@ -7,6 +7,10 @@ testproject + + + + @@ -1252,8 +1256,5 @@ bar - - - diff --git a/nimdoc/testproject/expected/theindex.html b/nimdoc/testproject/expected/theindex.html index 6b811f5e2..71a487e0c 100644 --- a/nimdoc/testproject/expected/theindex.html +++ b/nimdoc/testproject/expected/theindex.html @@ -7,6 +7,10 @@ Index + + + + @@ -423,8 +427,5 @@ - - - -- cgit 1.4.1-2-gfad0