Help needed for developing the pandoc tool, namely ODT generation -- https://github.com/jgm/pandoc/issues/1667#issuecomment-310770083:
Does anyone know what needs to be done to set the document language in ODT?
The German Wikipedia entry for OpenDocument has an example[1] for explaining the ODT format. In the meta.xml file there, you can see the language specified (as German) by
<dc:language>de-DE</dc:language>
...hope that helps.
[1] Permanent link:
https://de.wikipedia.org/w/index.php?title=OpenDocument&oldid=166672125#meta.xml-Datei
Related
This question may be a little off topic. But I was wondering if there was a way for me to look at the descriptions of C functions using vim or neovim. Is it possible to look at their documentations by doing something like :help? This would really be helpful since I wouldn't need to lookup to my browser everytime.
I am unclear about these things:
Can :help be my friend here ?
Can I use LSPs to do something like this ?
I am using latest Neovim inside Ubunutu 20.04 in WSL. Is this helpful somehow ?
By pressing K, the keyword under the cursor is looked up using a configured keyword lookup program, the default being man. This works pretty much out of the box for the C standard library.
For C++, you might want to look at something like cppman.
Well yes, you can get the description of C functions by using a LSP (language server plugin)! Here is an image of me using clangd as my LSP:
You'd "just" need to install the LSP and start it. I don't know how familiar you're with neovim, but just in case if you don't know how to install a plugin or to be more specifique: If you don't know how you can install a LSP server, then you can do the following:
There're plenty videos how to set up a LSP-Server for your language. Here's an example.
If you don't want to set up on your own, you can pick up one of the preconfigured neovim setups (some of my friends are recommending lunarvim)
But yeah, that's it. If you have any further questions feel free to ask them in the comments.
Happy vimming c(^-^)c
Let's explain how "K" command works in more detail.
You can run external commands by prefixing them with :! command. So running man tool is as easy as
:!man <C-R><C-W>
Here <C-R><C-W> is a special key combination used to put word under cursor from text buffer down to command line.
Same for showing Vim's built-in help page
:help <C-R><C-W>
As it feels tedious to type that, Vim also defines K Normal mode command that does pretty much the same thing. Except the tool name is taken from value of an option named "keywordprg".
So doing set keywordprg=man (default for *nix systems) makes K to invoke !man tool; while set keywordprg=:help is for bultin help.
Also, the option :h 'keywordprg' is made global or local-to-buffer, so any Vim buffer is able to overwrite global setting. For example, this is already done by standard runtime for "vim" and "help" buffers, so they call ":help" instead of "man".
The problem with :!man command is that it shows "black console". It'd be nice if we could capture man's output and open it inside Vim just like a builtin help page. Then we could also apply some pretty highlighting, assign key macros and all such. This is a pretty common trick and it is already done by a standard plugin shipped with Vim/Neovim.
A command that the plugin provides is called :Man, so you can open :Man man instead of :!man man, for example. The plugin is preactivated in Neovim; for Vim you still need to source one file manually. So to make use of this plugin you'll need something like this
set keywordprg=:Man
if !has("nvim")
source $VIMRUNTIME/ftplugin/man.vim
endif
The previous answer recommending cppman is the way to go. There is no need to install a bulky language server just for the purpose of having the hover functionality. However, make sure you're caching the man pages via cppman -c. Otherwise, there will be a noticeable delay since cppman is fetching the page from cppreference.com on the fly.
If you like popups for displaying documentation, convert the uncompressed man pages (groff -t -e -mandoc -Tascii <man-page> | col -bx), and set keywordprg to your own wrapper to search for keywords according to your needs.
I want to localize my application using the catopen()/catgets() family of functions.
As far as I understand, in the absence of NLSPATH variable, message catalogs will be looked up under /usr/share/locale/xx_YY/LC_MESSAGES.
What is the "traditional" file extension for message catalog files? I see some code examples using *.cat while others don't use any extension at all. Is it dependent on a particular UNIX flavour?
On my Linux boxes I see plenty of *.mo files, but those are GNU gettext archives. It seems catgets() can rarely be seen "in the wild" nowadays.
I meant this to be a comment, but it's a bit too long :P
Looking at the doc you've linked to, it seems probably that the code isn't opinionated as to file extension. Since you're not using MIME or anything to automatically find a handler for this file, the only requirement is likely to be that the name is correct. In UNIX, especially in the shell, file extensions often mean nothing to the system - fo example, any file extension can be used on an executable script as long as the executable bit is set and the shebang line at the top of the file specifies an appropriate interpreter.
It's possible the user community, if one still exists for this crufty sounding library, has a standard naming convention that the docs don't describe - but I wouldn't sweat it too much. It's trival to change file names, even if it means a recompile ( command line variables would make the program agnostic as to file name and extension )
I've got a real toughie. I have some old data files in a .D0# (like .D01, .D02 etc) format. I have no idea how these were generated or how to extract them to like a CSV or something simple. If i open them as text, some of the strings are there but i do not really have a feel for the encoding.
Any help would be life saving!
Here is a share link to a sample of such a file:
https://www.dropbox.com/sh/wx0k997p6td38l2/KFtp4SieZ1
Thanks
Ryan
Ok, well using HxD (a hex editor for Windows) I get the following out of the very beginning of the file:
V5.00 Copyright (C) by Compulife Software Inc., 1993
Googling Compulife Software took me here. Their products are here.
A bit more digging around gives:
Compulife offers an historical CD which contains past editions of our software.
The CD also contains instructions about how to install the past editions,
which are in a zipped format.
The history covers almost every month from the current month back to:
April 1990
The hex dump said 1993, so there may be some hope here. I'd say your best bet is to contact Compulife themselves. Failing that I can say that the file appears to have a fixed length record format, with some data as text and some in other 8 or 16bit encodings.
I'd start charging about now.
I am looking for some input on how to programmatically convert mp4 files to fragmented f4f files with accompanying manifests.
I currently have an implementation for creating segmented MPEG2-TS files with accompanying manifest for Apples HLS, and want to create a similar piece of software for Adobes HDS.
My code is based on Libav (alternatively, ffmpeg), so I was hoping they had native support for muxing f4f files, but I have not been able to find any resources for it.
What I am specifically looking for:
How (if) the format is used in libav?
If there is any special requirements (such as the h264_mp4toannexb filter required for converting MP4 to MPEG2 TS)?
Any sample code (even if it's not using libav/ffmpeg)
An easy-to-read manifest specification.
I'm afraid you have to read mp4/f4f specification, and implementation it your self.
MP4 file format: ISO/IEC 14496-14
f4f file format: It is included in the f4v specification.(http://www.adobe.com/cn/devnet/f4v.html)
The code of mod_h264_streaming (http://h264.code-shop.com/trac) may be helpful.
...specifically, the /AL option? I am porting some ancient C (a Freescale nee Motorala M68000 simulator) and I can't find it on MSDN. Google retrieves many non-related links, and the Wayback Internet Archive chokes beyond the "Product Release" page. Note that this switch seems not to be present in version 6, but resurfaces in .Net as:
"/AL Specifies a directory to search to resolve file references passed to the #using directive"
These files are neither C++ nor C#, su that ain't right...
an example: cl -c -AL CODE1.C
I guess it sets the memory model to Large. That page reminded me of it: http://msdn.microsoft.com/en-us/library/aa225257%28v=sql.80%29.aspx
Oh, those were the days...
Update: Here's the full set: http://gunkies.org/wiki/Microsoft_C_5.1