question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

remove indentation in all code blocks in markdown files

See original GitHub issue

We use padding for first level indentation in code block since this PR got merged.

For example consider this codeblock:

```dvc
    $ pip install gitpython
    $ pip install git+git://github.com/iterative/dvc
```

Output

Screenshot from 2019-05-15 12-59-49

Expected Output

Screenshot from 2019-05-15 13-00-37

This can be fixed by removing the unnecessary 4 spaces indentation we have given under every code block. Since there are a lot of files, I recommend a smart way to fix it. For example a bash script could be made to run over all .md files and remove the indentation. Keep in mind that we don’t have to completely remove indentation. Just the first level. For example:

```js
    function sum(a, b) {
        return a+b
    }
```

converts to:

```js
function sum(a, b) {
    return a+b
}
```

not this:

```js
function sum(a, b) {
return a+b
}
```

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
shchekleincommented, May 17, 2019

hi, @ryokugyu ! That would be great. Thank you. I’ll assign it to myself to lock the issue. Feel free to proceed with it.

0reactions
shchekleincommented, May 18, 2019

Fixed by @ryokugyu .

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I remove excess indentation on my code blocks?
For reasons previously unbeknownst to me, the same keyboard shortcut that you use to format unformatted code as Markdown code blocks ( Ctrl ......
Read more >
Automatic removal of indent in markdown (fenced) codeblock ...
When typing '#' as the first character in a new line, the indent for that line is removed, the '#' is put in...
Read more >
We should abandon indented code blocks - Spec
Overall, if indented code blocks go away, Markdown can become completely indentation-agnostic, where the only real requirement is that following ...
Read more >
Indenting without changing text to a code block
I have noticed a couple of workaround. Indenting with 1-3 spaces will indent without destroying links, and indenting a paragraph separated ...
Read more >
Extended Syntax - Markdown Guide
The basic Markdown syntax allows you to create code blocks by indenting lines by four spaces or one tab. If you find that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found