Giter VIP home page Giter VIP logo

tubaina's Introduction

Caelum Tubaina Build Status

Summary

Tubaina is a textbook generator which receives a simple markup language syntax and outputs Xhtml and Latex.

Changelog

  • August 07, 2012 A lot of bugs fixed and new features added since last update of this changelog, here are some of them:
    • it's possible to define boolean variables (in a similar way as C ifdef) to be avaiable at ftl templates with the option -e <var1> <var2>...
    • new output option (-kindle) added to generate html output focused on building ebooks such as .epub or .mobi formats.
    • a book may be splitted in multiple parts simply by adding [part <title>] tag at the beginning of a chapter.
    • a new tag to render code published at gist: [gist <gist-id>]
  • September 15, 2011 Dropped support for one section per page, HTML. Instead, the -html option will generate an experimental one-page textbook (in which we're working :) ).
  • April 28, 2011 Support to syntax highlighting using Pygments (in many many languages).
  • October 24, 2010 Discontinuation of Maven as a build tool. Gradle is the new choice.
  • Aug 17, 2009 New output format --htmlflat (HTML output with one page per chapter).
  • Aug 6, 2009 Support for more than one chapter per afc file has been dropped. Please split your chapters in multiple files.

Developers' info

This project is built using Gradle (0.9rc1+). In order for it to behave like an Eclipse project you'll need to have Gradle installed (instructions to be found at: http://www.gradle.org/installation.html) and then run:

$ cd path/to/tubaina
$ gradle eclipse

You need pygments to run the tests, you can install it through easy_install (you should be able to install easy_install with your SO package manager):

$ easy_install Pygments==1.5

In order to build the distribution version do:

$ cd path/to/tubaina
$ gradle clean build zip

This will run the tests and, among other stuff, build a *.zip file with Tubaina's jar and all necessary libraries under build/distributions

Docker image

There's a Docker image that you can use to easilly install all dependencies of Tubaina.

If you want to build the latest version you can build your own image using [this Dockerfile] (https://github.com/caelum/tubaina/blob/master/src/docker/tubaina/Dockerfile) by running:

docker build -t csokol/tubaina src/docker/tubaina

If you don't want to build from latest sources, you can use the docker image available at [DockerHub] (https://registry.hub.docker.com/u/csokol/tubaina/) by running docker pull csokol/tubaina

After installing the image, independently of building from sources of downloading from DockerHub, you can run docker run -t -i csokol/tubaina java -jar /opt/tubaina/tubaina-1.8-SNAPSHOT.jar to execute tubaina jar.

tubaina's People

Contributors

adrianoalmeida7 avatar ceci avatar csokol avatar gabrielso avatar jonasabreu avatar josedonizetti avatar leocwolter avatar lucascs avatar lucasmazza avatar luiz avatar marcosalles avatar orthographic-pedant avatar osnipso avatar peas avatar pmariano avatar rponte avatar sergiolopes 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tubaina's Issues

Disponibilizar a build compilada

Olá Pessoal,

Tive muito trabalho em compilar, procurei um gradle que conseguisse compilar corretamente, instalei o pygmentize, enfim, eu tenho a build e basta instalar o pygmentize para funcionar, se for ok eu posso disponibilizar.

Abraços

Tabelas não quebram linha

Quando o conteúdo de uma coluna é muito grande para caber em uma linha, na hora de gerar o pdf essa linha não é mostrada inteira na página e também o conteúdo restante não é enviado para a linha debaixo.

Erro com a inserção de trechos de código

Prezados, coloquei o seguinte código em uma apostila que eu estou desenvolvendo, mas um erro surgiu e nenhum código, java, ruby, etc, funciona. Somente a tag [code] não dá erro.

[java]
package com.example.myfirstapp;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;

public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);
    return true;
}

}
[/java]

Segue o erro:

lion:android mac$ java -jar apostila-1.8-SNAPSHOT.jar -html -htmlflat -i doc -o apostilas-geradas/apostila-android -n "Apostila Android"
21:06:12,533 DEBUG [Tubaina ] Parsing arguments [-html, -htmlflat, -i, doc, -o, apostilas-geradas/apostila-android, -n, Apostila Android]
21:06:12,553 INFO [ResourceLocator ] Initializing ResourceLocator at dir: /Users/mac/Dropbox/ledes - li?deres/Treinamento Android/apostila/android/doc
21:06:12,561 INFO [BookBuilder ] Parsing chapter 1 - 01-instalando-android.afc
21:06:13,265 INFO [BookBuilder ] Parsing chapter 2 - 02-conceitos.afc
21:06:13,269 INFO [BookBuilder ] Parsing chapter 3 - 03-componentes.afc
21:06:13,273 INFO [BookBuilder ] Parsing chapter 4 - 06-projeto-exemplo.afc
21:06:13,302 INFO [BookBuilder ] Parsing chapter 5 - 07-banco-de-dados.afc
21:06:13,320 INFO [BookBuilder ] Parsing chapter 6 - 08-trabalhando-com-intents.afc
21:06:13,329 INFO [BookBuilder ] Parsing chapter 7 - 10-arquivos.afc
21:06:13,335 INFO [BookBuilder ] Parsing chapter 8 - 11-webservices.afc
21:06:13,346 INFO [BookBuilder ] Parsing chapter 9 - 12-custom-views.afc
Exception in thread "main" com.google.inject.ConfigurationException: Guice configuration errors:

  1. No implementation for br.com.caelum.tubaina.parser.Tag<br.com.caelum.tubaina.chunk.RubyChunk> was bound.
    while locating br.com.caelum.tubaina.parser.Tag<br.com.caelum.tubaina.chunk.RubyChunk>
    for field at br.com.caelum.tubaina.AbstractChunk.tag(AbstractChunk.java:7)
    while locating br.com.caelum.tubaina.chunk.RubyChunk

1 error
at com.google.inject.internal.InjectorImpl.getMembersInjector(InjectorImpl.java:952)
at com.google.inject.internal.InjectorImpl.getMembersInjector(InjectorImpl.java:957)
at com.google.inject.internal.InjectorImpl.injectMembers(InjectorImpl.java:943)
at br.com.caelum.tubaina.parser.TubainaModule.inject(TubainaModule.java:79)
at br.com.caelum.tubaina.parser.TubainaModule.inject(TubainaModule.java:64)
at br.com.caelum.tubaina.parser.TubainaModule.inject(TubainaModule.java:101)
at br.com.caelum.tubaina.parser.TubainaModule.inject(TubainaModule.java:58)
at br.com.caelum.tubaina.parser.TubainaModule.inject(TubainaModule.java:96)
at br.com.caelum.tubaina.parser.TubainaModule.inject(TubainaModule.java:51)
at br.com.caelum.tubaina.parser.TubainaModule.inject(TubainaModule.java:33)
at br.com.caelum.tubaina.TubainaBuilder.build(TubainaBuilder.java:73)
at br.com.caelum.tubaina.Tubaina.main(Tubaina.java:34)

highlights not working with [code...] tag

It was not even parsed until yesterday. Have to check the pygments-hack we-ve built for that.

If I type:

[code java h=2, 3]
public static void main(String[] args) {
String message = "Some text";
System.out.println(message);
}
[/code]

Lines 2 and 3 should be highlighted in LaTeX output.

Problema na geração para utilização local

No caso de utilizar o documento gerado localmente (não acessar via servidor web) é encontrado um problema. Como não existe referência ao "index.html" os navegadores interpretam como uma navegação de diretórios, o que deixa o usuário um pouco confuso. Na geração dos dados da variável "dirTree", seria interessante que fosse possível configurar se o usuário quer utilizar o "index.html" na criação dos links. Na maioria dos casos é possível construir esta customização via templates, porém no caso de seções não é possível. Obrigado.

