diff --git a/docs/_static/custom.css b/docs/_static/custom.css new file mode 100644 index 0000000..3aab610 --- /dev/null +++ b/docs/_static/custom.css @@ -0,0 +1,146 @@ +/* Custom CSS for MarkDiffusion Documentation */ + +/* Increase sidebar width and ensure no gap */ +.wy-nav-side { + width: 350px !important; + left: 0 !important; +} + +/* Ensure sidebar top section (purple area) matches width */ +.wy-side-nav-search { + width: 350px !important; + box-sizing: border-box !important; + margin: 0 !important; + padding: 1.618em !important; +} + +/* Ensure menu items match sidebar width */ +.wy-menu.wy-menu-vertical { + width: 350px !important; + box-sizing: border-box !important; + margin: 0 !important; + padding: 0 !important; +} + +/* Ensure highlighted/current items fill the width */ +.wy-menu-vertical li.current { + width: 350px !important; +} + +.wy-menu-vertical li.current > a { + width: 100% !important; + box-sizing: border-box !important; +} + +/* Hide sidebar scrollbar and prevent it from taking space */ +.wy-side-scroll { + overflow-y: scroll !important; + scrollbar-width: none !important; /* Firefox */ + -ms-overflow-style: none !important; /* IE and Edge */ + width: 100% !important; +} + +.wy-side-scroll::-webkit-scrollbar { + display: none !important; /* Chrome, Safari and Opera */ + width: 0 !important; + height: 0 !important; +} + +/* Ensure the navigation container fills the entire sidebar */ +.wy-side-nav-search, +.wy-menu.wy-menu-vertical { + overflow-x: hidden !important; +} + +/* Adjust content area to accommodate wider sidebar */ +.wy-nav-content-wrap { + margin-left: 350px !important; +} + +/* Increase max width of content area to use more screen space */ +.wy-nav-content { + max-width: 1200px !important; +} + +/* Make the overall page wider on large screens */ +@media screen and (min-width: 1400px) { + .wy-nav-side { + width: 380px !important; + left: 0 !important; + } + + .wy-side-nav-search { + width: 380px !important; + box-sizing: border-box !important; + } + + .wy-menu.wy-menu-vertical { + width: 380px !important; + box-sizing: border-box !important; + } + + .wy-menu-vertical li.current { + width: 380px !important; + } + + .wy-nav-content-wrap { + margin-left: 380px !important; + } + + .wy-nav-content { + max-width: 1400px !important; + } +} + +/* Ensure sidebar text wraps properly with the increased width */ +.wy-menu-vertical li.toctree-l1 > a, +.wy-menu-vertical li.toctree-l2 > a, +.wy-menu-vertical li.toctree-l3 > a { + white-space: normal !important; + line-height: 1.4 !important; + padding: 0.4045em 1.618em !important; + width: 100% !important; + box-sizing: border-box !important; +} + +/* Add slight padding to long navigation items */ +.wy-menu-vertical li.current > a { + padding: 0.4045em 1.618em !important; + width: 100% !important; + box-sizing: border-box !important; +} + +/* Ensure all list items fill the width */ +.wy-menu-vertical li { + width: 100% !important; +} + +/* Ensure current item background fills the width */ +.wy-menu-vertical li.current > a, +.wy-menu-vertical li.on a, +.wy-menu-vertical li.current > a:hover, +.wy-menu-vertical li.on a:hover { + background: #e3e3e3 !important; + width: 100% !important; + box-sizing: border-box !important; +} + +/* Ensure nested menu items also fill width */ +.wy-menu-vertical ul { + width: 100% !important; +} + +.wy-menu-vertical ul li a { + width: 100% !important; + box-sizing: border-box !important; +} + +/* Remove purple color from visited links in content area */ +.wy-nav-content a:visited { + color: #2980B9 !important; +} + +.wy-nav-content a:link { + color: #2980B9 !important; +} + diff --git a/docs/conf.py b/docs/conf.py index 9f4b19c..f234ec9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -80,6 +80,11 @@ # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] +# Custom CSS files +html_css_files = [ + 'custom.css', +] + # Custom sidebar templates, must be a dictionary that maps document names # to template names. html_sidebars = { diff --git a/docs/index.rst b/docs/index.rst index 0ca7264..2b5f4cc 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -17,10 +17,6 @@ MarkDiffusion Documentation :target: https://colab.research.google.com/drive/1N1C9elDAB5zwF4FxKKYMCqR3eSpCSqAW?usp=sharing :alt: Colab -.. image:: https://img.shields.io/badge/Readthedocs-%2300A89C?style=for-the-badge&logo=readthedocs&logoColor=%238CA1AF - :target: https://markdiffusion.readthedocs.io - :alt: DOC - .. image:: https://img.shields.io/badge/PYPI-%23193440?style=for-the-badge&logo=pypi&logoColor=%233775A9 :target: https://pypi.org/project/markdiffusion :alt: PYPI @@ -64,15 +60,20 @@ Key Features :width: 100% :align: center +| +| A Quick Example of Generating and Detecting Watermarked Image via MarkDiffusion Toolkit ---------------- +----------------------------------------------------------------------------------------- .. image:: ../img/A_Quick_Example.png :alt: A quick example of generating and detecting watermarked image via MarkDiffusion toolkit :width: 100% :align: center +| +| + Documentation Contents ---------------------- @@ -84,7 +85,7 @@ Documentation Contents .. toctree:: :maxdepth: 2 - :caption: Background Information and + :caption: Background Info & Detailed Guidance user_guide/algorithms @@ -117,10 +118,4 @@ Documentation Contents citation resources -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/docs/quickstart.rst b/docs/quickstart.rst index fa11df9..a608a7f 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -1,15 +1,14 @@ -Quick Start -=========== +.. _quickstart: Google Colab Demo ------------------ +================= If you're interested in trying out MarkDiffusion without installing anything, you can use `Google Colab `_ to see how it works. Installation ------------- +============ **(Recommended)** We released PyPI package for MarkDiffusion. You can install it directly with pip: @@ -35,7 +34,7 @@ conda-forge package, which can be installed with the following commands: be included in the release. You will need to install those separately if necessary. How to Use the Toolkit ----------------------- +====================== After installation, there are two ways to use MarkDiffusion: @@ -148,7 +147,7 @@ via the markdiffusion library—please review it for guidance. Here's a quick ex print(detection_result) Next Steps ----------- +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Now that you're familiar with the basics, explore more: diff --git a/docs/test_system/comprehensive_test.rst b/docs/test_system/comprehensive_test.rst index 79d5569..b650158 100644 --- a/docs/test_system/comprehensive_test.rst +++ b/docs/test_system/comprehensive_test.rst @@ -7,8 +7,8 @@ This comprehensive test module is located in the ``test/`` directory. Test Coverage Statistics ------------------------ -- **Total Test Cases**: 454 unit tests -- **Code Coverage**: Approximately 90% +- **Total Test Cases**: 658 unit tests +- **Code Coverage**: Approximately 95% - **Coverage Scope**: Nearly all functional modules - **Uncovered Code**: Primarily exception handling and edge case logic @@ -19,8 +19,6 @@ Test Structure The test suite is organized into several test files: -Core Functionality Tests -~~~~~~~~~~~~~~~~~~~~~~~~ **test_watermark_algorithms.py** Tests for initialization, generation, detection, inversion, and visualization of all watermark algorithms. @@ -31,9 +29,6 @@ Core Functionality Tests **test_dataset.py** Tests for dataset classes (StableDiffusionPromptsDataset, MSCOCODataset, VBenchDataset). -Utility and Module Tests -~~~~~~~~~~~~~~~~~~~~~~~~~ - **test_utils.py** Tests for utility functions used throughout the toolkit. @@ -46,6 +41,9 @@ Utility and Module Tests **test_video_editor.py** Tests for video editing modules. +**test_edge_cases.py** + Tests for some edge cases. + Running the Tests -----------------