Giter VIP home page Giter VIP logo

judo.jl's Introduction

Judo is a Julia document generator. It takes documents written in pandoc markdown and converts them into html, but differs from general purpose markdown tools in a few ways.

  1. Code blocks can be executed and their results, including graphics, inlined in the document.
  2. Metadata can be attached to a document in the form of YAML front-matter (similar to Jekyll).
  3. Multiple documents can be compiled and cross-linked.
  4. Function and types comments can be parsed from Julia source code and included in a document. (Note: this is not fully implemented yet)

The end goal is to make documenting Julia code, whether it be a package, or some quick-and-dirty analysis, as painless as possible.

Status

This is work in progress. I'm using it to generate documentation for Gadfly, and figuring out the details as I go along. Contributions or feedback is welcomed.

judo.jl's People

Contributors

dchudz avatar dcjones avatar iainnz avatar shashi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

judo.jl's Issues

hide / display

(If I understood the doc correctly) to have a block and its output displayed, I have to use

```{.julia hide="false" display="true"}
Code goes here

Wouldn't it make more sense to use something like show as opposed to hide? This way the keyword would reflect the expected behavior, as opposed to thinking about the opposite?

Header level for docstrings

# Labels

{{labels}}
{{labels!}}

## Indexing

{{getlabel}}
{{setlabel!}}

This code gives you "Labels" as h1 and the rest of the titles are h2.
"getlabel" and "setlabel!" should be h3, shouldn't they?

Judo/Gadfly with PNG output?

When using Judo with Gadfly charts, is there a way to get Judo to render PNG output into a document (maybe inline?) instead of the d3 it does by default?

When I looked into the code, it seems like Judo's do something to handle various MIME types (including PNG), so maybe I'm just not seeing the way to do it.

I tried things like this (in my code block):

using Gadfly
p=plot(x=[1:10], y=[1:10])
draw(PNG(STDOUT, 12cm, 6cm), m)

Missing walkdir.jl

On line 10 in Judo.jl

include("walkdir.jl")

This file doesn't seem to exist.

Brilliant package btw - very much like knitr (might be worth a shout-out to knitr, whether or not you were inspired by it) -- I was really looking for something similar for Julia!

Can't display arrays?

I'm trying to display an array of values, but it doesn't seem to work. Here is my julia code:

```julia
x = Array(Float64, 5)
x
```

Which give me the following error:

ERROR: Error processing codeblock in document 02_competition:
MethodError(safeeval,(:x,))
 in error at ./error.jl:21
 in weave at /home/tpoisot/.julia/v0.3/Judo/src/Judo.jl:353
 in collate at /home/tpoisot/.julia/v0.3/Judo/src/collate.jl:119
 in include at /usr/bin/../lib64/julia/sys.so
 in include_from_node1 at ./loading.jl:128
 in process_options at /usr/bin/../lib64/julia/sys.so
 in _start at /usr/bin/../lib64/julia/sys.so
while loading /home/tpoisot/.julia/v0.3/Judo/bin/judo, in expression starting on line 39

As I said in #13 , the error disappears if I use print(x) (but then nothing is printed).

mdjl testing

I've tried out the mdjl branch now, and it looks like it works quite well. One issue is that quite a few characters are escaped that don't need to be, but it doesn't affect what's rendered. An example is here, the diff shows the mdjl branch vs. the old pandoc way of doing things.

JuliaImages/Images.jl@ed1afa2

Also, I noticed that the timestamp doesn't show up.

Thanks, I had no idea that it was possible to ditch pandoc for this!

Table of contents is broken

The table of content is fully expanded now, and links to other pages are broken. ".html" is missing from the href, and links to sections on other pages point to the same page.

Error on installation.

Hello,

I was trying to install Judo, as I want to use it for a little assignment, and I'm getting this:
julia> Pkg.add("Judo") ERROR: unknown package Judo [inlined code] from pkg/entry.jl:49 in anonymous at task.jl:447 [inlined code] from task.jl:422 in add at pkg/entry.jl:64 in add at pkg/entry.jl:73 in anonymous at pkg/dir.jl:31 in cd at file.jl:22 in cd at pkg/dir.jl:31 in add at pkg.jl:23

On 0.3 ?

Is it normal that I can't install it on 0.3.11 ? Using the instructions here: https://github.com/dcjones/Judo.jl/blob/master/doc/introduction.md

Here is the output.

xxxxxxx@yyyyy:~> julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.11
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |  x86_64-redhat-linux

julia> Pkg.add("Judo")
ERROR: unknown package Judo
 in wait at ./task.jl:53
 in sync_end at /usr/bin/../lib64/julia/sys.so
 in add at ./pkg/entry.jl:65
 in add at ./pkg/entry.jl:71
 in anonymous at ./pkg/dir.jl:28
 in cd at /usr/bin/../lib64/julia/sys.so
 in __cd#229__ at /usr/bin/../lib64/julia/sys.so
 in add at ./pkg.jl:20


Error with results="expression" in code chunk.

I'm having trouble getting the mdjl branch to work. Here is what I have done with v0.4

Pkg.clone("https://github.com/dcjones/Judo.jl.git")

then with the following small file (mini.md)


---
title: test
author: me
...

# Simple test

```{.julia results="expression"}
a = 1 + 2
b = a + 3
c = a * b
```

I get the error:

julia> Judo.collate(["mini.md"])
weaving mini
pandoc: when expecting a String, encountered Object instead

If I change the args to the code block to results="block" then it compiles okay.

Version info:

pandoc 1.13.2
julia version 0.4.0-pre

Warnings and Error on Julia 0.4 (mdjl branch)

diego@SIRRAH:~$ cat example.md 

---
title: Example
author: DZ
order: 1
...

# I

diego@SIRRAH:~$ /home/diego/.julia/v0.4/Judo/bin/judo example.md 

Warnings:

WARNING: Union(args...) is deprecated, use Union{args...} instead.
WARNING: Base.String is deprecated, use AbstractString instead.

Error:

ERROR: LoadError: unrecognized keyword argument "pandocargs"
 in include at ./boot.jl:261
 in include_from_node1 at ./loading.jl:304
 in process_options at ./client.jl:308
 in _start at ./client.jl:411
while loading /home/diego/.julia/v0.4/Judo/bin/judo, in expression starting on line 39

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.