Skip to content
Snippets Groups Projects
Commit 606e71d3 authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix some issues in htools apidoc generation


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).

Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 48f12e73
No related branches found
No related tags found
No related merge requests found
......@@ -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 ; \
......
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment