lcw / jocco

Jocco is Docco in Julia
http://lcw.github.com/jocco/
The Unlicense
24 stars 6 forks source link

Assertion fails outside ~/jocco directory #3

Closed acgetchell closed 11 years ago

acgetchell commented 11 years ago

First, let me demonstrate that I have Pygments installed:

~/Projects/testjulia/ProjectEuler pygmentize Usage: /usr/local/share/python/pygmentize [-l | -g] [-F [:]] [-f ] [-O ] [-P ] [-o ] []

   /usr/local/share/python/pygmentize -S <style> -f <formatter> [-a <arg>] [-O <options>] [-P <option=value>]

...

It works in the jocco directory:

~/jocco (master ✗) julia jocco.jl jocco.jl process_defaultadd: n=-1 tag.data='NGENRE' level=0 process_defaultadd: n=-1 tag.data='GENRE' level=1 jocco.jl --> ./docs/jocco.html ~/jocco (master ✗) cd docs/ ~/jocco/docs (master ✗) ls -al total 144 drwxr-xr-x 6 getchell AESDEAN\Domain Users 204 May 29 14:55 . drwxr-xr-x 7 getchell AESDEAN\Domain Users 238 May 29 14:46 .. -rw-r--r-- 1 getchell AESDEAN\Domain Users 799 May 29 14:46 jocco.bib -rw-r--r-- 1 getchell AESDEAN\Domain Users 15715 May 29 14:46 jocco.csl -rw-r--r-- 1 getchell AESDEAN\Domain Users 7215 May 29 14:46 jocco.css -rw-r--r-- 1 getchell AESDEAN\Domain Users 43085 May 29 15:06 jocco.html ~/jocco/docs (master ✗) date Wed May 29 15:07:48 PDT 2013

But not elsewhere:

~/jocco (master ✗) cp jocco.jl ~/Projects/testjulia/ProjectEuler/ ~/jocco (master ✗) ls README UNLICENSE docs jocco.jl ~/jocco (master ✗) cmp jocco.jl ~/Projects/testjulia/ProjectEuler/jocco.jl ~/jocco (master ✗) ~/jocco (master ✗) cd ~/Projects/testjulia/ProjectEuler/ ~/Projects/testjulia/ProjectEuler ls jocco.jl problem7.jl problem8.jl problem9.jl ~/Projects/testjulia/ProjectEuler julia jocco.jl problem7.jl ERROR: assertion failed: ? in error at error.jl:22 in assert at error.jl:43 in generate_html at /Users/getchell/Projects/testjulia/ProjectEuler/jocco.jl:285 in generate_documentation at /Users/getchell/Projects/testjulia/ProjectEuler/jocco.jl:302 in main at /Users/getchell/Projects/testjulia/ProjectEuler/jocco.jl:316 in include_from_node1 at loading.jl:91 in process_options at client.jl:251 in _start at client.jl:336 at /Users/getchell/Projects/testjulia/ProjectEuler/jocco.jl:320 ~/Projects/testjulia/ProjectEuler ls docs jocco.jl problem7.jl problem8.jl problem9.jl ~/Projects/testjulia/ProjectEuler cd docs/ ~/Projects/testjulia/ProjectEuler/docs ls problem7.html ~/Projects/testjulia/ProjectEuler/docs cat problem7.html ~/Projects/testjulia/ProjectEuler/docs

Directories and files get created, but nothing is in them.

acgetchell commented 11 years ago

This works now as follows:

Comment highlighting: doesn't work LaTeX: works References: doesn't work

screen shot 2013-05-29 at 3 52 24 pm

lcw commented 11 years ago

On Wed, May 29, 2013 at 03:53:38PM -0700, Adam Getchell wrote:

This works now as follows:

Comment highlighting: doesn't work LaTeX: works References: doesn't work

screen shot 2013-05-29 at 3 52 24 pm

Great! You are almost there.

I reverted the commit to remove the pandoc filters as the still seem to work on my mac. I am not sure why the pandoc filters don't work on my debian machine. This should give you comment highlighting.

