GithubHelp home page GithubHelp logo

abelardopardo / adagio Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 2.0 16.98 MB

Agile Distributed Authoring Kit

Home Page: http://www.it.uc3m.es/abel/Adagio/FAQ.html

License: GNU General Public License v3.0

XML 50.38% Python 40.46% Assembly 0.35% C 5.66% Java 1.58% Scheme 0.22% Shell 1.03% JavaScript 0.32%

adagio's Introduction

Adagio: Agile Distributed AuthorinG Integrated tOolkit

This free software is copyleft licensed under the version 2 of the GPL license.

Adagio is a rule-based program (similar to "make") that given a file containing a set of rules, it automatically executes them. Given a directory and a set of rules, a new set of files are created by applying the rules automatically.

The rules are all included in a file with name {0}. The file is written in INI format. A rule is defined with a name in brackets at the begining of a line. Each rule has a set of name = value assignments.

The script visits the current directory and process the rule file included in that directory. If no rule is given when invoking adagio, all of the rules in the file are executed.

Usage:

The script accepts the following options:

-c filename: File containing the rule (default {0})

-d num: Debugging level. Used to control the amount of messages dumped. Possible values are:

      CRITICAL/FATAL = 5
      ERROR =          4
      WARNING =        3
      INFO =           2
      DEBUG =          1
      NOTSET =         0

-f path_to_rule_file: Given a path to a rule file, execute ADA in the directory where that file is, and with the given file as the rule file

-h: Shows this message

-p: Partial execution. Proceed even if some tools are not installed. Otherwise stop execution in the first missing tool.

-s 'rule name value': Executes the application by first storing in the environment the assignment name = value as part of a rule. This means that, unless overwritten by definitions in the properties file, this assignment will be visible to all the rules executed.

-x: Shows this message

Rules:

Adagio processes the following rules. For each of them a more detailed description can be obtained by executing the adagio with the rule "rulename.help" (where rulename is any of the following):

  • convert: Convert, resize, crop images in different formats.

  • dblatex: Executes dblatex over a set of Docbook files to translate them to LaTeX

  • dvips: Executes dvips over a set of given DVI files

  • exam: Typeset a Docbook file with a specific format into an exam.

  • exercise: Typeset a Docbook file and produce a hand out for students and (optionally) a solution document, professor guide, and submission form.

  • export: Copy a set of files from a source directory to a (possibly given from other execution) destination directory. The copy is executed if a set of conditions are fullfilled.

  • filecopy: Copy files from a source directory.

  • gimp: Transform all files in format *.xcf to PNG.

  • gotodir: Invoke the execution of Adagio in a different directory (recursively).

  • inkscape: Transform a SVG file created by Inkscape into PNG, EPS, PS or PDF

  • latex: Execute LaTeX over a set of give *.tex files.

  • office2pdf: Produce a PDF file from a given set of Office files (Word or PowerPoint).

  • pdfnup: Execute pdfnup over a set of PDF files to create n-up handouts.

  • rsync: Executes rsync to synchronize a source and a destination dir.

  • script: Executes an extra rule given as a Python script.

  • testexam: Typesets a Docbook document in a special format containing a set of multiple choice tests into an HTML document. The rule shuffles the questions and creates several versions.

  • xfig: Transform figures created with xfig into PNG format.

  • xsltproc: Applies a XSL style sheet to a given XML file.

If you execute adagio with a single parameter made of a rule name followed by the suffix ".help" it provides a more detailed description of the operations contained in the rule.

Contributors:

adagio's People

Contributors

jfisteus avatar abelardopardo avatar

Stargazers

Pablo Basanta avatar  avatar Israel Gutiérrez avatar Derick Leony avatar

Watchers

 avatar James Cloos avatar  avatar  avatar

Forkers

jfisteus

adagio's Issues

Uncaught exception when file not existing

In gotodir target, when specifying files_included_from, those files are not checked for existence. The check should be done and the anomaly reported in gotodir.py:203

Problem when building with XSLT an XML copied from other directory

The is a weird behaviour when applying the XSLT to an XML file which is copied from another directory.

Steps to reproduce the issue in the Admin/ProgSisComun repositories:

