question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Markdown reference links cannot be used from DFM include files

See original GitHub issue

Markdown reference links cannot be used from DFM include files

Functional impact

This is a markdown reference link: [example]: http://example.com This is a DFM include statement: [!include[links](../linksinc.md)] Currently markdown-reference-links must be used from the same md file in which they are defined.

Minimal repro steps

  1. Create a file “a.md”:
This is an [example], the last word should be a link.
[!include[links](linksinc.md)]
  1. Create a file “linksinc.md”
This is an [example], the last word should be a link.
[example]: http://example.com
  1. Include a.md into a docfx project, and build it.

Expected result

Both “[example]” sections should be found an expanded.

Actual result

Only “[example]” sections inside of linksinc.md will be expanded.

Further technical details

It seems the way the markdown engine is built, the included markdown files are being expanded separately, not allowing markdown reference links to be resolved into an include-file.

Maybe the markdown-engine not resolve markdown reference links until !include statements have merged all include files into a single unit. [This would work more like the Standard C preprocessor]

Thank you for creating Docfx, it is a awesome project!.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
vwxyzhcommented, Jan 6, 2017

@cameron-elliott If your document has many reference definition, why not use xref? e.g.: your article is:

Content is: [Intel Quick Sync Video][Intel_Quick_Sync_Video] and [Intel HD and Iris Graphics][Intel_HD_and_Iris_Graphics]

[Intel_Quick_Sync_Video]: https://en.wikipedia.org/wiki/Intel_Quick_Sync_Video
[Intel_HD_and_Iris_Graphics]: https://en.wikipedia.org/wiki/Intel_HD_and_Iris_Graphics
  1. Create an xref map file:
    ### YamlMime:XRefMap
    hrefUpdated: true
    references:
    - uid: Intel_Quick_Sync_Video
      name: "Intel Quick Sync Video"
      href: https://en.wikipedia.org/wiki/Intel_Quick_Sync_Video
    - uid: Intel_HD_and_Iris_Graphics
      name: "Intel HD and Iris Graphics"
      href: https://en.wikipedia.org/wiki/Intel_HD_and_Iris_Graphics
    
  2. then update your article:
    Content is: @Intel_Quick_Sync_Video and @Intel_HD_and_Iris_Graphics
    
  3. final, update your docfx.json, add the path of xref map in “xref”, or use command line option -x
0reactions
weitzhandlercommented, May 2, 2023

A bit related: #8712.

Read more comments on GitHub >

github_iconTop Results From Across the Web

docfx Shared Content between Markdown Files
In DocFX, I have a block of content which i need to put on all (or most) markdown files. Is there a way...
Read more >
Links and Cross References | docfx
Conceptual Markdown file doesn't have UID generated by default. So it cannot be cross referenced unless you give it a UID. Different syntax...
Read more >
DocFX Flavored Markdown
Cross reference allows you to link to another topic by using its unique identifier (called UID) instead of using its file path. For...
Read more >
Contributing to the DataMiner docs
To avoid adding duplicate information, use cross-references to refer to information that is already available in the documentation. When you add a cross- ......
Read more >
Contributing documentation - Azure Quantum
Learn how to contribute conceptual or API content to the Azure Quantum documentation set.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found