First, auto-generated files were not processed if HsColour thus the
'source' link in Haddock documentation was dangling.
Second, we document the original Python constant name in the
Ganeti.Constants source, so that it's easily retrievable (as opposed
to undoing the name transformation).
---
Makefile.am | 2 +-
autotools/convert-constants | 4 ++++
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 7d3dfde..6f93423 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1107,7 +1107,7 @@ hs-apidoc: $(HS_BUILT_SRCS)
then OPTGHC="--optghc=$(HTOOLS_NOCURL)"; \
else OPTGHC=""; \
fi; \
- RELSRCS="$(HS_LIB_SRCS:htools/%=%)"; \
+ RELSRCS="$(HS_LIB_SRCS:htools/%=%) $(HS_BUILT_SRCS:htools/%=%)"; \
for file in $$RELSRCS; do \
hfile=`echo $$file|sed 's/\\.hs$$//'`.html; \
$(HSCOLOUR) -css -anchor $$file > ../$(APIDOC_HS_DIR)/$$hfile ;
\
diff --git a/autotools/convert-constants b/autotools/convert-constants
index ddca1fc..3f2b362 100755
--- a/autotools/convert-constants
+++ b/autotools/convert-constants
@@ -60,15 +60,19 @@ def Convert():
if not CONSTANT_RE.match(name):
lines.append("-- Skipped %s, not constant" % name)
elif isinstance(value, basestring):
+ lines.append("-- | Converted from Python constant %s" % name)
lines.append("%s :: String" % hs_name)
lines.append("%s = \"%s\"" % (hs_name, StringValueRules(value)))
elif isinstance(value, int):
+ lines.append("-- | Converted from Python constant %s" % name)
lines.append("%s :: Int" % hs_name)
lines.append("%s = %d" % (hs_name, value))
elif isinstance(value, long):
+ lines.append("-- | Converted from Python constant %s" % name)
lines.append("%s :: Integer" % hs_name)
lines.append("%s = %d" % (hs_name, value))
elif isinstance(value, float):
+ lines.append("-- | Converted from Python constant %s" % name)
lines.append("%s :: Double" % hs_name)
lines.append("%s = %f" % (hs_name, value))
else:
--
1.7.5.4