Show More
@@ -30,10 +30,19 b' def role_hg(name, rawtext, text, lineno,' | |||||
30 | linktext = nodes.literal(rawtext, text) |
|
30 | linktext = nodes.literal(rawtext, text) | |
31 | parts = text.split() |
|
31 | parts = text.split() | |
32 | cmd, args = parts[1], parts[2:] |
|
32 | cmd, args = parts[1], parts[2:] | |
|
33 | refuri = "hg.1.html#%s" % cmd | |||
33 | if cmd == 'help' and args: |
|
34 | if cmd == 'help' and args: | |
34 | cmd = args[0] # link to 'dates' for 'hg help dates' |
|
35 | if args[0] == 'config': | |
|
36 | # :hg:`help config` | |||
|
37 | refuri = "hgrc.5.html" | |||
|
38 | elif len(args) >= 2 and args[0] == '-c': | |||
|
39 | # :hg:`help -c COMMAND ...` is equivalent to :hg:`COMMAND` | |||
|
40 | # (mainly for :hg:`help -c config`) | |||
|
41 | refuri = "hg.1.html#%s" % args[1] | |||
|
42 | else: | |||
|
43 | refuri = "hg.1.html#%s" % args[0] | |||
35 | node = nodes.reference(rawtext, '', linktext, |
|
44 | node = nodes.reference(rawtext, '', linktext, | |
36 |
refuri= |
|
45 | refuri=refuri) | |
37 | return [node], [] |
|
46 | return [node], [] | |
38 |
|
47 | |||
39 | roles.register_local_role("hg", role_hg) |
|
48 | roles.register_local_role("hg", role_hg) |
General Comments 0
You need to be logged in to leave comments.
Login now