Options for collapsing YAML when viewing? - editor

I chose YAML over XML as a format to store our input and output data. It works well, but now I'm discovering one of YAML's main weaknesses: editor/viewer support.
I need help to simplify the viewing of potentially large YAML files by coworkers. Here are some of the programs they might use:
browsers (firefox, chrome, IE)
vim
nedit
emacs
eclipse
komodo
slickedit
I'm most interested in using browsers to view the YAML because that would cover everyone, but solutions for any of those other editors would also be helpful. The less customization required by the user, the better!
Anyone know of browser plugins or have any other tips for viewing YAML?
Thanks in advance!

In vim you should look at Folding. See http://vim.wikia.com/wiki/Folding The default method of indent based folding should be sufficient for YAML.
:set foldmethod=indent
zo opens/expands/unfolds
zc collapses/closes/folds

For eclipse you can use
https://marketplace.eclipse.org/content/yaml-editor/
which supports folding (but must be enabled in preferences) or you just use the quick outline Ctrl + Shift + o and type identifer as shown in example - here *city was used to show up only those parts of document. Pressing Enter will jump to the coresponding part.
PS: I am the maintainer of the plugin

Related

Generate markdown docs with rustdoc?

Is there any way to generate a single markdown file in doc/ from the /// comments?
Multiple markdown files (doc/main.md, doc/foo.md, etc) would be nice too.
I'm new to rust, and while the generated HTML documentation is nice, I mostly live on the command line and really don't want to be switching between my terminal and a web browser just to read the docs. That breaks the flow and takes me out of the zone. Also, md is easily converted to man pages, or to TeX for printed or PDF docs.
(I'm used to suspending vim with Ctrl-Z or using another terminal tab, and running man or perldoc or pydoc etc. Text-mode browsers like lynx nor links are not good options for me - navigation is clumsy, the output is ugly on my 200+ column terminals windows if i forget to use the -width option, and neither support javascript)
cargo-readme might work for you. You run cargo readme -i foo.rs > FOO.md and it populates FOO.md with the contents of the doc comments from foo.rs. Found it via reddit.

Is there a clever way to pass a yml locale file to my client for translation?

I have finished a rails project using i18n and now I need to pass all the text in the website to our client so that he can translate them and we can include additional locales to our app.
The problem is our client is not a geek and if we give them the actual YAML file, they will use MS Word to edit it and we'll lose all the proper markup in the process ("\n" for new lines, one line text, etc...).
How would you handle this process?
Is there a better way than giving the client a .doc file and then loosing a day to clean the text afterwards and manually converting it back to YAML?
Thanks in advance,
Augusto
This is exactly what Locale was created for : you upload your YAML files, your client/translator edits the content and you sync YAML back down. You don't email files and you don't have to deal with crappy file formats - check it out!
Full disclosure : I co-founded and develop Locale.
This sounds like a one-off thing where I you do the translation once and then be done with it.
What we do in these cases (we usually work with a Translator for these kinds of things) is that we export all the keys in the YAML to Excel and send them that.
Once we get it back we usually task a intern with fixing up the yaml (after it's been translated back into YAML - we do this manually at the moment but a little script should be easy to implement)
Other solutions could be (if you do this a lot) that you include the translations into your app and enable through some JavaScript and maybe something similar to Aloha Editor the user to simply click on texts and translate them in the app. But that's a bit excessive and only makes sense if there are really a lot of translations to be done and you want to crowdsource them (Facebook did this back in the day)

How Can I Automatically Execute A Link In Internet Explorer

I am trying to create an application to print documents over the web. I have created my document, and made a web page with a meta refresh tag, along the lines of this:
<meta http-equiv="refresh" content="3;http://example.com/download.epl2" />
I specify that the document has a content-type of application/x-epl2, and I have associated .epl2 files on my computer with a program that silently sends them to the printer.
I have put the website into my trusted sites zone.
Currently Internet Explorer pops up the "Open, Save, Cancel" dialog box with no option to automatically open the file.
Is there a setting in IE6/7/8 that I can use to have IE just open the file without prompting?
EDIT
The actual content of the file will differ based on the job, but essentially it is text that follows the Eltron Programming Language.
EDIT
I have accomplished this in both Chrome and Firefox by choosing "Automatically Open Files Of This Type From Now On"
EDIT
The machines this program will be used on will effectively be kiosks that are limited to only accessing my website from their web browsers, so I'm not worried about rogue websites sending documents to my printers.
EDIT
I am using PHP to generate the documents and HTML on the server side, though I expect the solution to be language agnostic.
I would expect that not to be possible, because then you could stumble onto a site that automatically loads and prints a 5000 page document or something, which would not be good.
If you always had a secret desire to develop a custom URL protocol (I know I do), this might be a good excuse to do it. ;-)
http://msdn.microsoft.com/en-us/library/aa767914%28VS.85%29.aspx
There are 1-2 prompts when opening such a link for the first time in IE, but you can choose to automatically open them after that.
I would use javascript to make this happen.
Javascript Window Open
EDIT
Since you have control of the windows box you could use an automate script process to interact with the print window.
autoit3: ControlClick
Write a small utility program that does nothing but send the file passed to it on the command-line to the default system printer.
Then, edit the registry under HKEY_CLASSES_ROOT to associate this program with the .epl2 filetype.
I don't have time to investigate it for You, but there were lots of exploits that could be helpful. Using ie6 without certain fixes seems helpful.
Also there should be an option called "Automatic prompting for file downloads". I use Linux nowadays so I can't chceck if it helps. I found it in some docs.
I'm on a Mac at the moment, but if this is possible in IE I would imagine this page holds the answer to it (or at least hints at it) http://support.microsoft.com/kb/883255
I believe what you're looking for is a setting in Windows, not IE:
Microsoft Support: Not Prompted to Specify Download Folder for File
Try using an older version of IE. Security was looser in the older versions and since it's a non-issue, this could be the quickest solution.

LaTeX: Are there any web frontends available?

As of now the workflow is something like, I import an SVN or a CVS repository and then compile a document locally on my machine to get either a ps or a pdf file. But I was wondering if there is a Web front-end to do all the stuff, like for instance, an editor using which you can edit the file online and then download just the pdf file by compiling it?
Any suggestions?
http://www.scribtex.com/pages/index
http://code.google.com/p/latex-lab/
latex-lab will build on top of the google apps editor base...
scribtex is hosted only it looks like.
Another to add to the list is TeXonWeb.
If you mean online LaTeX compilers, then there are two I know of - at baywifi.com (to PDF) and at ScienceSoft (to several formats). Haven't seen any full editors, though.
There is a CMS based on Latex out there at www.osreviews.net.
The best site I found to produce PDF from LaTeX online is PC Shows.
Verbosus offers an Online LaTeX Editor that supports PDF preview, HTTPS, syntax highlighting, code completion, templates, etc. (Additionally it offers an editor for Octave/Matlab)
This is less of a web-based interface than a simple drag-and-drop cgi script that converts latex syntax to a graphic... www.forkosh.com/mimetex.html
latex-online is a simple open source web service that compiles latex sources/public git repos and returns pdf's. It has both a simplistic web front-end and a command-line tool for interacting with the service - you might find it interesting.
One rather new possibility is https://texlive.net/
You can either interactively edit your documents or you can pass your document via the url to it. E.g. a simple hello world document can be constructed as
https://texlive.net/run?%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bamsmath%7D%0A%5Cbegin%7Bdocument%7D%0AHello%20world!%0A%5Cend%7Bdocument%7D

RTF editor

I have a templates written in RTF(with some tags which are replaced by data from DB in app), but when I edit them in MS Word, Word put some invisible tags to the templates, which destruct my tags(I must open template in Notepad and edit code).
Do you know some editor for RTF, which strict follows RTF specification?
Thanks
On Windows, the included app Wordpad is pretty decent in my opinion.
The RTF spec allows an RTF editor such as Word or a third party control to sprinkle the tags in-between the RTF text, provided that the actually RTF display is maintained. For this reason, there is no way to guarantee that your original template text will not be disturbed. For this reason, I recommend using an RTF editor API to do any search/replacement within your template. The RTF editor knows to put aside the RTF tags and access the original text as intended.
OK, I know that google find bunch of editors, but I don`t have time to try each of them to find out best one.
so I search for advice which is good, not which is avialable
EDIT: I found and for weeks use this solution
TE EDIT
and is very good, I recommend it.

Resources