scripting / Scripting-News

I'm starting to use GitHub for work on my blog. Why not? It's got good communication and collaboration tools. Why not hook it up to a blog?
121 stars 10 forks source link

Simple XML Viewer app #234

Open scripting opened 2 years ago

scripting commented 2 years ago

Re this post, if you have comments or questions, this is the place.

I would love to have a very simple XML viewer app. I have one that I don't like very much. The app would run in a web page or on a server (if so, must be a Node app). It takes a url parameter, displays the contents of the file, parsed and indented consistently, and uses the same display that GitHub uses to display code, though it doesn't need any of the GH features, just the appearance. Horizontal scrolling, not wrapping text. I would use it in my existing app, with credit of course. I need this because my work requires me to look at XML files. And as far as I know there isn't a great way to do that, and given all the XML that's out there (web pages are XML, RSS feeds are XML) it would make sense to solve this problem well, as a very useful upgrade to the user experience of the web.

tedchoward commented 2 years ago

If you add this to the css for your existing app, you'll get horizontal scrolling:

#idXmlViewer {
    overflow-x: scroll;
    white-space: pre;
}
jgrisham commented 2 years ago

Universal (and simple, dependancy-free) “puzzle-piece” tools such as this are a great idea!

I’ve used a browser extension for this (for XML and JSON) - perhaps mining existing extension sourcecode here on GitHub would provide a template for what you’re looking for.

scripting commented 2 years ago

I found something that seems to do the job -- highlight.js.

And, having found one, now I can find others, like prism.js.

scripting commented 2 years ago

Problem solved.

http://scripting.com/2022/06/09.html#a170727

I used the Ace Editor in read-only mode.