Closed leiwu84 closed 1 week ago
Thanks for filing this issue.
Yes, for now, the cross-reference resolution with the right tag is not supported across pages.
It should, however, be possible to do.
Can you elaborate more on the expected outcome? Should it somehow be accounted that, e.g., the table is on another page?
Thanks for the quick response. I just updated the description above. In short, is it possible to automatically generate the reference text like <Page Name>/<Table Number>
, like Tables/Table 1
? The <Page Name>
is defined in the mkdocs.yml file, nav section.
Sorry it took so long ... I finally had some spare time to give your request/idea a shot.
I created a draft here, #18. It's not finished, as I have not adapted the tests yet, and I want to allow this feature to be customizable through the config. (I also expect that there are a few subtle issues, e.g if no page title is defined)
Could you give it a try and give me some feedback?
I will try to finish up the PR in the upcoming week.
Hi @tobiasah , thanks a lot for creating this feature. I have tested on my laptop, it works perfectly.
@leiwu84, thanks for the feedback. I fixed the remaining issues and merged the change. It has already been released with 1.2.0
FYI, in case you want to change the link text, you can use the cross_reference_text
config field: https://tobiasah.github.io/mkdocs-caption/config/#default
I have defined a table in the
table.md
file, this tool will automatically assign a number to this table, e.g. Table 1. If I refer it in the same file, the reference text will showTable 1
. However, if I reference it in another filetext.md
, thenTable 1
is not shown. Is it possible to automatically generate the reference text like<Page Name>/<Table Number>
, likeTables/Table 1
? The<Page Name>
is defined in themkdocs.yml
file,nav
section.Here is an complete example.
Structure
index.md
file.table.md
file.Here
Table 1
is shown at the reference place as expected.text.md
file.Here
Table 1
is not shown at the reference place. I would like to see something likeTable/Table 1
. The firstTable
is the page namemkdocs.yml
file