To get references and comment highlighting to work on your own project you need to copy all of the files from jocco's docs directory to the docs directory where the documentation will be generated, e.g.,

$ git clone git://github.com/lcw/jocco $ mkdir new_project $ cd new_project $ vim try.jl $ mkdir docs $ cp ../jocco/docs/* docs $ julia ../jocco/jocco.jl try.jl

Let me know if it works for you. If it doesn't work for you what does pandoc --version return?

Lucas

acgetchell commented 11 years ago

Now the syntax highlighting works, but LaTeX or comment parsing doesn't.

Here's the gist to the source for problem7.jl:

https://gist.github.com/acgetchell/5681609

Here's the messages from the terminal:

~/Projects/testjulia/ProjectEuler julia jocco.jl problem7.jl execvp(): No such file or directory execvp(): No such file or directory process_defaultadd: n=-1 tag.data='NGENRE' level=0 process_defaultadd: n=-1 tag.data='GENRE' level=1 pandoc: Malformed JSON: invalid token in this context problem7.jl --> ./docs/problem7.html ~/Projects/testjulia/ProjectEuler pandoc --version pandoc 1.11.1 Compiled with citeproc-hs 0.3.8, texmath 0.6.1.3, highlighting-kate 0.5.3.8. Syntax highlighting is supported for the following languages: actionscript, ada, apache, asn1, asp, awk, bash, bibtex, boo, c, changelog, clojure, cmake, coffee, coldfusion, commonlisp, cpp, cs, css, curry, d, diff, djangotemplate, doxygen, doxygenlua, dtd, eiffel, email, erlang, fortran, fsharp, gnuassembler, go, haskell, haxe, html, ini, java, javadoc, javascript, json, jsp, julia, latex, lex, literatecurry, literatehaskell, lua, makefile, mandoc, matlab, maxima, metafont, mips, modula2, modula3, monobasic, nasm, noweb, objectivec, objectivecpp, ocaml, octave, pascal, perl, php, pike, postscript, prolog, python, r, relaxngcompact, rhtml, ruby, rust, scala, scheme, sci, sed, sgml, sql, sqlmysql, sqlpostgresql, tcl, texinfo, verilog, vhdl, xml, xorg, xslt, xul, yacc, yaml Default user data directory: /Users/getchell/.pandoc Copyright (C) 2006-2013 John MacFarlane Web: http://johnmacfarlane.net/pandoc This is free software; see the source for copying conditions. There is no warranty, not even for merchantability or fitness for a particular purpose. ~/Projects/testjulia/ProjectEuler cd docs ~/Projects/testjulia/ProjectEuler/docs ls -al total 176 drwxr-xr-x 9 getchell 2129169278 306 May 30 14:55 . drwxr-xr-x 8 getchell 2129169278 272 May 30 14:55 .. -rw-r--r-- 1 getchell 2129169278 267 May 30 14:33 doiLinks.hs -rw-r--r-- 1 getchell 2129169278 799 May 29 14:46 jocco.bib -rw-r--r-- 1 getchell 2129169278 15715 May 29 14:46 jocco.csl -rw-r--r-- 1 getchell 2129169278 7215 May 29 14:46 jocco.css -rw-r--r-- 1 getchell 2129169278 43085 May 29 15:06 jocco.html -rw-r--r-- 1 getchell 2129169278 5750 May 30 14:55 problem7.html -rw-r--r-- 1 getchell 2129169278 958 May 30 14:33 pygments.hs ~/Projects/testjulia/ProjectEuler/docs

Here's the results:

screen shot 2013-05-30 at 2 57 48 pm

lcw commented 11 years ago

I think you don't have runhaskell installed on your computer. You need this to run the pandoc filters (doiLinks.hs and pygments.hs). You do not need these for the example you provided. Try deleting all of the files ending in .hs from your docs directory. The jocco.css file in the docs directory is what is providing your syntax highlighting.

acgetchell commented 11 years ago

Okay, this works now without doiLinks.hs and pygments.hs:

