GitHub MarkDown: Are Macros and Variables possible?

孤人 提交于 2019-12-03 04:15:16

Below are a few ways to write Reference-Links

[I'm an inline-style link](https://www.somewebsite.com)

[I'm an inline-style link with title](https://www.somewebsite.com "somewebsite's Homepage")

[I'm a reference-style link][Arbitrary case-insensitive reference text]

[I'm a relative reference to a repository file](../blob/master/LICENSE)

[You can use numbers for reference-style link definitions][1]

Or leave it empty and use the [link text itself]

Some text to show that the reference links can follow later.

[arbitrary case-insensitive reference text]: https://www.somewebsite.org
[1]: http://somewebsite.org
[link text itself]: http://www.somewebsite.com

You can use a feature of Markdown called "Reference-style links".

[link text][id] or just [link text] if link-text is unique and consist only of letters, numbers, spaces and punctuation. They are not case sensitive.

then somewhere in the document you define what id is:

[id]: http://example.com/whatever

See https://github.com/biserkov/markdown-playground/blob/master/README.md and

https://raw.githubusercontent.com/biserkov/markdown-playground/master/README.md

GitHub Markdown (for .md files) has variables through capture:

{% capture nameOfVariableToCapture %}any markdown here...{% endcapture %}

{{ nameOfVariableToCapture }} -- that prints the content of the variable

or from {% assign variableName = "text etc." %}.

As a test, I created https://github.com/SeLite/SeLite.github.io/blob/master/MarkdownTest.md. You can see its content at http://selite.github.io/MarkdownTest (ignore the header and footer, that comes from a framework).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!