From 22c6756ce01ba5d69bf51a17090375068f38b848 Mon Sep 17 00:00:00 2001 From: BruebachL <44814898+BruebachL@users.noreply.github.com> Date: Tue, 30 Sep 2025 11:45:49 +0200 Subject: [PATCH] [Doxygen] Layout adjustments (#6196) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Layout adjustments. Took 1 hour 54 minutes Took 2 minutes Took 6 minutes * Remove the empty building page. Took 7 minutes * Change to @page Took 11 minutes * Change to @page again Took 52 seconds * Change to @page again again Took 2 minutes * Fence the page declaration in CONTRIBUTING.md Took 8 minutes --------- Co-authored-by: Lukas BrĂ¼bach --- .github/CONTRIBUTING.md | 2 + Doxyfile | 12 +- DoxygenLayout.xml | 271 ++++++++++++++++++ cockatrice/resources/help/deck_search.md | 2 + cockatrice/resources/help/search.md | 2 + cockatrice/src/filters/syntax_help.cpp | 5 +- .../developer_documentation/index.md | 3 + doc/doxygen-extra-pages/index.md | 8 + .../user_documentation/index.md | 4 + 9 files changed, 302 insertions(+), 7 deletions(-) create mode 100644 DoxygenLayout.xml create mode 100644 doc/doxygen-extra-pages/developer_documentation/index.md create mode 100644 doc/doxygen-extra-pages/index.md create mode 100644 doc/doxygen-extra-pages/user_documentation/index.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 10ffa3493..ffde66d7b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,3 +1,5 @@ + +   [Introduction](#contributing-to-cockatrice) | [Code Style Guide]( #code-style-guide) | [Translations](#translations) | [Release Management]( #release-management) diff --git a/Doxyfile b/Doxyfile index e36f0d70d..51813aad5 100644 --- a/Doxyfile +++ b/Doxyfile @@ -48,7 +48,7 @@ PROJECT_NAME = "Cockatrice" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = +PROJECT_NUMBER = 2.11 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewers a @@ -61,13 +61,13 @@ PROJECT_BRIEF = # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. -PROJECT_LOGO = +PROJECT_LOGO = cockatrice/resources/cockatrice.png # With the PROJECT_ICON tag one can specify an icon that is included in the tabs # when the HTML document is shown. Doxygen will copy the logo to the output # directory. -PROJECT_ICON = +PROJECT_ICON = cockatrice/resources/cockatrice.png # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is @@ -839,7 +839,7 @@ FILE_VERSION_FILTER = # DoxygenLayout.xml, Doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. -LAYOUT_FILE = +LAYOUT_FILE = DoxygenLayout.xml # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib @@ -991,7 +991,7 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = cockatrice common +INPUT = .github/CONTRIBUTING.md cockatrice common doc/doxygen-extra-pages # This tag can be used to specify the character encoding of the source files # that Doxygen parses. Internally Doxygen uses the UTF-8 encoding. Doxygen uses @@ -1749,7 +1749,7 @@ ECLIPSE_DOC_ID = org.doxygen.Project # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. -DISABLE_INDEX = NO +DISABLE_INDEX = YES # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. If the tag diff --git a/DoxygenLayout.xml b/DoxygenLayout.xml new file mode 100644 index 000000000..d6847755b --- /dev/null +++ b/DoxygenLayout.xml @@ -0,0 +1,271 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cockatrice/resources/help/deck_search.md b/cockatrice/resources/help/deck_search.md index 95c237b16..6d58ee590 100644 --- a/cockatrice/resources/help/deck_search.md +++ b/cockatrice/resources/help/deck_search.md @@ -1,3 +1,5 @@ +@page deck_search_syntax_help Deck Search Syntax Help + ## Deck Search Syntax Help ----- The search bar recognizes a set of special commands.
diff --git a/cockatrice/resources/help/search.md b/cockatrice/resources/help/search.md index 7d707b0d1..3b3f0cc93 100644 --- a/cockatrice/resources/help/search.md +++ b/cockatrice/resources/help/search.md @@ -1,3 +1,5 @@ +@page search_syntax_help Search Syntax Help + ## Search Syntax Help ----- The search bar recognizes a set of special commands similar to some other card databases.
diff --git a/cockatrice/src/filters/syntax_help.cpp b/cockatrice/src/filters/syntax_help.cpp index 9fb918629..fa5338a41 100644 --- a/cockatrice/src/filters/syntax_help.cpp +++ b/cockatrice/src/filters/syntax_help.cpp @@ -22,8 +22,11 @@ static QTextBrowser *createBrowser(const QString &helpFile) QString text = in.readAll(); file.close(); - // Poor Markdown Converter + // --- Remove @page declarations at the top of the file --- auto opts = QRegularExpression::MultilineOption; + text = text.replace(QRegularExpression(R"(^\s*@page[^\n]*\n)", opts), ""); + + // Poor Markdown Converter text = text.replace(QRegularExpression("^(###)(.*)", opts), "

\\2

") .replace(QRegularExpression("^(##)(.*)", opts), "

\\2

") .replace(QRegularExpression("^(#)(.*)", opts), "

\\2

") diff --git a/doc/doxygen-extra-pages/developer_documentation/index.md b/doc/doxygen-extra-pages/developer_documentation/index.md new file mode 100644 index 000000000..121ee7c6f --- /dev/null +++ b/doc/doxygen-extra-pages/developer_documentation/index.md @@ -0,0 +1,3 @@ +@page developer_reference Developer Reference + +- [Contributing](@subpage contributing) diff --git a/doc/doxygen-extra-pages/index.md b/doc/doxygen-extra-pages/index.md new file mode 100644 index 000000000..66113117f --- /dev/null +++ b/doc/doxygen-extra-pages/index.md @@ -0,0 +1,8 @@ +@mainpage Cockatrice Documentation + +# Welcome + +This is the **main landing page** of the Cockatrice documentation. + +- Go to the @subpage user_reference page +- Or check out the @subpage developer_reference \ No newline at end of file diff --git a/doc/doxygen-extra-pages/user_documentation/index.md b/doc/doxygen-extra-pages/user_documentation/index.md new file mode 100644 index 000000000..97c6f375c --- /dev/null +++ b/doc/doxygen-extra-pages/user_documentation/index.md @@ -0,0 +1,4 @@ +@page user_reference User Reference + +@subpage search_syntax_help +@subpage deck_search_syntax_help \ No newline at end of file