dwjohnston / react-github-permalink

A react component to display github permalinks
MIT License
2 stars 0 forks source link

Add the ability to exclude lines/and or have multiple line groupings #38

Closed dwjohnston closed 1 week ago

dwjohnston commented 3 weeks ago

I'm facing a scenario where I a code block that looks like this:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

     #main {
        font-size: 2em;

        color: black; 
        border: black 2px dashed;
        background-color: grey;
     }
      //50kB more css here <----- note
    </style>
</head>
<body>

    <p id="main">hello world!</p>

    <div class="50kB-of-dom">
      //snip <------- note 
    </div>

</body>
</html>

In actuality these reference files that are thousands of lines long - but I don't want to display them.

In these scenarios I'm not using react-github-permalink.

It would be nice to do something like:

<GithubPermalink permalink="https://github.com/dwjohnston/react-github-permalink/blob/5b15aa07e60af4e317086f391b28cadf9aae8e1b/sample_files/sample1.go#L1-L1000"
excludeLines={[[10, 200], [210, 950]}
excludeText="//snip"
/>