Giter VIP home page Giter VIP logo

Comments (31)

marctc avatar marctc commented on May 16, 2024 3

I'm working on a similar approach. We use Puput in APSL's blog but we have the problem that the default RichTextField don't work well for other things like inserting code snippets. We though an interesting approach would be replace the body field from a RichTextField to a StreamField (see this link http://thirdworldnomad.com/2015/06/22/developing-wagtail on the section "Extending StreamField Block").

from puput.

sabueso avatar sabueso commented on May 16, 2024 3

@albcunha is there some possibility to increase those 50 bucks with money from other users? I'll be happy to contribute ;)

from puput.

albcunha avatar albcunha commented on May 16, 2024 2

Guys, I made a symbolic bountysource for this feature. Not a lot, 50 bucks, but better than nothing, right? Keep up the good work!

from puput.

sabueso avatar sabueso commented on May 16, 2024 1

@marctc Done!

from puput.

marctc avatar marctc commented on May 16, 2024 1

awesome!

from puput.

MiltonLn avatar MiltonLn commented on May 16, 2024 1

@FlipperPA, we are just going to support wagtail 2.0 to use draftail, that would solve all of our needs, I'm taking care of that this week

from puput.

FlipperPA avatar FlipperPA commented on May 16, 2024 1

Sure! Here's the site: https://PyPhilly.org/ The ABOUT page has an image header example. It's running entirely Wagtail 2 on Django 2. The backend is using Zappa to run on AWS Lambda serverless with SQLite on S3. Total cost: $0.56 to host last month! :)

And here's the editor:

peregrine-page-editor

from puput.

FlipperPA avatar FlipperPA commented on May 16, 2024 1

That's a tricky one, especially with Draftail as there is not HTML stored in the database. It stored the whole editor area as JSON, which is rendered to HTML on demand. It might be necessary to create some sort of IFRAME or RAW HTML button for those cases, that just renders whatever you put into the field exactly as it appears.

from puput.

iampbernardo avatar iampbernardo commented on May 16, 2024

Looks like a great aproach.
Then this library could also help with syntax highlighting http://prismjs.com/

The main problem would be migrating already exiting posts, right?

from puput.

marctc avatar marctc commented on May 16, 2024

Yes, it is. For the moment, I think that the best option is have two body fields and provide to user a tool to migrate between fields (something like this http://docs.wagtail.io/en/v1.4.1/topics/streamfield.html?highlight=streamfield#migrating-richtextfields-to-streamfield=

from puput.

mronoffon avatar mronoffon commented on May 16, 2024

what is the status of the 'RichTextField to a StreamField' (if there is one)?

from puput.

marctc avatar marctc commented on May 16, 2024

Hi @mronoffon,
I've waiting if wagtail-markdown make any progress to be production ready.

There are a branch for this goal. Feel free to try it.

from puput.

FlipperPA avatar FlipperPA commented on May 16, 2024

Howdy @marctc, thanks for your efforts! I have a pretty good generic StreamField body block I've developed. Want me to implement a version and issue a PR? Perhaps as a different Entry page type, maybe a "StreamEntry"?

from puput.

mronoffon avatar mronoffon commented on May 16, 2024

from puput.

marctc avatar marctc commented on May 16, 2024

Howdy @marctc, thanks for your efforts! I have a pretty good generic StreamField body block I've developed. Want me to implement a version and issue a PR?

Yeah, sounds good to me. What do you have in mind?

Perhaps as a different Entry page type, maybe a "StreamEntry"?

I would rather implement as an extra body field in Entry model and set the body field as blank=True

from puput.

mronoffon avatar mronoffon commented on May 16, 2024

any headway?

from puput.

marctc avatar marctc commented on May 16, 2024

We are working on it in this PR: #83

from puput.

FlipperPA avatar FlipperPA commented on May 16, 2024

Feel free to help out with the PR if anyone would like! I'm hoping to get some time soon to merge the best from both branches.

from puput.

MiltonLn avatar MiltonLn commented on May 16, 2024

Please see pull request #112

from puput.

marctc avatar marctc commented on May 16, 2024

Awesome!!! Thank you very much @albcunha. Never heard about this. @MiltonLn @FlipperPA can you take a look?

from puput.

marctc avatar marctc commented on May 16, 2024

@sabueso Yep!
https://www.bountysource.com/issues/32083681-body-content-as-streamfield

from puput.

marctc avatar marctc commented on May 16, 2024

@albcunha @sabueso it seems that with new wagtail editor this issue won't need to develop. We appreciate your economical effort, but maybe it will fair if nobody earns that money. What do you think?

from puput.

FlipperPA avatar FlipperPA commented on May 16, 2024

What still needs doing here? I thought it was mostly complete, but its honestly been quite a while now and would probably need some tweaks for Wagtail 2.0. :)

from puput.

albcunha avatar albcunha commented on May 16, 2024

I think my share can be donated to you. After all, you deserve free beer on the house!

from puput.

FlipperPA avatar FlipperPA commented on May 16, 2024

@MiltonLn Right on, good to hear! I'm sticking with the structured content approach of StreamField with Peregrine, so that'll be a nice differentiation. If y'all can make it to DjangoCon US this Fall in San Diego, I'd love to chat Wagtail blog software!

from puput.

marctc avatar marctc commented on May 16, 2024

@FlipperPA can you show us a screenshot of how it looks?

from puput.

marctc avatar marctc commented on May 16, 2024

@albcunha @sabueso do you think that the options that draftail provide by default (https://springload.github.io/draftail/) is enough or we need something special?

from puput.

albcunha avatar albcunha commented on May 16, 2024

I agrree with Milton regarding highlighted code. The alternative given by Flipper Works great as well. But there's a dealbreaker for me. Sometimes I embed iframes. Would it be difficult to allow it to edit the HTML source code?

from puput.

albcunha avatar albcunha commented on May 16, 2024

I agrree with Milton regarding highlighted code. The alternative given by Flipper Works great as well. But there's a dealbreaker for me. Sometimes I embed iframes. Would it be difficult to allow it to edit the HTML source code?

from puput.

MiltonLn avatar MiltonLn commented on May 16, 2024

I agree with @FlipperPA, Is also worth saying that kind of feature is away the scope of this project, maybe that can be better handled directly on Wagtail project.

from puput.

MiltonLn avatar MiltonLn commented on May 16, 2024

Closing this because we are now supporting Wagtail 2.0 and its cool Draftail editor, please reopen if something different is needed.

from puput.

Related Issues (20)

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.