~/Projects/testjulia/ProjectEuler julia jocco.jl problem7.jl process_defaultadd: n=-1 tag.data='NGENRE' level=0 process_defaultadd: n=-1 tag.data='GENRE' level=1 problem7.jl --> ./docs/problem7.html ~/Projects/testjulia/ProjectEuler open docs/problem7.html ~/Projects/testjulia/ProjectEuler cd docs ~/Projects/testjulia/ProjectEuler/docs ls jocco.bib jocco.csl jocco.css jocco.html problem7.html

I went and installed Haskell, Haskell-Platform, and updated packages:

~/jocco/docs (master ✗) brew install ghc ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/ghc-7.6.3.mountain_lion.bottle.tar.gz ######################################################################## 100.0% ==> Pouring ghc-7.6.3.mountain_lion.bottle.tar.gz ==> Caveats This brew is for GHC only; you might also be interested in haskell-platform. ==> Summary /usr/local/Cellar/ghc/7.6.3: 5286 files, 776M ~/jocco/docs (master ✗) which runhaskell /usr/local/bin/runhaskell

Getting the pandoc filters was a matter of installing haskell, haskell-platform, and then running cabal to install pandoc:

~/jocco/docs (master ✗) brew install ghc ==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/ghc-7.6.3.mountain_lion.bottle.tar.gz ######################################################################## 100.0% ==> Pouring ghc-7.6.3.mountain_lion.bottle.tar.gz ==> Caveats This brew is for GHC only; you might also be interested in haskell-platform. ==> Summary /usr/local/Cellar/ghc/7.6.3: 5286 files, 776M ~/jocco/docs (master ✗) brew install haskell-platform ==> Downloading http://lambda.haskell.org/platform/download/2013.2.0.0/haskell-platform-2013.2.0.0.tar.gz ######################################################################## 100.0% ==> ./configure --prefix=/usr/local/Cellar/haskell-platform/2013.2.0.0 ==> make install ==> Caveats Run cabal update to initialize the package list.

If you are replacing a previous version of haskell-platform, you may want to unregister packages belonging to the old version. You can find broken packages using: ghc-pkg check --simple-output You can uninstall them using: ghc-pkg check --simple-output | xargs -n 1 ghc-pkg unregister --force ==> Summary /usr/local/Cellar/haskell-platform/2013.2.0.0: 1463 files, 232M, built in 12.6 minutes ~/jocco/docs (master ✗) cabal update Config file path source is default config file. Config file /Users/getchell/.cabal/config not found. Writing default configuration to /Users/getchell/.cabal/config Downloading the latest package list from hackage.haskell.org ~/jocco/docs (master ✗) cabal install pandoc Resolving dependencies... Downloading List-0.5.1... Configuring List-0.5.1... Building List-0.5.1... Preprocessing library List-0.5.1...

And now:

~/Projects/testjulia/ProjectEuler/docs ls doiLinks.hs jocco.bib jocco.csl jocco.css jocco.html problem7.html pygments.hs

~/Projects/testjulia/ProjectEuler julia jocco.jl problem7.jl process_defaultadd: n=-1 tag.data='NGENRE' level=0 process_defaultadd: n=-1 tag.data='GENRE' level=1 problem7.jl --> ./docs/problem7.html

Thanks for all the help. I'll submit a pull request to update the documentation.

lcw commented 11 years ago

Glad to hear it works. An update to the documentation would be great!

Is the alignment of the code and docs still off? I have a feeling the update to the current version of julia has broken the alignment.

acgetchell commented 11 years ago

It looks good to me. I did a fresh pull/build of julia this morning, and with your fixes jocco.jl produces nice results:

~/Projects/testjulia/ProjectEuler julia -v julia version 0.2.0-1745.r5f3c8f40 ~/Projects/testjulia/ProjectEuler julia jocco.jl problem7.jl process_defaultadd: n=-1 tag.data='NGENRE' level=0 process_defaultadd: n=-1 tag.data='GENRE' level=1 problem7.jl --> ./docs/problem7.html ~/Projects/testjulia/ProjectEuler open docs/problem7.html

screen shot 2013-05-30 at 4 55 32 pm

lcw commented 11 years ago

Great. Glad it is working for you.