在减价中添加灰色区域 [英] Add gray area in markdown

查看:81
本文介绍了在减价中添加灰色区域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在编辑readme.md文件,并且希望将一些文本块灰色区域设置为像 this

他们使用``javascript 注释开始灰色写入,但是当您需要将链接添加到文本。

是否有另一个选项可以提供灰色框架?

更新:

安全性




- 摘要




可以说我想要测试123的文本和后面将在灰色区域内(如代码),我该如何实现这一目标?这里的问题与下一节中的URL有关......



更新2

  ## Test 
< a name =Test>< / a>< a name =1.1>< / a>
- **摘要**
- 测试123
- 关注[测试工件](http://2.bp.blogspot.com)(更多单元)


解决方案

您指向的行为是使用代码块。代码块的唯一目的是显示原始代码。 GitHub选择应用将背景颜色更改为灰色的样式是巧合。他们可以很容易地选择任何其他颜色或根本没有。



如果您想让一段文字突出显示为不同但仍然呈现为普通Markdown文本,则你绝对不想要一个代码块。还有其他几个选项。



您可以使用 blockquote

 > - 测试123 
> - 关注[测试工件](http://2.bp.blogspot.com)(更多单元)

同样,实际样式将取决于您发布Markdown的网站上定义的样式。每个网站可能会有所不同。在StackOverflow中,您会看到一个黄色(橙色?)框,如下所示:



在GitHub上,左边有一个灰色条,没有背景阴影,但这是最好的。 / p>

另一种选择是使用原始HTML定义您自己的块。但是,出于安全原因,GitHub会将其删除。

GitHub可能不会删除简单的< div> ,但还有其他各种问题。首先,根据Markdown 规则,Markdown格式化语法不在块级HTML标签。虽然一些Markdown实现已经添加了一种方法来在块级HTML中强制Markdown处理,但似乎没有GitHub支持其中的任何一种。

然后就是这个问题了如何设计div的风格。你可以分配一个类,但是你怎么定义CSS来设计这个类?你不能在你的Markdown中包含CSS(GitHub会将其删除)。虽然可以包含内联样式(在 div 中使用样式属性),但GitHub会生成 style 属性。



如果您真的想完全控制文档的外观,那么您需要将自己的网站托管在你自己的服务器。当使用像GitHub这样的网站时,你坚持自己的选择。


I currently editing readme.md file and I want to put for some text block gray area like this.

They used the ```javascript annotation to start writing in gray but the problem occurs when you need to add links to the texts.

Is there another option to provide a gray frame?

UPDATE:

Security

- Abstract

Lets say that I want that the Test 123 text and the follow will be inside a gray area(like code) how do I achieve this? the problem here is with the URL in the follow section...

update 2

## Test 
   <a name="Test"></a><a name="1.1"></a>
   - **Abstract**
    - Test 123
    - Follow  [testing artifacts](http://2.bp.blogspot.com) (more Unit )

解决方案

The behavior you point to is using a code block. A code block's sole purpose it to display raw code. The fact that GitHub chose to apply a style which changed the background color to gray is coincidental. They could have easily chosen any other color or none at all.

If you want a block of text to stand out as different but still be rendered as normal Markdown text, then you absolutely do not want a code block. There are a few other options available.

You could use a blockquote:

 > - Test 123
 > - Follow  [testing artifacts](http://2.bp.blogspot.com) (more Unit )

Again, the actual styling will depend on the styles defined on the site you are posting your Markdown to. Each site may be different. Here on StackOverflow you get a yellow (orange?) box, like this:

On GitHub you get a gray bar on the left and no background shading, but that is the best you can probably do.

Another alternative is to use raw HTML to define your own block. However, for security reasons, GitHub will strip that out.

GitHub probably won't strip out a simple <div>, but there are various other problems. First of all, as per the Markdown rules, "Markdown formatting syntax is not processed within block-level HTML tags." While some Markdown implementations have added a way to force Markdown processing within block-level HTML, it does not appear that GitHub supports any of them.

And then there is the issue of how to style the div. You could assign a class, but then how do you define the CSS to style that class? You can't include CSS in your Markdown (GitHub will strip that out). While one could include inline styles (using the style attribute on the div), GitHub stips the style attribute out as well.

If you really want full control over how your document looks, then you need to host your own site on your own server. When using sites like GitHub, you are stuck with their choices.

这篇关于在减价中添加灰色区域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