Comments (14)
That would be fine, actually :) I have no issue rendering client-side.
from ponzu.
@Riari Hey - sorry for the long delay, I have had a bunch of "day job" work eating up most of my time... I found someone had made a markdown editor input for Ponzu.. maybe this would work for you?
https://github.com/aleksen/smdeditor cc: @aleksen
since there is no license, you should be careful what you're using it for.. maybe the author will consider adding one (I suggest BSD like ponzu or MIT if you like it better)
from ponzu.
Hi! I haven't put a licence in there yet, but it will be BSD. Feel free to fork or create PRs for the plugin.
from ponzu.
Hi @Riari -
Thank you for the kind words. I'm glad you think so!
Just to clarify.. you are using a editor.Richtext()
in your content type's MarshalEditor()
to create the editor within the CMS. When you type <pre><code>...</code></pre>
inside the richtext editor, those pre/code blocks are deleted from your input entirely?
Assuming the above is accurate, are the pre/code blocks stripped out after you hit 'Save'? Or, are you writing your pre/code blocks inside the "code view" (the <>
icon in the richtext editor) or in the "standard view"?
Is the content inside the pre/code block stripped as well, or only the pre/code HTML tags?
Steve
from ponzu.
Beyond changing the field to a plain textarea for now, any other suggestions? Could this be considered for a potential feature?
I think if we don't find a solution to your issue, adding a editor.Code()
func that simplifies writing formatted and syntax highlighted code would be a great feature to consider.
from ponzu.
I was entering the pre/code markup in the code view and hitting Save immediately after that. After testing further, it appears that anything you enter in that view gets lost on save unless you switch back to the preview first (I guess the editor doesn't commit changes to the textarea until that point). So that's another issue altogether.
While that does mean it's possible to use the markup with editor.Richtext()
, it presents another issue: when you change back to the preview, the markup is automatically formatted and that's problematic for pre
elements since there's extra whitespace resulting from the indentation.
Having a editor.Code()
sounds good, but I don't know how suitable it would be for my particular use case (basically blog posts with code samples featured throughout).
Hope that helps :) I'm somewhat new to Go myself, otherwise I'd offer to explore a potential PR for this.
from ponzu.
@Riari - would a markdown editor with syntax highlighting work, i.e. https://jbt.github.io/markdown-editor ?
from ponzu.
Yeah, something like that would be ideal actually.
from ponzu.
Yea, I think it could be a nice addition too. Would you prefer the un-rendered markdown, or rendered html in the json api responses?
from ponzu.
Having the HTML returned would suit me, but having the option to control it might be nice - maybe through an option in the admin config, or a checkbox below the editor in the form, or a querystring param like ?renderMarkdown=1
.
from ponzu.
Ok, thanks for the feedback. Would it be a significant issue if we were to only return the raw markdown? or would client-side markdown parsing be something you can live with?
from ponzu.
Thanks for the heads up; I'll take a look. If nothing else, at least it'll give me an idea of how to tackle it.
from ponzu.
@aleksen - I may need it for a upcoming project and if I do, I'd be happy to contribute to your repo.
from ponzu.
Closing this issue. It's been a while since there has been any activity. Please reopen if need to.
from ponzu.
Related Issues (20)
- CLI is not working HOT 14
- Zap v11 was deleted HOT 14
- go module support HOT 9
- search sort HOT 2
- Custom databases HOT 3
- ponzu 0.11.0 fails to build HOT 2
- The "must" search operator in blevesearch can't be passed into ponzu HOT 1
- NOTICE: original author & maintainer is stepping away from the project HOT 7
- how to change to Summernote
- Redis Support for ponzu
- There is three CSRF vulnerability that can add the administrator account, delete administrator account, edit configuration.
- Only latest tag saving
- Error with "go get..." HOT 6
- Current state of Ponzu HOT 1
- Is this project still maintained? HOT 3
- Suggested install method no longer works HOT 2
- Is Ponzu dead? HOT 10
- Potential goroutine leak in achive.go
- How can you develop addons more efficiently?
- How to setup development env
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 ponzu.