1.- Go to Admin/units/pilas-colas/guides. Execute adagio there. It copies index.xml and other files from ProgSisComun/units/pilas-colas/guides and then generates HTMLs from it.
2.- Change something in index.xml (the original file from ProgSisComun).
3.- Execute Adagio again in Admin/units/pilas-colas/guides. The new version of index.xml gets copied, and the HTMLs are generated again, but the change does not appear in the HTMLs. This is weird, because index.xml is already copied before the execution of the XSLT rule.
4.- Change another thing in index.xml (teh original file from ProgSisComun).
5.- Execute Adagio again. The new version of index.xml gets copied, and the HTMLs are generated again. Now the HTMLs show the change done in step 2, but not the change in step 4.
6.- Execute Adagio again. As the system does not detect changes, nothing happens. Therefore, the change in step 4 does not appear yet in the HTMLs.

It seems that the HTMLs are always one version delaid with respect to the index.xml file. On the contrary, if the change is done in "objectives.xml", which is included from index.xml, it appears immediately in the HTMLs as it should.

Refine detection of convert in Windows

Windows has an executable named "convert". Adagio simply checks for the presence of the executable as if it was part of the ImageMagick lib. Refine the procedure so that convert is properly detected.

Possible solution: Execute convert --version and detect the word ImageMagick on output as per JAF suggestion.

Production rule: docbook -> epub

A production rule would be desirable that given a single docbook file produces an epub package. The styles are present in docbook-xsl (although without profiling). The difficulty comes from the fact that two directories are created, the images need to be copied in the proper location as an additional step, a few additional passes are required and the zip created.

The rule would receive a single file name and perform all these steps. The trickiest one could be the inclusion of the right images or auxiliary files, but parsing the opf file could help detect anomalies.

This issue is likely to be open for quite some time.

LookupError: unknown encoding: 'UTF--8'

I get the following error when building ProgSisComun/general/schedule/groups-71-72:

[groups-71-72]$ adagio
++ ...af/asignaturas/2011-12/gtps/ada/ProgSisComun/general/schedule/groups-71-72
BB xslt
Producing index.html
Traceback (most recent call last):
  File "/home/jaf/proyectos/ada/ADA/bin/adagio", line 173, in <module>
    main()
  File "/home/jaf/proyectos/ada/ADA/bin/adagio", line 160, in main
    dirObject.Execute(targets)
  File "/home/jaf/proyectos/ada/ADA/adagio/directory.py", line 421, in Execute
    adagio.Execute(rule_name, self, pad)
  File "/home/jaf/proyectos/ada/ADA/adagio/__init__.py", line 547, in Execute
    eval(moduleName + '.Execute(rule, dirObj)')
  File "<string>", line 1, in <module>
  File "/home/jaf/proyectos/ada/ADA/adagio/xsltproc.py", line 96, in Execute
    toProcess, rule, dirObj)
  File "/home/jaf/proyectos/ada/ADA/adagio/xsltproc.py", line 291, in doTransformations
    dataTree)
  File "/home/jaf/proyectos/ada/ADA/adagio/xsltproc.py", line 353, in singleStyleApplication
    pretty_print = True)
  File "lxml.etree.pyx", line 1853, in lxml.etree._ElementTree.write (src/lxml/lxml.etree.c:44355)
  File "serializer.pxi", line 448, in lxml.etree._tofilelike (src/lxml/lxml.etree.c:90396)
LookupError: unknown encoding: 'UTF--8'```

Variable that holds the relative path from the project home

Sometimes it is useful to have access from a Properties.dgo file to the relative path from the project home to the current directory. For example, when replicating the source tree in the published tree, paths have to be harcoded in Properties.dgo, and need to be changed if the directory is renamed or moved to other location in the source tree.

I propose making a new variable available in Properties.dgo (e.g. relative_basedir) so that property files such as the following one work:

[gotodir]
files = %(resources_dir)s/files
export_dst = %(publish_dir)s/%(relative_basedir)s

There would be no need to change this Properties.dgo file event if the directory is moved around the source tree.

Consider it a low priority (wishlist) issue. I can do without it.

office2pdf dependency failure: too much execution

Directory with a set of *.doc files. Property file to produce PDF from them with office2pdf. One single rule. When one of the files is modified, the translation to PDF is done for all the files.

Dependency mechanism should execute only one translation to PDF, that of the file modified only.

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.