Giter VIP home page Giter VIP logo

gitbook-plugin-code's People

Contributors

davidmogar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gitbook-plugin-code's Issues

Problem with spans across lines.

Hi! I am using this plugin to get line numbers in my book code samples, and I ran into an issue.

When faced with this kind of code:

```python
"""Usage:

whatever
"""
```

Markdown will be converted into this (by the highlight plugin?):

<span class="hljs-string">"""
Usage:
whatever
""""</span>

And then when your plugin tries to wrap lines in code-line spans, things break because opening/closing tags don't match anymore:

<span class="code-line"><span class="hljs-string">"""</span>
<span class="code-line">Usage:</span>
<span class="code-line">whatever</span>
<span class="code-line">""""</span></span>

The effect is that the whole thing is only counted as one line.

It doesn't look easy to fix, it would need to keep track of open spans and close them then reopen them in the next line?

Support an arbitrary line number start value for specific code blocks

Something like the following, if possible:

```yaml,line_num_start=5
5: foo: bar
6: ...

Where the line numbers start at the specified value, 5, instead of 1.


Combined with #5 we could get something like:

```yaml,line_nums,line_num_start=5
5: foo: bar

Which would force line numbers to be rendered even though it is a one-line and start the line numbers at the specified value.

This is useful when you are dissecting a code-block line-by-line, for example, and want to make the context clearly known.

Is JSX supported?

Input:

redux_md_ _foofit__workspace_

Output:
(the jsx code breaks line numbers and highlighting)

react_redux_ _gitbook

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.