GitHub MarkDown:宏和变量是可能的吗? [英] GitHub MarkDown: Are Macros and Variables possible?
问题描述
我一直在学习github降价,我有一个关于变量和宏的问题。
可以定义一个变量或宏以防止重复打印文本块?
用例是我有一个表格产生一个超链接的大网格 - 链接如下所示。
http://www.a-big-long-big-big-long-hyperlink/more-long-stuff? id = 1234
如果我可以像下面这样做一次,那会很好:
$ link = http://www.a-big-long-big-big-long-hyperlink/more-long-stuff?id
然后在表格中的每个单元格中,我可以说类似于
$ link = 1234
其他单元
$ link = 2345
这个想法是:
干杯。
以下是编写Reference-Links的几种方法:
[我是内联式链接](https://www.somewebsite.com)
[我是一个带标题的内联式链接] (https://www.somewebsite.comsomewebsite's Homepage)
[我是参考风格的链接] [任意区分大小写的参考文本]
[我是一个存储库文件的相对引用](../ blob / master / LICENSE)
[您可以使用数字作为引用样式的链接定义] [1]
或者将其保留为空,并使用[链接文本本身]
某些文本显示引用链接可以稍后进行。
[不区分大小写的任意参考文本]:https://www.somewebsite.org
[1]:http://somewebsite.org
[link text本身] :http://www.somewebsite.com
I've been learning github markdown, I had a question about variables and macros.
is it possible to define a variable or macro to prevent repeated printing of a block of text?
The use case is that I have a table producing a big grid of hyperlinks - the links look like the below.
http://www.a-big-long-big-big-long-hyperlink/more-long-stuff?id=1234
it would be nice if I could do something like the below once:
$link=http://www.a-big-long-big-big-long-hyperlink/more-long-stuff?id
and then in each cell in the table, I can say something like
$link=1234
Some other cell
$link=2345
the idea being that:
- The table (which has ~10 columns and ~10 rows) is a bit easier to see on a normal screen, at the moment with the prefix to the links being so long, it looks really ugly as the links wrap to the next line
- If I want to change the root link, I can change it in one place (yes, I know I could do search and replace in an editor!)
Cheers.
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
这篇关于GitHub MarkDown:宏和变量是可能的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!