tbazant / vim-daps Goto Github PK
View Code? Open in Web Editor NEWAdds daps (https://opensuse.github.io/daps) functionality to the Vim text editor.
Adds daps (https://opensuse.github.io/daps) functionality to the Vim text editor.
...so that it happens automaticall on file opening, reading the filename from the snippet.
Make use of tom's script found in daps repo at
$DAPSREPO/contrib/bin/listentities.py
Run daps validate
before running daps pdf
or daps html
to ensure correct error message appears.
When doing a Git commit vie plugin, it checks style which is truly funny :-)
check if the opened page is from fugitive world (G*) and do not import entities from that file
...if xdg-open is not the prefered solution
the one from Stefan
...for easy finding out which DC-* files inlude book(s) with the specific xml:id.
Useful for:
Small howto:
Last note from toms: I committed & pushed in the daps repo the file daps-xslt/common/get-all-xmlids.xsl
With that file, you could do a for loop, create a bigfile from each DC file, pass the file to the above stylesheet and grep.
like that
daps -m xml/apparmor_profiles.xml html --single --norefcheck
It is hardwired now in the plugin and takes what daps offers
To build the tarball for online publication
...just because they are written across the current vim buffer
It's annoying to enter the DC file path on every 'vim *.xml' startup if I only want to edit a file without validating or building it.
Instead, ask for the file when the action (build, validate...) requires it and it is not set.
Let the user specify where to build the targets
First extend ctags - rbd-mirror-daemon.png
Then configure TagList - http://vim-taglist.sourceforge.net/extend.html
if i visually select lines
fds fd fsdfsd f s
fs fd fdfsd
fsdfds fsdfsdf
f sdf df d fs
i will get
<itemizedlist>
<listitem>
<para>
fds fd fsdfsd f s
</para>
</listitem>
.....
</itemizedlist>
make it possible with a shortcut to shift
<sect1>
<sect2>
<sect3>
......
</sect3>
</sect2>
</sect1>
into
<sect2>
<sect3>
<sect4>
......
</sect4>
</sect3>
</sect2>
and the other way round
...and DapsImportEntities fails as well during startup
Yes, it has nothing to do with daps. Dont forget it depends on vim-xml!
Integrate daps-xmlformat, reload the buffer, and return the cursor to the original position.
when opening the PDF file, the log spits "xdg-open /home/tbazant/devel/daps/libexec/daps-jing: řádek 4: /usr/lib/java-wrappers/java-wrappers.sh: Adresář nebo soubor neexistuje"
Hi Toms, do we have a script/command that would find places in a XML book that refer to a given ID? Some 'WhatRefersHere' function?
And this one gives you a TOC with IDs and section level: xsltproc --xinclude /local/git/daps/daps-xslt/common/get-headlines-ids.xsl xml/MAIN.SLEDS.xml
In the daps repo on GitHub, I've submitted a new stylesheet in the develop branch: list-xmlids.xsl
.
As the name implies, it lists all xml:id
attributes. Run it with:
xsltproc daps-xslt/contrib/list-xmlids.xsl XMLFILE
By default, the xml:id
's are separated by spaces, but you can change that with the parameter separator
like this (here you change it to a colon):
xsltproc --stringparam separator ":" daps-xslt/contrib/list-xmlids.xsl XMLFILE
by means of the following great function
let g:pluginname_setting = get(g:, 'pluginname_setting', "default")
In the DapsValidateFile() function, the line is hardwired:
let l:jing_cmd = 'jing -i /usr/share/xml/docbook/schema/rng/5.1/docbookxi.rng ' . expand('%')
we need to replace the path to rnc file with a catalog lookup, something like
jing -ci $(xmlcatalog /etc/xml/catalog https://github.com/openSUSE/geekodoc/raw/master/geekodoc/rng/geekodoc5-flat.rnc) $FILE
Another possibility would be to look for schemas.xml file in the xml/ subdirectory and get the value from there
epub + man + mobi + text + webhelp
If XML entities are imported (automatically with g:daps_entity_import_autostart), vim-daps should first check whether there is an entity reference in the DocBook file at all before trying to import it. Now it results in No entity file(s) could be extracted, specify them on the command line
Let the user use their own stylesheets.
the "docbook50" part of the array name changes according to the used DTD file, for example docbook50.vim.
There is a ftplugin/docbk.vim and ftplugin/xml.vim in the standard vim distribution. Docbook document first loads docbk.vim, then xml.vim, but because of the b:did_ftplugin is already set, the second one (xml.vim) does not get loaded and the XMLns command is not available for vim-daps to importentities.
When the file's root element is <sect2/>
, its root ID cannot be used for building PDF or HTML as it's not supported. In that xase, omit the rootid=
argument from the build command line
UPDATE: build only the following rootid's:
appendix
article
bibliography
book
chapter
colophon
dedication
glossary
index
part
preface
refentry
reference
set
setindex
throughout the script file so that it is easy to debug variable on the run
Chyba při zpracování function 31_DapsBuild[2]..31_DapsValidate:
řádek 3:
E121: Nedefinovaná proměnná: b:daps_auto_validate_file
E15: Chybný výraz: b:daps_auto_validate_file == 1 && s:DapsValidateFile() == 1
Something similar to
'<,'>!xmlformat.pl -f /etc/daps/docbook-xmlformat.conf
remember to shift the whoile formatted block accordingly afterwards (=)
When building HTML, identify if the cursor is inside a xml:id and set --rootid accordingly
Otherwise daps outputs '...ntp_client.png not optimized' and that it taken as an input for xdg-open command
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.