Create a cache of code generated by pygments

It would be nice to create a cache of code tags to make the build process of the afc's faster.

We could call pygments directly from tubaina (and drop minted) , or create a wrapper of pygments which would be called by minted.

This cache could be placed at ~/.tubaina/codecache/ and each time you need that code you should check a hash from that code and verify if there is already a file for that at the cache dir.

Melhorar mensagem de erro na compilação

O trecho abaixo está com um erro de sintaxe:

O fato do ::var%% %%+%% do nosso ::namespace:: apontar para a função

O correto seria fechar o :: após a palavra var, mas o compilador não acusou esse erro. Ao invés disso, recebi apenas as mensagens abaixo:

This is BibTeX, Version 0.99d (TeX Live 2011)
The top-level auxiliary file: book.aux
I found no \bibdata command---while reading file book.aux
I found no \bibstyle command---while reading file book.aux
(There were 2 error messages)
This is makeindex, version 2.15 [TeX Live 2011] (kpathsea + Thai support).
Scanning input file book.idx....done (245 entries accepted, 1 rejected).
Sorting entries.....done (2042 comparisons).
Generating output file book.ind....done (287 lines written, 0 warnings).
Output written in book.ind.
Transcript written in book.ilg.
/tmp/clojure-565-pdf/
mv: cannot stat `book.pdf': No such file or directory

E em nenhum momento o uso incorreto da formatação é citado.

Tag for blockquoting (inside text)

Tubaina already has a tag for quoting citations, but it is intended for simple quotes at the beginning of a chapter or section.

Wouldn't it be nice to have a tag for citing a paragraph, like Markdown, but with the possibility of citing the author also?

Exception on "image not exists" not clear enough

It would be better to know exactly what image generated the error, now the exception message looks like this:

19:10:44,569  INFO [BookBuilder         ] Parsing chapter 12
br.com.caelum.tubaina.TubainaException: Image not existant

    at br.com.caelum.tubaina.builder.replacer.ImageReplacer.createChunk(ImageReplacer.java:37)
    at br.com.caelum.tubaina.builder.replacer.PatternReplacer.execute(PatternReplacer.java:20)
    at br.com.caelum.tubaina.builder.ChunksMaker.make(ChunksMaker.java:21)
    at br.com.caelum.tubaina.builder.ChunkSplitter.splitChunks(ChunkSplitter.java:20)
    at br.com.caelum.tubaina.builder.ChapterBuilder.build(ChapterBuilder.java:53)
    at br.com.caelum.tubaina.builder.BookBuilder.parse(BookBuilder.java:76)
    at br.com.caelum.tubaina.builder.BookBuilder.build(BookBuilder.java:46)
    at br.com.caelum.tubaina.TubainaBuilder.build(TubainaBuilder.java:70)
    at br.com.caelum.tubaina.Tubaina.main(Tubaina.java:34)
Caused by: javax.imageio.IIOException: Can't create an ImageInputStream!
    at javax.imageio.ImageIO.read(ImageIO.java:1306)
    at br.com.caelum.tubaina.builder.replacer.ImageReplacer.createChunk(ImageReplacer.java:34)
    ... 8 more

add a -c argument for different code line length

today, this number is at 93 (which fits for A4 format), however, for different formats, this should change. 93 can still be the default value. Also, when printing the error when exceeding this number, we should show the length being used.

Failed clean build, breaks on jai_codec

I tried to build on a mac osx lion using gradle clean build, but it fails with the error

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not resolve all dependencies for configuration ':compile'.

    Artifact 'com.sun.media:jai_codec:1.1.2_01@jar' not found.

How to resolve it?

Exception java.lang.ClassNotFoundException ao rodar o Tubaina

Executei o jar do tubaina, mas acorreu uma exception. Abaixo segue o erro e a versão do java instalado na minha máquina.

java -jar tubaina-1.8-SNAPSHOT.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/cli/ParseException
Caused by: java.lang.ClassNotFoundException: org.apache.commons.cli.ParseException
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

lion:apostila mac$ java -version
java version "1.6.0_51"
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457-11M4509)
Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-457, mixed mode)

decouple latex code from CodeTag

Instead of putting latex raw code in latex's CodeTag, make an \tubainaCode environment in templates and change java code accordingly.

Building Tubaina

I followed the content in the docs folder but i couldn't build tubaina with the JAR file. When running:

gradle clean zip

I got a zip package without the tubaina JAR. To make the zip content be packaged with a JAR file i runned:

gradle clean jar zip

Maybe add a note about it in the docs would be nice. Another point is that i runned every command in the docs, but the HTML output couldn't be generated. When i installed the pygments package through apt everything worked fine:

sudo apt-get install python-pygments

Using a sequence of _______ characters

It would be nice to be able to use a _________ character sequence into afc files. When you try to use it, you get some tubaina errors, as _____ character sequence meas underlined word.

[Off-topic?] O nome desse projeto é uma referência ao Tubaína?

Senhores e Senhoritas,

Desculpe abrir uma issue, não consegui achar um fórum ou outra coisa do projeto. Realmente fiquei MUITO curioso em relação ao nome do projeto. Antigamente (bem antigamente), onde cresci, havia um refrigerante chamado Tubaína, vendido em garrafas de cerveja. É uma das memórias mais legais que tenho daqueles tempos, hehe. Comprar um Tubaína para o almoço do domingo xD

O nome desse projeto é uma referência/homenagem/whatever a esse refrigerante? xP

Foto do dito-cujo: http://refrigerando.files.wordpress.com/2012/05/img_1763.jpg

Negrito em código java

Quando uso o # h= 2, 3 em [java] ele está marcando as linhas 1, 2.
Exemplo:
[java # h=2]
public static void main(String... arg) {
System.out.println("a");
}
[/java]
Está deixando a linha 1 em negrito e não a 2.

Wrong hyphenation

When writing in portuguese, some words in english get wrongly hyphenated, like "javascript".

Markup between %% code %% section not recognized in HTML generation

When generating a latex book, the text below is parsed as expected:
%% some code with **crazy c pointers**%% then some **bold text** and %% more code with **crazy c pointers**%%
translates to monospace (without the extra spaces between the * 's):
\codechunk{ some code with * * crazy c pointers* * } then some bold text and \codechunk{ more code with * * crazy c pointers* * }, with 'underlined text' actually being underlined.

When I try to generate the same book as HTML, it translates every underscored chunks to underlined text, unaware that it should be escaped. Same happens to every other markup tag.

Rodar Tubaina no Windows

Não consegui nenhum tutorial para rodar Tubaina no Windows.

O preciso fazer para funcionar?

Desde já agradeço pelo retorno,

A better warning message when a file already exists

https://github.com/caelum/tubaina/blob/master/src/main/java/br/com/caelum/tubaina/resources/LatexResourceManipulator.java#L50-L54

I think it's not a good practice to log a warning using the text "Error" inside the message.

It's hard enough to find where the error happened and this message really doesn't help.

Anyway, I don't even think this could be considered a warning, once I'm using the same image in different chapters and I think there's no problem in it.

Can tubaina provide more info within parsing exceptions?

The file's name here would be so nice:

15:55:32,767  INFO [BookBuilder         ] Parsing chapter 12
br.com.caelum.tubaina.TubainaException: Only one [chapter] element is allowed per file.
    at br.com.caelum.tubaina.builder.BookBuilder.parseChapters(BookBuilder.java:95)

Qual a licença do Tubaina?

Olá Pessoal, qual a licença do Tubaina? Procurei e não encontrei... Posso desenvolver um produto comercial utilizando o tubaina como parte do meu software principal?

Att.

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.