Giter VIP home page Giter VIP logo

Comments (5)

inducer avatar inducer commented on May 28, 2024

I think even with the sandbox this would still be pretty cumbersome. In addition, most of the things that you can do with Jinja would break in the setting, so it would still only solve half the problem. My plan for this is instead to allow pointing a course within a locally-running relate instance at a directory rather than a git repository. That way, changes can be immediately previewed right after the files are edited. This does not enforce validation, so there's some room for errors, but I think overall this is the most promising solution. What do you think?

from relate.

dzhuang avatar dzhuang commented on May 28, 2024

I think your idea is great, at least for me.
In fact, my original intention to raise this issue is to make it easier, although it is actually not easy :-), for my colleagues who wish to use my relate instance to develop their courses. Your idea is great, but that requires users to set up local developing env on their machines, which is not so realistic for my colleagues.

from relate.

inducer avatar inducer commented on May 28, 2024

Here is an alternative idea: we build an IDE -like interface with a file browser on the left and an editor on the right. (We have already got code mirror and jstree, so the parts are there.) This can be popped open in a separate browser window, and a user can then edit the site "live" in some sort of preview mode.

This would entirely remove the requirement for the user to have local development environment of any sort, and in addition it would allow relatively immediate feedback on edits.

There are a few things that are unclear to me about how to do this, but I feel like all this is resolvable:

  • First, relate would need to start working as a more full-featured git endpoint, not just pulling changes from elsewhere, but also being able to serve a git tree so that changes made within relate can get out. It's actually easier than it sounds, because Dulwich can be made to do the hard work. As a matter of fact, they already have a Web server that would just need to be glued into Django, with some manner of authentication.
  • Each save operation would likely generate an intermediate commit. I imagine that per user we would have to save their current "edit base commit", and all the edits on top of that would then become part of the next commit that they likely would have to issue explicitly. Each save on the other hand would likely only generate a temporary commit that gets replaced by the next saved state.
  • One thing to figure out would be what to do if two users make conflicting changes. My inclination would be to let people fetch both git revisions and then sort out the mess themselves on the command line.
  • Another question is how this would interact with validation. One slight issue is that validation can take a few seconds, which takes away from the immediacy of the edit-save-preview cycle. On the other hand, some parts of relate may be considerably unhappy if they run on unvalidated data. Maybe validation can be made fast enough to not hamper this too much.

from relate.

dzhuang avatar dzhuang commented on May 28, 2024

Wow! What a great idea. I like the idea of commit upon save using Dulwich. I have not explored deeply into Dulwich package, although I've implicit expected that utility. Your idea is much further and more considerate than mine. If that can be applied, I think it's quite possible that course developers can use pull and drag to edit their course content, which will also reduce validation work, and lower the barrier for Relate user.

from relate.

inducer avatar inducer commented on May 28, 2024

https://gitlab.tiker.net/inducer/relate/merge_requests/62

from relate.

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.