ninenines / asciideck

Asciidoc for Erlang.
ISC License
35 stars 3 forks source link

Validation failed: no DTD found ! #2

Open jaynel opened 7 years ago

jaynel commented 7 years ago

I'm certain this is some sort of installation error on my part, but I'm having trouble getting a document to compile on my Mac OS X 10.11.6 laptop. Here's the output:

$ make asciidoc-guide
 GEN    distclean-asciidoc-guide
a2x -v -f pdf doc/src/guide/book.asciidoc && mv doc/src/guide/book.pdf doc/guide.pdf
a2x: args: ['--dblatex-opts', '-P latex.output.revhistory=0 -P doc.publisher.show=0 -P index.numbered=0', '--xsltproc-opts', '--stringparam use.id.as.filename 1', '-d', 'book', '--attribute', 'tabsize=4', '-v', '-f', 'pdf', 'doc/src/guide/book.asciidoc']
a2x: resource files: []
a2x: resource directories: ['/usr/local/etc/asciidoc/images', '/usr/local/etc/asciidoc/stylesheets']
a2x: executing: "/usr/local/bin/asciidoc.py" --backend docbook -a "a2x-format=pdf"  --doctype book --attribute "tabsize=4" --verbose  --out-file "/Users/jay/GitPeg/Tokenizer/doc/src/guide/book.xml" "/Users/jay/GitPeg/Tokenizer/doc/src/guide/book.asciidoc"

asciidoc: reading: /usr/local/etc/asciidoc/asciidoc.conf
asciidoc: reading: /Users/jay/GitPeg/Tokenizer/doc/src/guide/book.asciidoc
asciidoc: reading: /usr/local/etc/asciidoc/docbook45.conf
asciidoc: reading: /usr/local/etc/asciidoc/filters/code/code-filter.conf
asciidoc: reading: /usr/local/etc/asciidoc/filters/graphviz/graphviz-filter.conf
asciidoc: reading: /usr/local/etc/asciidoc/filters/latex/latex-filter.conf
asciidoc: reading: /usr/local/etc/asciidoc/filters/music/music-filter.conf
asciidoc: reading: /usr/local/etc/asciidoc/filters/source/source-highlight-filter.conf
asciidoc: reading: /usr/local/etc/asciidoc/lang-en.conf
asciidoc: writing: /Users/jay/GitPeg/Tokenizer/doc/src/guide/book.xml
asciidoc: include: /Users/jay/GitPeg/Tokenizer/doc/src/guide/overview.asciidoc
asciidoc: book.asciidoc: line 8: reading: /Users/jay/GitPeg/Tokenizer/doc/src/guide/overview.asciidoc

a2x: executing: "xmllint" --nonet --noout --valid "/Users/jay/GitPeg/Tokenizer/doc/src/guide/book.xml"

/Users/jay/GitPeg/Tokenizer/doc/src/guide/book.xml:2: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
D DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
                                                                               ^
/Users/jay/GitPeg/Tokenizer/doc/src/guide/book.xml:6: validity error : Validation failed: no DTD found !
<book lang="en">
               ^

a2x: ERROR: "xmllint" --nonet --noout --valid "/Users/jay/GitPeg/Tokenizer/doc/src/guide/book.xml" returned non-zero exit status 4
make: *** [erlang.mk:5238: asciidoc-guide] Error 1

I've been trying to install according to this http://stackoverflow.com/questions/13519203/git-compilingdocumentation-git-add-xml-does-not-validate

I don't have brew or fink, so I installed http://www.linuxfromscratch.org/blfs/view/cvs/pst/xmlto.html by hand doing the steps for docbook-xml-4.5, docbook-xsl-1.79.1, and libxslt-1.1.29. I built dblatex-0.3.9 and asciidoc-8.6.9 from source.

I installed the catalog stuff in /usr/local/etc/xml/catalog and /usr/local/etc/xml/docbook, updated the $XML_CATALOG_FILES env. Running 'xmllint --help' it said it looks in /etc/xml/catalog by default so I made that a symbolic link to my /usr/local/etc/xml/catalog just in case.

$ ls -l /etc/xml/catalog
lrwxr-xr-x  1 root  wheel  26 Dec 17 08:24 /etc/xml/catalog -> /usr/local/etc/xml/catalog

$ file !$
file /etc/xml/catalog
/etc/xml/catalog: XML  document text

$ cat !$
cat /etc/xml/catalog
<?xml version="1.0"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
  <delegateURI uriStartString="http://www.oasis-open.org/docbook/" catalog="file:///usr/local/etc/xml/docbook"/>
</catalog>

$ cat /usr/local/etc/xml/docbook
<?xml version="1.0"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
  <rewriteURI uriStartString="http://www.oasis-open.org/docbook/xml/4.5" rewritePrefix="file:///usr/local/etc/xml/docbook/xml-dtd-4.5"/>
</catalog>

Any clues what else I need to do?

jaynel commented 7 years ago

Seems I don't have docbook-xsl installed properly. Where do you put that directory? Is it invoked by something?

I put it in /usr/local/etc/xml/docbook-xsl-1.79.1 then tried to run ./install.sh from inside that directory:

$ ./install.sh 

NOTE: For non-interactive installs/uninstalls, use --batch

NOTE: There is no CLASSPATH variable set in your environment.
      No attempt was made to find a CatalogManager.properties
      file.  Using /Users/jay/.resolver/CatalogManager.properties instead

Create /Users/jay/.resolver/CatalogManager.properties file? [Yes] Y

cp: /usr/local/etc/xml/docbook-xsl-1.79.1/.CatalogManager.properties.example: No such file or directory
essen commented 7 years ago

The guide is still generated by Asciidoc (Python). I am hoping to have a good HTML/PDF output from Asciideck (Erlang) in a couple weeks and just use that from that point onward. Much less dependencies.

Asciidoc depends on a lot of stuff and I never installed from source. It does require docbook-xsl. On my system (Arch Linux) they are at /usr/share/xml/docbook/xsl-stylesheets-1.79.1. I don't know where OSX puts them. On the test OSX machine I used Homebrew to install Asciidoc, and I have no idea where the files are. :-)

jaynel commented 7 years ago

I had to use asciideck as a dependency in erlang.mk Makefile to get it running. You are saying that the dependency will use a different generation method in a couple weeks and maybe all this docbook-xsl stuff will go away?

essen commented 7 years ago

Yes the idea is to have a path to HTML/PDF that doesn't use DocBook by default. I will spend the week between Xmas and New Year exclusively on that. I've probably put the Asciideck dependency requirement a bit early all things considered.

jaynel commented 7 years ago

Ok, thanks. Will focus on writing my docs over the holidays. Hopefully I can compile them in the New Year. It's looking to be a very useful addition to erlang.mk!

essen commented 7 years ago

I'll ping here when I've made (some) progress. It'll be useful to see what you use from Asciidoc, it's a big format and I won't have time to implement every little things in one week. :-)

jaynel commented 7 years ago

I just need basic outline include (overview like you do), paragraphs, source code quotes, numbered and bullet lists, maybe tables, and embedded images. The Notes, Warnings, etc would be embellishments, but don't need them necessarily. Later on I can add Table of Contents, page numbering, etc, just need to get some documentation in place right now that is organized.

essen commented 7 years ago

Don't let me stop you from using anything. I'll add as necessary. Most block constructs are easy to add, so it's not a problem. I'm actually looking forward to get documents that contain things I don't use myself.

essen commented 6 years ago

I've finished the rewrite of this project. I will soon update Erlang.mk to use it for generating the guide, but it'll take a bit more time. See https://ninenines.eu/articles/asciideck/ for the announcement.