How to link to a section within Readme.md file

Introduction

Many markdown files, especially readme files on Github and other sites have links in them that allow you to click and jump to sections within the file.
Read along to learn how to create one yourself with an example of

Steps with example

Click here → Footer to see the link in action to jump to footer section

  • Create a Footer section in your readme file using ### Footer
  • Now create a link to the above section by writing [Footer](#footer) in your readme file
    • Use standard markdown links [link text](link-url) to encode the link
      • The link-url should begin with #
        • Add only one # in the link even if in the actual section there are more
        • Write the Section Text that you wish to link to, in this case its Footer
          • Remove
            • All leading and trailing whitespace
            • Punctuation
          • Replace
            • whitespace in between to -
            • All Uppercase to lowercase

View markdown file example on Github

This is demo footer section with some example sections to demonstrate links

Credits

Based on answers from Stackoverflow

Leave a Reply

Your email address will not be published. Required fields are marked *