themerius / scaltex-2

Scaltex next generation. Projectional document generator.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status

Codename: scaltex-2

Install bower for javascript dependency management. Fetch the js dependencies with:

cd public
bower install

Note: public/lib is managed by bower. Note: If you fetch the dependencies "freshly", you should apply the At.js patch! See section Patching At.js. Note: The bower dependencies are commited to git, to preserve the entire code. If you are using the already commited client side javascript dependencies, you don't have to apply the At.js patch.

Install CouchDB, which should (for example) listen to http://127.0.0.1:5964/.

Install sbt to start the server, then simply run:

cd scaltex-2
sbt "run --init --home http://127.0.0.1:5964/mydocument"

View the Main Document, Meta Document or the LaTeX Code. The init flag pushes a simple test document to mydocument on the database, don't set init to load an already existing document. With the home flag you can specify, where your document resides.

Changelog

  • v0.6.1: 2014-08-22

    • Litte fixes in code, added some example figures (for thesis)
  • v0.6.0: 2014-07-28

    • This version gets a DOI (digital object identifier), therefore added bower dependencies for preservation purposes.

    • Added new documentelements: Code, Math, Quotation, Reference, Footnote, ArabicList, RomanList, List and Spray

    • Added LaTeX-Code projection under http://localhost:8000/latex

    • Various Bugfixes

    • Switch between 'send actor state updates every time' and 'send updates only on state change'. Do a HTTP GET on http://localhost:8000/switch. Attention: 'on change only' doesn't doen't reload the entire document, but it is faster because the browser isn't flooded by updates.

  • v0.5.0: 2014-06-17

    • Introducing meta document at location http://localhost:8000/meta You can use it for hidden elements, which are only interesting as reference within the actual document.

    • Remove elements within the hierarchy.

    • New document elements: Figure, Python Code, Table of Contents, Chemistry (Ketcher).

    • Added a Command Line Interface. init creates a new little example document, home specifies where the document is stored. sbt "run --init --home http://127.0.0.1:5984/mydocument"

  • v0.4.0: 2014-06-05

    • Introducing a more flexible and "generation friendly" architecture. Complete refactoring.

    • Update Xitrum 3.7 to 3.11 to 3.12 to 3.13.

    • Update Scala 2.10 to 2.11.1.

    • Now with hierarchy.

    • Insert and Move document elements within the hierarchy.

    • Better CouchDB persistance: load and save document at any couchdb-url.

    • Every document element can now have a short name for referencing (a "projectional variable")

    • Highlight the docuement element type on mouseover (on a with scala evaluated reference).

  • v0.3.0: 2014-05-08

    • Update Xitrum 3.4 to 3.5 to 3.7

    • New editor gui (but without Ketcher). Based on misc/semantic-editor/mock_2. Highligts annotations, support for auto completion.

    • CouchDB persistance support: can load and save test_document

  • v0.2.0: 2014-04-03

    • New Entities: SubSection, SubSubSection, Figure, PythonCode, ChemistryMolFormat.

    • Python code "live" runable, can pipe a result to an other entity actor.

    • Ketcher JavaScript Chemistry Editor added. "Live" edit of chemical formulars.

    • Sub-Sections can resolve it's section number.

  • v0.1.0: 2014-03-20

    • Actors as AST. Available Entities: Section, Text.

    • Entities can reference to each other.

    • Each Section can resolve it's section number.

    • Multiple Browers can edit the document.

    • Using bower to manage javascript dependencies.

    • Requirejs manages javascripts "imports" (AMD).

Contributions and Patches

My contributes to other open source projects used with scaltex:

Patching At.js

Via default At.js adds after a autocompleted term an space character ( ). To avoid this in v0.4.10 you must alter line 340 in "jquery.atwho.js" to:

content_node = "" + content;

The orginal line was:

content_node = "" + content + "<span contenteditable='false'>&nbsp;<span>";

Note: This should be contributed to future versions of At.js. This patch maybe should introduced as new settings flag, to be enable or disable spaces after autocompleted terms. Here's the discussion on github.

Appendix

Emphasized technologies, hints or other useful stuff which made implementation easier. And the documentation about found sources of technologies, which put out to be unsuitable or may useful (promising) for future work.

Used

Bibtex

The References documentelement uses the scala bibtex parser from bibimbap.io. I've resected it, so that only the bibtex parser is left. This bibtex parser is in src-bibtex and is compiled together with scaltex. Note: It needs as dependency Apache commons-lang3.

JSON on Scala side

Browser: ContentEditable

Browser: Modals / Lightbox

Browser: Autocomplete

Browser: White Space Handling

Browser: IFrame

Browser: Inject Scripts

My stackoverflow.com questions

Scala: General

Scala: Meta Programming

Scala: Regex

Javascript: Bower

Unsuitable

Technologies tried, but didn't entirely match the requirements.

As Editor View

As Autocomplete

Modal / Lightbox

Promising

Chemical Frameworks

Browser GUI Test Automation

Programming Languages

Scala Meta Programming "Hot Code"

„Metaprogramming refers to a variety of ways a program has knowledge of itself or can manipulate itself.“

Frameworks:

Mastering Reflection and the Scala Compiler Library:

Mastering ClassLoaders:

Browser: Coordinates and Cursor positions

Browser: Key Events

Browser: OCR

Browser: Code Highlight

Broser: Tag Input Box

Scaling: clustering and modularization

How could scaltex be modularized? Wrap every (bigger) document element in an Docker instance, to automatically compile, deploy document elements on meta model changes?

Hold the meta model in the database? Generate code of the actor system on meta model basis and deploy it (with docker)? The so started actor system could expose Akka's communication protocols, for distributed documents.

Or use a plugin architecture like OSGi to inject other meta models:

About

Scaltex next generation. Projectional document generator.

License:Other


Languages

Language:JavaScript 72.4%Language:CSS 12.4%Language:Scala 11.7%Language:CoffeeScript 2.2%Language:Python 0.8%Language:Shell 0.4%Language:Ruby 0.1%