Coder Social home page Coder Social logo

Comments (9)

fbaube avatar fbaube commented on April 28, 2024 1

DITA uses Relax NG for its master grammars, and specializations of DITA (which are encouraged) should be based on the RNG grammar. FWIW I found a codemirror derivative called "xmlmirror" ( https://lastlog.de/blog/posts/xmlmirror.html ) that claims to do schema-driven editing, including RNG-driven. Unfortunately xmlmirror's dependencies are very complex and it failed to install. But I'll keep looking around.

(I avoid Slack cos IMHO infinitely scrolling chat interfaces are useless IRL. But I'll leave notes here on this issue.)

from ponzu.

nilslice avatar nilslice commented on April 28, 2024

Hi @fbaube -

Could you elaborate on how this would be used? Or, how does myfield:"string" and using the editor.Richtext not already satisfy any requirements since you can put markup directly in the code view "<>", as you mentioned. You can add markup directly in the editor.Textarea function as well, but be mindful of how it is escaped.

I don't know if all the codemirror features/options are available, but if you test for a specific one and find that it is not available, let me know!

from ponzu.

fbaube avatar fbaube commented on April 28, 2024

I'm just thinking, specialised modes in editors always add nice functionalities. Codemirror has http://codemirror.net/mode/xml/

Schema-guided autocomplete is demo'd in https://codemirror.net/demo/xmlcomplete.html ; after you type "<" and select a tag, typing a space offers attributes.

I'd like to use this functionality for DITA. DITA has schemata in DTD, RNG, and XSD.

Unfortunately I've never actually configured Codemirror myself, so I have no idea how to proceed....

from ponzu.

nilslice avatar nilslice commented on April 28, 2024

Hi @fbaube - sorry for the delay, I must've missed the notification.

So just to be clear, you're looking to gain auto complete in the code view mode of the richtext editor?

I agree that this would be useful to add/edit markup, but I'm not as sure about adding a CLI specifier would be necessary. It should just be available in that mode by default IMO.

Unfortunately, the codemirror configuration is likely buried within the "materialnote" library I use to instantiate the richtext editor, and I'm not as familiar with its codebase as I probably should be. I will take a look at it though and let you know what i find.

from ponzu.

fbaube avatar fbaube commented on April 28, 2024

Autocomplete is the most desirable feature add, altho Codemirror has other XML enhancements too. I skimmed the Materialnote website and yes, it's a layer of complication if the goal is to directly tinker with Codemirror. But anything you can discover would be great !
I could provide a simplified version of the LwDITA DTD for testing purposes. The inline elements are much like HTML5; the block elements would be mostly new. There are additional attributes for things like links.

from ponzu.

nilslice avatar nilslice commented on April 28, 2024

Ok, thank you for clarification. I have added this as a suggested feature and will do my best to get it started. I created a Community Suggested Features project where I try to lay out a rough road map of whats to come, and what is in planning or development, so that anyone can come check out ideas to contribute if they would like.

I would love to get a PR for this, since admittedly the XML stuff is a bit outside my domain. If you'd like to work on it, let me know and I'll happily help get you started.

Since this feature is added to the project above, I will close out this issue for the time being. Feel free to join the #ponzu slack channel in the Gophers organization here: https://invite.slack.golangbridge.org and we can discuss further.

Link to project card: https://github.com/ponzu-cms/ponzu/projects/2#card-1726610

Thanks,
Steve

from ponzu.

nilslice avatar nilslice commented on April 28, 2024

Thanks! I will keep an eye on this too. I'm planning to dedicate more time over the next couple weeks to these types of issues.

from ponzu.

fbaube avatar fbaube commented on April 28, 2024

Now that I have found the RNGs for LwDITA (Lightweight DITA) I think I'll simply take a page in ponzu where the text edit widget works and then experiment with it until I get codemirror's XML functionality working.

from ponzu.

nilslice avatar nilslice commented on April 28, 2024

Sounds good. Let me know if you run into any issues -- I will admit, that code is a little messy 😄

from ponzu.

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.