2

我试图在 readme.md 文件中有一个下拉菜单并在该可扩展区域中显示代码。

对于 md 文件,我看到有人使用对我有用的 ```。

下面的链接在使用 md 文件和许多其他东西显示表格数据时很有用:-

  1. https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet

  2. https://github.com/tchapi/markdown-cheatsheet/blob/master/README.md

为了显示下拉列表,我发现使用带有摘要的详细信息标签:-

Markdown中的可折叠标题到html

我正在尝试更新 md 文件并显示一些代码

<details>
  <summary><h1 style="display:inline-block"> Advanced Topics </h1></summary>
    ```

    import { Component } from '@angular/core';

    @Component({
      selector: 'app-root',
      template: `<nav>
                  <a routerLink="/signin" routerLinkActive="active">SignIn</a>
                  <a routerLink="/signup" routerLinkActive="active">SignUp</a>
                </nav>  
                <router-outlet></router-outlet>`,
      styleUrls: ['./app.component.css']
    })
    export class AppComponent {
      
    }


    ```
</details>

但是直到现在我都没有成功。

如何在使用 ``` 但在详细信息标签内显示格式化/突出显示的代码?

任何帮助,将不胜感激。

4

1 回答 1

1

解决方案

这个问题的解决方案是“运行代码片段”

<script src="https://gist.github.com/nicolasalarconrapela/91d36921ab168401f88050929aeab1be.js">
</script>

于 2017-12-11T11:28:39.433 回答