diff --git a/buildingspy/CHANGES.txt b/buildingspy/CHANGES.txt
index 5902251..48feed5 100644
--- a/buildingspy/CHANGES.txt
+++ b/buildingspy/CHANGES.txt
@@ -3,6 +3,7 @@ BuildingsPy Changelog
 
 Version 2.0.0, xxx
 ^^^^^^^^^^^^^^^^^^
+- Added handling of library specific comments in buildingspy.development.merger
 - Improved error reporting when running regression tests in batch mode.
 - Corrected bug when creating and then renaming a package with
   buildingspy.development.refactor
diff --git a/buildingspy/development/merger.py b/buildingspy/development/merger.py
index 9634351..16aa579 100755
--- a/buildingspy/development/merger.py
+++ b/buildingspy/development/merger.py
@@ -130,16 +130,57 @@ class IBPSA(object):
             :param rep: Dictionary where each key is the string to be replaced in the new file with its value.
         """
         from collections import OrderedDict
+
+        lines = list()
         with open(src, mode="r", encoding="utf-8-sig") as f_sou:
-            lines = list()
             for _, lin in enumerate(f_sou):
                 for ori, new in list(rep.items()):
                     lin = lin.replace(ori, new)
                 lines.append(lin)
+        # Remove library specific documentation.
+        lines = self.remove_library_specific_documentation(lines, self._new_library_name)
         # Write the lines to the new file
         with open(des, mode="w", encoding="utf-8") as f_des:
             f_des.writelines(lines)
 
+    @staticmethod
+    def remove_library_specific_documentation(file_lines, library_name):
+        """ Remove library specific content.
+
+            For example, for the `Buildings` and `IDEAS` libraries, include the
+            section in the commented block below, but keep the comment as an html-comment
+            for other libraries.
+
+            .. code-block:: html
+
+               <!-- @include_Buildings @include_IDEAS
+               some documentation to be used for
+               Buildings and IDEAS library only.
+               -->
+
+        :param file_lines: The lines of the file to be merged.
+        :return: The lines of the files, with comments removed as indicated by the tag(s) in the comment line.
+        """
+
+        lines = list()
+        pattern_start = "<!--"
+        library_token = "@include_{}".format(library_name)
+        pattern_end = "-->"
+        search_start = True
+        for lin in file_lines:
+            if search_start and pattern_start in lin and library_token in lin:
+                # Found the start of the commented section for this library.
+                # Remove this line
+                search_start = False
+            elif (not search_start) and pattern_end in lin:
+                # Found the end of the line
+                # Reove this line
+                search_start = True
+            else:
+                lines.append(lin)
+
+        return lines
+
     @staticmethod
     def filter_files(file_list, pattern):
         """

add handling of library-specific comments
This issue is to handle library specific comments of the form
```
 <!-- @include_Buildings @include_IDEAS
  some documentation to be used for Buildings and IDEAS library only, but
  remain in comments for other libraries.
  -->
```
This is to support https://github.com/ibpsa/modelica-ibpsa/pull/1144#issuecomment-497139134
diff --git a/buildingspy/tests/test_development_merger.py b/buildingspy/tests/test_development_merger.py
index 9c4e8dc..7fc5ed9 100644
--- a/buildingspy/tests/test_development_merger.py
+++ b/buildingspy/tests/test_development_merger.py
@@ -68,6 +68,37 @@ class Test_development_merger_IBPSA(unittest.TestCase):
         # Test packages that do exist
         m.IBPSA(self._ibpsa_dir, self._dest_dir)
 
+    def test_remove_library_specific_documentation(self):
+        import buildingspy.development.merger as m
+
+        lines = ["aaa", "bbb", "<!-- @include_Buildings", "ccc", "-->", "ddd"]
+        result = ["aaa", "bbb", "ccc", "ddd"]
+        self.assertEqual(result,
+                         m.IBPSA.remove_library_specific_documentation(lines, "Buildings"),
+                         "Test one library")
+
+        lines[2] = "<!-- @include_Buildings @include_aaa"
+        self.assertEqual(result,
+                         m.IBPSA.remove_library_specific_documentation(lines, "Buildings"),
+                         "Test multiple libraries")
+
+        lines[2] = "<!-- @include_aaa @include_Buildings"
+        self.assertEqual(result,
+                         m.IBPSA.remove_library_specific_documentation(lines, "Buildings"),
+                         "Test multiple libraries reverse")
+
+        lines[2] = " <!--  @include_Buildings"
+        self.assertEqual(result,
+                         m.IBPSA.remove_library_specific_documentation(lines, "Buildings"),
+                         "Test with spaces")
+
+        lines[2] = "<!--"
+        result = ["aaa", "bbb", "<!--", "ccc", "-->", "ddd"]
+        self.assertEqual(result,
+                         m.IBPSA.remove_library_specific_documentation(lines, "Buildings"),
+                         "Test without removing")
+        return
+
     def test_merge(self):
         """Test merging the libraries
         """

pip install -e .[dev]
parse_log_pytest
pytest
pytest
apt-get update apt-get install -y gcc tidy
3.6
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs @ file:///opt/conda/conda-bld/attrs_1642510447205/work
-e git+https://github.com/lbl-srg/BuildingsPy.git@9ff3adb370d0be61710cd556cb9b0bc7c274941a#egg=buildingspy
certifi==2021.5.30
future==1.0.0
gitdb==4.0.9
GitPython==3.1.18
importlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1631916693255/work
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
Jinja2==3.0.3
MarkupSafe==2.0.1
more-itertools @ file:///tmp/build/80754af9/more-itertools_1637733554872/work
packaging @ file:///tmp/build/80754af9/packaging_1637314298585/work
pluggy @ file:///tmp/build/80754af9/pluggy_1615976315926/work
py @ file:///opt/conda/conda-bld/py_1644396412707/work
pyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work
pytest==6.2.4
pytidylib==0.3.2
smmap==5.0.0
toml @ file:///tmp/build/80754af9/toml_1616166611790/work
typing_extensions @ file:///opt/conda/conda-bld/typing_extensions_1647553014482/work
zipp @ file:///tmp/build/80754af9/zipp_1633618647012/work

name: BuildingsPy
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - attrs=21.4.0=pyhd3eb1b0_0
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - importlib-metadata=4.8.1=py36h06a4308_0
  - importlib_metadata=4.8.1=hd3eb1b0_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - more-itertools=8.12.0=pyhd3eb1b0_0
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - packaging=21.3=pyhd3eb1b0_0
  - pip=21.2.2=py36h06a4308_0
  - pluggy=0.13.1=py36h06a4308_0
  - py=1.11.0=pyhd3eb1b0_0
  - pyparsing=3.0.4=pyhd3eb1b0_0
  - pytest=6.2.4=py36h06a4308_2
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - toml=0.10.2=pyhd3eb1b0_0
  - typing_extensions=4.1.1=pyh06a4308_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zipp=3.6.0=pyhd3eb1b0_0
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - future==1.0.0
      - gitdb==4.0.9
      - gitpython==3.1.18
      - jinja2==3.0.3
      - markupsafe==2.0.1
      - pytidylib==0.3.2
      - smmap==5.0.0
prefix: /opt/conda/envs/BuildingsPy

buildingspy/tests/test_development_merger.py::Test_development_merger_IBPSA::test_remove_library_specific_documentation
buildingspy/tests/test_development_merger.py::Test_development_merger_IBPSA::test_initialize buildingspy/tests/test_development_merger.py::Test_development_merger_IBPSA::test_merge
buildingspy/development/merger.py buildingspy/CHANGES.txt
buildingspy/development/merger.py buildingspy/CHANGES.txt