GithubHelp home page GithubHelp logo

vim-daps's People

Contributors

tbazant avatar

Watchers

 avatar

Forkers

aginies

vim-daps's Issues

Improve import of entities

...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

omnicompletion of xml:id's with profiling

...for easy finding out which DC-* files inlude book(s) with the specific xml:id.

Useful for:

  • auto-completion of xref linkends
  • tab-completion of a DC-file when issuing :Daps DC- to only list valid DC-files

Small howto:

  1. Create a bigfile
  2. Run xsltproc --output OUT.txt /local/doc/daps/daps-xslt/common/get-bookstructure.xsl BIGFILE
  3. grep YOUR_ID OUT.txt
  4. Done. :)

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.

Maybe remove g:daps_dcfile_autostart ?

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.

Create itemized list out of visually selected lines

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>

Building PDFs does not work

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"

Add 'list-file' to open <xref>'s target in a new tab and <link>s in a browser.

  • either read the target ID from the current line under the cursor DONE
  • or let the user specify it on the :DapsListFile cmdline DONE
  • and possibly add tab-completion of the IDs from the current file DONE
  • change the function name to :DapsOpenTarget
  • check if '<link xlink:href="http' is under the cursor and open default web viewer to open the referenced web page
  • what if there are more targets (mixed) on the same line? do foreach and test if it's xref or link, and open either new tab or browser

Create a function DapsWhatRefersHere

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

Hardwire doctype resolving for the jing command

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

Make importing entites conditional

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

g:xmldata_docbook50[] array name should not be hard-wired

the "docbook50" part of the array name changes according to the used DTD file, for example docbook50.vim.

  • make the used DocBook version an option in .vimrc
  • add a Daps... command to chnage the DB version
  • set XMLns accordingly
  • import entities

Study and fix filetype plugins loading

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.

Check the root element of the open file before building a target

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 

Building pdf or html works but throws errors

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

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.