|
80 | 80 | arg: string) {.closure, gcsafe.} ## what to do in case of an error |
81 | 81 | FindFileHandler* = proc (filename: string): string {.closure, gcsafe.} |
82 | 82 | FindRefFileHandler* = |
83 | | - proc (targetRelPath: string, isMarkup: bool): |
| 83 | + proc (targetRelPath: string): |
84 | 84 | tuple[targetPath: string, linkRelPath: string] {.closure, gcsafe.} |
85 | 85 | ## returns where .html or .idx file should be found by its relative path. |
86 | 86 |
|
@@ -473,7 +473,7 @@ proc defaultFindFile*(filename: string): string = |
473 | 473 | if fileExists(filename): result = filename |
474 | 474 | else: result = "" |
475 | 475 |
|
476 | | -proc defaultFindRefFile*(filename: string, isMarkup: bool): (string, string) = |
| 476 | +proc defaultFindRefFile*(filename: string): (string, string) = |
477 | 477 | (filename, "") |
478 | 478 |
|
479 | 479 | proc defaultRole(options: RstParseOptions): string = |
@@ -3499,8 +3499,7 @@ proc loadIdxFile(s: var PRstSharedState, origFilename: string) = |
3499 | 3499 | rstMessage(s.filenames, s.msgHandler, s.idxImports[origFilename].fromInfo, |
3500 | 3500 | meCannotOpenFile, origFilename & ": unknown extension") |
3501 | 3501 | let idxFilename = dir / basename & ".idx" |
3502 | | - let (idxPath, linkRelPath) = s.findRefFile( |
3503 | | - idxFilename, isMarkup = ext in [".md", ".rst"]) |
| 3502 | + let (idxPath, linkRelPath) = s.findRefFile(idxFilename) |
3504 | 3503 | s.idxImports[origFilename].linkRelPath = linkRelPath |
3505 | 3504 | var |
3506 | 3505 | fileEntries: seq[IndexEntry] |
@@ -3772,7 +3771,8 @@ proc resolveSubs*(s: PRstSharedState, n: PRstNode): PRstNode = |
3772 | 3771 | proc completePass2*(s: PRstSharedState) = |
3773 | 3772 | for (filename, importdocInfo) in s.idxImports.pairs: |
3774 | 3773 | if not importdocInfo.used: |
3775 | | - rstMessage(s, mwUnusedImportdoc, filename) |
| 3774 | + rstMessage(s.filenames, s.msgHandler, importdocInfo.fromInfo, |
| 3775 | + mwUnusedImportdoc, filename) |
3776 | 3776 |
|
3777 | 3777 | proc rstParse*(text, filename: string, |
3778 | 3778 | line, column: int, |
|
0 commit comments