Comments (2)
The plugin is using the same approach to generate attributes as the Django:
https://github.com/django/django/blob/master/django/forms/templates/django/forms/widgets/attrs.html
So I'm curious as to why rows
and cols
aren't being rendered. I'll have to investigate further.
from django-pagedown.
Just to follow up on this. I tested and the attributes are getting applied for me, but the admin css styling is overwriting their values.
For example, In my form I tried:
example = forms.CharField(
widget=AdminPagedownWidget(attrs={'rows': 2}), max_length=500)
Which rendered:
<textarea name="example" cols="40" rows="2" class="vLargeTextField wmd-input" maxlength="500" required="" id="wmd-input-id_example"></textarea>
You'll see that rows=2
is included.
The issue is that the height of the input is actually set in the demo.css
that is included in the widget. This demo.css
file is coming from the official Pagedown repo that I've included as a submodule. You can see it here:
We're also adding our own local stylesheet to add to that default stylesheet here:
https://github.com/timmyomahony/django-pagedown/blob/master/pagedown/static/admin/css/pagedown.css
This file deals with styling it for Django admin
The solution is to either overwrite the widget and add your own additional stylesheets, or maybe just copy and overwrite the /pagedown/static/admin/css/pagedown.css
file mentioned above so that your version is copied instead of the library version
from django-pagedown.
Related Issues (20)
- 'default_app_config' is deprecated in Django 3.2.X HOT 2
- I get a: ModuleNotFoundError: No module named 'pagedown.urls' HOT 2
- Can you add a feature so LaTeX/MathJax renders in the preview? HOT 1
- Accidentally double-tapping the "save" button when adding an image
- Not compatible with dark mode introduced in Django 3.2
- Write some tests
- Needed JS? HOT 1
- Does this support Python 3? HOT 2
- pip install django-pagedown not working fine. HOT 4
- Widget doesn't work on forms that are part of formsets HOT 2
- Django admin page raise TypeError HOT 1
- content = forms.TextField(widget=PagedownWidget()) Doesn't work on Djnago 2.0 HOT 7
- Space before URL results in malformed URL in markdown HOT 4
- Django 2.2 requires jquery to be set as dependency HOT 1
- Add to Django Packages -> Markdown Category HOT 1
- Where do you put the widget customization? HOT 1
- Collectstatic pulling in demo project css HOT 2
- Collect Static does not collect pagedown.css HOT 4
- Mobile display issue HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-pagedown.