GithubHelp home page GithubHelp logo

david-kyrat / course-description-automation Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 574.32 MB

Course description automation application made as part of the class 12X015 Informatic Apps

Home Page: https://raw.githack.com/David-Kyrat/Course-Description-Automation-Docs/master/ch/index.html

License: MIT License

HTML 17.18% PowerShell 0.34% Rust 77.83% Shell 4.64%
automation pandoc rust scala unige

course-description-automation's Introduction

Unige - 12X015 | Course Description Automator

Application to automatically generate printable 1-2 page PDF of course descriptions.

Made with:

unige Rust Scala Java Neovim

GitHub commits GitHub last commit GitHub repo size wakatime


Example given:


Client Student / Developer Supervisor
Anne-Isabelle Giuntini Noah Munz Dr. Guillaume Chanel

Table of Contents


Quick Intro

This project was made using

  1. a JavaFx JavaFx GUI using mainly the framework/library Jfoenix
  2. a Scala application to fetch data from the unige database and generate markdown containing that data that each pdf will hold
  3. a Rust part to convert those markdown files to pdfs with pandoc and to link everything as well as act as a native launcher.
    The rust launcher also handles error handling displaying windowed pop-up for the user...

An image is worth a 1000 words so here is the use case diagram:

use case diagram

NB: The scala part is available in the scala branch

Meeting Reports

Meeting reports are available here. They are numbered and dated and contains a quick summary of what was discussed during the meeting as well as a list of all the participants.

Documentation

The file howto.md contains a quick summary of which/how technology has been used as well as some brief commands.

Its goal is not to be documentation on how to use the project but rather to categorize the "major steps" this project went through and to give some information on how to reproduce some of these steps.

"Published" documentation is available here: Scala-Documentation



Building From Source

Tl;Dr

If you just want to know which command to run and look at the details after / only if something goes wrong, just do this.

Download wkhtmltopdf, sbt and cargo. Then, we only have 2 commands.

  • sbt assembly
  • cargo build --release.

That's all.You just have to put the jar produced by sbt in files/res/java and and the executable generated by cargo should work. (Once you placed it at the root of the repo)

From clone to executable:

git clone -b scalight https://github.com/David-Kyrat/Course-Description-Automation.git
cd Course-Description-Automation
sbt                         # (sbt shell will popup, then enter:)
    clean; reload; assembly
    exit

cp target/scala-2.13/course-description-automation.jar .. # copy the jar outside

# Now build rust
git checkout master
# put jar produced by sbt in java folder
mv ../course-description-automation.jar  files/res/java  
cd src/main/rust
cargo build --release
# put the executable at the root of the repo
cp target/release/Course-Description-Automation.exe ../../../ 

Now while this may look big and tedious, 70% of what's done here is just cloning and copying/moving a built artifact. The only Interaction we've had with the build tools were, in fact, just sbt assembly and
cargo build --release.


More infos about build

Dependencies

wkhtmltopdf must be findable by pandoc (i.e. in $PATH) for this to work.

JavaFx Gui Part

Building the gui is currently not supported. Please use the following to launch it. (depends on)

  • core-[version].jar
  • fancyform.jar
  • javafx-swt.jar
  • jfoenix-[version].jar
  • jvm.driver-[version].jar

command:

java --module-path <javaFx/lib directory> --add-modules javafx.controls,javafx.fxml,javafx.graphics -jar fancyform.jar <path to abbrev.tsv file (usually /files/res/abbrev.tsv)>

e.g. (in /files/res/java)

jdk-17/bin/java --module-path javafx-sdk-17/lib --add-modules javafx.controls,javafx.fxml,javafx.graphics -jar fancyform.jar ../abbrev.tsv

NB: On windows use javafx-sdk-19 instead of 17. (17 is the mac version)

NB: If you want to make your own, it is very easy to integrate it with the actual project.
Everything the JavafxGui is sending 1 string as argument to the scala application.

the string is of the form course_id1,course_id2,...#student_plan_id1,student_plan_id2....
The # is not optional.
i.e. course_id1# or #student_plan_id1 is a valid input, but not course_id1 or student_plan_id1.

Scala
  • Scala build tool: sbt

Others are directly managed via sbt. (configured via build.sbt)

(We have the scala lang base module, scala lang parallel collections module and Gson, the google json library for java)

Rust

Actual Building

Scala Part

To build the scala part go to the scalight branch that contains only scala related source & resource. (We will see later why this is needed / important)
and simply run sbt at the root of the project the sbt shell should pop up.

Once it has, enter the command clean; reload; assembly like so:

sbt:Course-Description-Automation> clean; reload; assembly

(if you haven't modified build.sbt you can just enter assembly).

assembly will compile & package everything in the src directory as long as the library to make one "fat-jar" located at target/scala-2.13/course-description-automation.jar.

(If we had our rust code in this branch, then sbt would've added the entiere rust project with it as well as some uneeded resources present only in master).

Rust Part

Like for sbt this is pretty straightforward.

Go to src/main/rust and enter cargo build --release like so:

.../Course-Description-Automation/src/main/rust $:  cargo build --release

the compiled binary should be at src/main/rust/target/release/Course-Description-Automation


End Packaged Structure

Now that you've build the project, it should have the following structure to work.

./
├── Course-Description-Automation (executable)
│ 
├── files/
│   └── res/
│       └── bin-converters/
│           ├── pandoc
│           ├── java/
│           │   ├── javafx-sdk-17
│           │   ├── jdk17
│           │   ├── core-[version].jar
│           │   ├── fancyform.jar
│           │   ├── javafx-swt.jar
│           │   ├── jfoenix-[version].jar
│           │   ├── jvm.driver-[version].jar
│           │   │ 
│           │   └── course-description-automation.jar
│           │
│           ├── log/ (optional will get generated at runtime)
│           ├── md/
│           ├── pdf/
│           ├── templates/
│           │   ├── course-desc.css
│           │   ├── template.html
│           │   └── unige.png
│           ├── abbrev.tsv
│           └── logging_config.yaml
│ 
└── pdfs/ --> ./files/res/pdf/  (shortcut)
│ 
└── LICENSE

You can get the files directory from a release on the release page. Its the same one.
The symlink to ./files/res/pdf is not mandatory but its convenient for the user.


course-description-automation's People

Contributors

david-kyrat avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.