Closed sjay05 closed 4 years ago
I am a new user as well and am wondering the same. I thought this would do it but I still see line numbers:
MDEDITOR_CONFIGS = {
'default': {
'language': 'en',
'lineNumbers': False,
}
}
Kind of got it with some custom css, but not sure this is the best approach:
posts/static/posts/css/posts_custom.css
ol.linenums {
padding-left: 0 !important;
}
ol.linenums li {
list-style-type: none !important;
}
posts/admin.py
from django.contrib import admin
from posts.models import Post
@admin.register(Post)
class PostAdmin(admin.ModelAdmin):
list_display = ('id', 'title', 'user')
list_display_links = ('title',)
class Meta:
model = Post
class Media:
css = {'all': ('posts/css/posts_custom.css',)}
js = ()
Still, why doesn't lineNumbers
work? I came across several posts experiencing the same thing.
The 'lineNumbers' in the configuration is the global edit box line number control, not the code block. The line number of the code block does not support configuration now, it can only be retained. You can also modify the CSS style to achieve it yourself, or have a more elegant solution, please leave a message or submit a PR.
I would like to remove the line numbers that appear on code like the image below. Is there a quick way I can do this?