Index: gtkdoc-mkdb.in
===================================================================
--- gtkdoc-mkdb.in	(revision 495)
+++ gtkdoc-mkdb.in	(working copy)
@@ -460,7 +499,7 @@
 
 		if ($signals_synop ne '') {
 		    $signals_synop = <<EOF;
-<refsect1 role="signal_proto">
+<refsect1 id="$section_id.signals" role="signal_proto">
 <title role="signal_proto.title">Signals</title>
 <synopsis>
 
@@ -468,7 +507,7 @@
 </refsect1>
 EOF
 		    $signals_desc  = <<EOF;
-<refsect1 role="signals">
+<refsect1 id="$section_id.signal-details" role="signals">
 <title role="signals.title">Signal Details</title>
 $signals_desc
 </refsect1>
@@ -477,7 +516,7 @@
 
 		if ($args_synop ne '') {
 		    $args_synop = <<EOF;
-<refsect1 role="properties">
+<refsect1 id="$section_id.properties" role="properties">
 <title role="properties.title">Properties</title>
 <synopsis>
 
@@ -485,7 +524,7 @@
 </refsect1>
 EOF
 		    $args_desc  = <<EOF;
-<refsect1 role="property_details">
+<refsect1 id="$section_id.property-details" role="property_details">
 <title role="property_details.title">Property Details</title>
 $args_desc
 </refsect1>
@@ -494,7 +533,7 @@
 
 		if ($child_args_synop ne '') {
 		    $args_synop .= <<EOF;
-<refsect1 role="child_properties">
+<refsect1 id="$section_id.child-properties" role="child_properties">
 <title role="child_properties.title">Child Properties</title>
 <synopsis>
 
@@ -502,7 +541,7 @@
 </refsect1>
 EOF
 		    $args_desc .= <<EOF;
-<refsect1 role="child_property_details">
+<refsect1 id="$section_id.child-property-details" role="child_property_details">
 <title role="child_property_details.title">Child Property Details</title>
 $child_args_desc
 </refsect1>
@@ -511,7 +550,7 @@
 
 		if ($style_args_synop ne '') {
 		    $args_synop .= <<EOF;
-<refsect1 role="style_properties">
+<refsect1 id="$section_id.style-properties" role="style_properties">
 <title role="style_properties.title">Style Properties</title>
 <synopsis>
 
@@ -519,7 +558,7 @@
 </refsect1>
 EOF
 		    $args_desc .= <<EOF;
-<refsect1 role="style_properties_details">
+<refsect1 id="$section_id.style-property-details" role="style_properties_details">
 <title role="style_properties_details.title">Style Property Details</title>
 $style_args_desc
 </refsect1>
@@ -528,7 +567,7 @@
 
 		if ($hierarchy ne "") {
 		    $hierarchy = <<EOF;
-<refsect1 role="object_hierarchy">
+<refsect1 id="$section_id.object-hierarchy" role="object_hierarchy">
 <title role="object_hierarchy.title">Object Hierarchy</title>
 $hierarchy
 </refsect1>
@@ -537,7 +576,7 @@
 
 		if ($interfaces ne "") {
 		    $interfaces = <<EOF;
-<refsect1 role="impl_interfaces">
+<refsect1 id="$section_id.implemented-interfaces" role="impl_interfaces">
 <title role="impl_interfaces.title">Implemented Interfaces</title>
 $interfaces
 </refsect1>
@@ -546,7 +585,7 @@
 
 		if ($implementations ne "") {
 		    $implementations = <<EOF;
-<refsect1 role="implementations">
+<refsect1 id="$section_id.implementations" role="implementations">
 <title role="implementations.title">Known Implementations</title>
 $implementations
 </refsect1>
@@ -555,7 +594,7 @@
 
 		if ($prerequisites ne "") {
 		    $prerequisites = <<EOF;
-<refsect1 role="prerequisites">
+<refsect1 id="$section_id.prerequisites" role="prerequisites">
 <title role="prerequisites.title">Prerequisites</title>
 $prerequisites
 </refsect1>
@@ -564,7 +603,7 @@
 
 		if ($derived ne "") {
 		    $derived = <<EOF;
-<refsect1 role="derived_interfaces">
+<refsect1 id="$section_id.derived-interfaces" role="derived_interfaces">
 <title role="derived_interfaces.title">Known Derived Interfaces</title>
 $derived
 </refsect1>
@@ -1566,7 +1605,7 @@
 #	print "Found see_also: $see_also";
     }
     if ($see_also) {
-	$see_also = "<refsect1>\n<title>See Also</title>\n$see_also\n</refsect1>\n";
+	$see_also = "<refsect1 id=\"$section_id.see-also\">\n<title>See Also</title>\n$see_also\n</refsect1>\n";
     }
     my $stability = $SymbolDocs{"$TMPL_DIR/$file:Stability_Level"};
     if (!defined ($stability) || $stability =~ m/^\s*$/) {
@@ -1576,9 +1615,9 @@
 #	print "Found stability: $stability";
     }
     if ($stability) {
-	$stability = "<refsect1>\n<title>Stability Level</title>\n$stability, unless otherwise indicated\n</refsect1>\n";
+	$stability = "<refsect1 id=\"$section_id.stability-level\">\n<title>Stability Level</title>\n$stability, unless otherwise indicated\n</refsect1>\n";
     } elsif ($DEFAULT_STABILITY) {
-	$stability = "<refsect1>\n<title>Stability Level</title>\n$DEFAULT_STABILITY, unless otherwise indicated\n</refsect1>\n";
+	$stability = "<refsect1 id=\"$section_id.stability-level\">\n<title>Stability Level</title>\n$DEFAULT_STABILITY, unless otherwise indicated\n</refsect1>\n";
     }
 
     my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
@@ -1634,7 +1673,7 @@
 <!--[<xref linkend="desc" endterm="desc.title"/>]-->
 </refnamediv>
 $stability
-<refsynopsisdiv role="synopsis">
+<refsynopsisdiv id="$section_id.synopsis" role="synopsis">
 <title role="synopsis.title">Synopsis</title>
 $object_anchors
 <synopsis>
@@ -1652,12 +1691,12 @@
 $$args_synop
 $$signals_synop
 
-<refsect1 role="desc">
+<refsect1 id="$section_id.description" role="desc">
 <title role="desc.title">Description</title>
 $long_desc
 </refsect1>
 
-<refsect1 role="details">
+<refsect1 id="$section_id.details" role="details">
 <title role="details.title">Details</title>
 $$details
 </refsect1>
