Yard relative link to extra file

626 views Asked by At

I want to link to another extra file from my README using Yard.

For example, I have the following line:

    ...detailed instructions [here](contributing.md) on how to contribute

I want this to link to my file contributing.md in the same directory. I can include the extra file in my .yardopts file, and it will show up in the file list as it should.

So then I found that I can use the yard DSL to make the link work:

    ...detailed instructions {file:contributing.md here} on how to contribute

However this will not work if the README is being read from Github. Am I naive to want to have it both ways?

Is there a way to link to another .md extra file in markdown using Yard?

1

There are 1 answers

1
Axe On

I am not sure what you mean with 'if the README is being read from Github'.

The following works for me locally

  1. I add a file to the README via {file:my_file.md test}
  2. I tell yard via the --files command-line option that there is an extra file. The link to 'test' appears in the README. For example in the following way:
bundle exec yard --files my_file.md