##// END OF EJS Templates
help: teach loaddoc to load from a different directory...
Gregory Szorc -
r27375:c4a062d0 default
parent child Browse files
Show More
@@ -146,11 +146,13 b' def topicmatch(ui, kw):'
146 results['extensioncommands'].append((cmdname, cmddoc))
146 results['extensioncommands'].append((cmdname, cmddoc))
147 return results
147 return results
148
148
149 def loaddoc(topic):
149 def loaddoc(topic, subdir=None):
150 """Return a delayed loader for help/topic.txt."""
150 """Return a delayed loader for help/topic.txt."""
151
151
152 def loader(ui):
152 def loader(ui):
153 docdir = os.path.join(util.datapath, 'help')
153 docdir = os.path.join(util.datapath, 'help')
154 if subdir:
155 docdir = os.path.join(docdir, subdir)
154 path = os.path.join(docdir, topic + ".txt")
156 path = os.path.join(docdir, topic + ".txt")
155 doc = gettext(util.readfile(path))
157 doc = gettext(util.readfile(path))
156 for rewriter in helphooks.get(topic, []):
158 for rewriter in helphooks.get(topic, []):
General Comments 0
You need to be logged in to leave comments. Login now