Answers for "how to do a hyperlink in a readme"

1

how to automatically create hyperlink in readme

/*
Here is javascript code for automatically getting link attached to content of readme.md file.
Full Code - https://gist.github.com/SBZed/490f5d9eac525de02f610a28f0c9453c
*/

LinkHeadingToContent(headingText) {
		headingList = headingText.split('n');
		headingList.map((heading, index) => {
			const firstDigitIndex = heading.search(/d/);
			const anchorText = heading
				.toLowerCase()
				.replace(/[^a-zds]/g, '')
				.trim()
				.replace(/ /g, '-');
			headingList[index] =
				[heading.slice(0, firstDigitIndex), '[', heading.slice(firstDigitIndex)].join('') +
				'](#' +
				anchorText +
				')';
		});
  
		return headingList.join('n');
}
Posted by: Guest on March-06-2021

Code answers related to "how to do a hyperlink in a readme"

Browse Popular Code Answers by Language