【问题标题】:Show dropdown area / expandable area with code in markdown file使用 Markdown 文件中的代码显示下拉区域/可扩展区域
【发布时间】:2018-05-03 16:27:37
【问题描述】:

我正在尝试在 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

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

Collapsible header in Markdown to 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>

但我到现在都没有成功。

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

任何帮助将不胜感激。

【问题讨论】:

    标签: html github markdown readme


    【解决方案1】:

    解决办法

    这个问题的解决方案是'run code sn-p'

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-13
      • 1970-01-01
      • 1970-01-01
      • 2010-12-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-15
      相关资源
      最近更新 更多