这是indexloc提供的服务,不要输入任何密码
Skip to content

Allow code *only* in the fenced md, with empty fence in C# file #247

@AArnott

Description

@AArnott

Is your feature request related to a problem? Please describe.

  1. We have to maintain two exact copies of the code (md and cs) at the moment. Or else when the markdown is displayed without try, the code snippet is missing.
  2. If I have many code snippets to show off, I need separate regions in the .cs file for each one, each in their own method. With all these snippets in different places, which one is "running" the sample from the web page supposed to execute?

Describe the solution you'd like

Let me just define one very small .cs file with almost nothing but an empty method and a region inside it. Then create dozens of samples in my .md files where the code actually appears in those code fenced areas. Then try verify will confirm that that code works when pasted into the .cs file, and try will actually life that code from the .md into the .cs file and execute it.
This also solves the problem of standard markdown rendering (like GitHub) not showing any code. It will always show the code. But with the right host, that code will be interactive!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions