From ce85b819ff63b5e9ca57dfe7d4d520851921802e Mon Sep 17 00:00:00 2001 From: Nils Lindemann Date: Mon, 27 May 2024 11:00:25 +0200 Subject: [PATCH] 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 5b902b362b..99751f79df 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 2078d208ce..32dab9216a 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 64a0f7b7e5..2946f803ab 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 d86bd1d358..1e7c9c1269 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 786de5b860..408ce2060f 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 86af18407c..cf250edd16 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 6bfc4bc793..a267041331 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 149c88a18a..659aec5e3c 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 80f09c5adf..4370f0df8a 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 dcda2574c3..ca7c2d7af8 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 4ddf458f20..6decf79a3c 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 cd2c712277..43a72d99db 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 6b811f5e27..71a487e0cf 100644 --- a/nimdoc/testproject/expected/theindex.html +++ b/nimdoc/testproject/expected/theindex.html @@ -7,6 +7,10 @@ Index + + + + @@ -423,8 +427,5 @@ - - -